Giter VIP home page Giter VIP logo

Comments (11)

github-actions avatar github-actions commented on July 3, 2024

Hi there! πŸ‘‹ Thank you for opening your first Lightkurve issue! πŸ™ One of our maintainers will get back to you as soon as possible. πŸ‘©β€πŸš€ You can expect a response within 7 days. πŸ“… If you haven’t heard anything by then, feel free to ping this thread. πŸ›ŽοΈ We love that you are using Lightkurve and appreciate your feedback. πŸ‘

from lightkurve.

davidedionese avatar davidedionese commented on July 3, 2024

I have the same issue. I get the same error when trying to apply any custom mask (only specifying 'pipeline' works for me).
The error appears when just plotting too (targetpixelfile.plot(aperture_mask=...)).
Using version 2.4. Python 3.10. On a Ubuntu machine.

from lightkurve.

rebekah9969 avatar rebekah9969 commented on July 3, 2024

@cheesyminecart

Thank you very much for posting this issue.
Could you please provide me with a little more information regarding the environment you are using lightkurve in.

Environment
platform (e.g. Linux, OSX, Windows):
lightkurve version (e.g. 1.0b6):
installation method (e.g. pip, conda, source):

from lightkurve.

rebekah9969 avatar rebekah9969 commented on July 3, 2024

@davidedionese

Thank you very much for posting your issue. Could you please send me an example of the code and the problem that you are finding. Thank you.

from lightkurve.

davidedionese avatar davidedionese commented on July 3, 2024

Yes indeed.
My code (I am basically following the tutorial for the SNR of the periodogram):

import lightkurve as lk
import matplotlib.pyplot as plt
import numpy as np
import astropy.units as u

TARGET = "EPIC 211416749"
tpf = lk.search_targetpixelfile(TARGET, author="K2", campaign=5, cadence='short').download()

target_mask = tpf.create_threshold_mask(threshold = 10, reference_pixel = 'center')
tpf.plot(scale='log', aperture_mask=target_mask)

After the last line I get the following error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The line:

tpf.plot(scale='log', aperture_mask=tpf.pipeline_mask)

as suggested in the tutorial throws the same error.

Then I also try:

lc = tpf.to_lightcurve()

and I get the exact same error.
I am working in a conda environment, installing all packages through conda.
lightkurve version 2.4.0
Linux machine.
Running in Jupyter notebook.

from lightkurve.

rebekah9969 avatar rebekah9969 commented on July 3, 2024

@davidedionese

Thank you very much for this code and your environment set up.
Unfortunately i am not able to reproduce your error. To aid me in determining what is happening would you mind providing me with a bit more information, specifically:

  • The conda environment
  • Your version of python
  • Could you please print out what your target_mask looks like i.e., the array.

Thank you

from lightkurve.

davidedionese avatar davidedionese commented on July 3, 2024
  • Python version: 3.11.4
  • Numpy version: 1.25.2 (maybe it matters)
  • matplotlib version: 3.7.1
    Only these packages (and dependencies) are installed in the environment.
    Conda version: 23.7.2.
    The custom mask looks like this:
array([[False, False, False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False, False, False],
       [False, False, False, False,  True,  True, False, False, False, False, False],
       [False, False, False, False,  True,  True,  True, False, False, False, False],
       [False, False, False, False,  True,  True,  True,  True, False, False, False],
       [False, False, False, False,  True,  True,  True,  True, False, False, False],
       [False, False, False, False,  True,  True,  True,  True,  True, False, False],
       [False, False, False, False, False,  True,  True,  True, False, False, False],
       [False, False, False, False, False, False,  True, False, False, False, False],
       [False, False, False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False, False, False]])

from lightkurve.

cheesyminecart avatar cheesyminecart commented on July 3, 2024

Dear Rebekah,
Thanks for the reply! Sorry I wasn't able to give my own contribution to the discussion, though I am willing to provide the necessary details for a quick bugfix.

platform: OSX
installation: pip3
lk version: 2.4.0

from lightkurve.

rebekah9969 avatar rebekah9969 commented on July 3, 2024

Dear @cheesyminecart & @davidedionese

After much investigation by myself and my colleagues we have determined that this issue is related to the most recent version of numpy - version 1.25.0.

Within this version there was deprecation expiration and now an array of all True or all False is returned when values are fundamentally not comparable (e.g. have different dtypes). An example is:

np.array(["a"]) ==np.array([1])

You can read more about this here.

We are working on a fix for this issue, but in the meantime it might be worthwhile installing an older version of numpy.

Thank you once again for posting this issue and please let us know there are any more issues.

from lightkurve.

davidedionese avatar davidedionese commented on July 3, 2024

Dear @rebekah9969,

I tried with an older version of Numpy and indeed it works fine.

Thank you very much to you and your colleagues for your patience and your time!

from lightkurve.

christinahedges avatar christinahedges commented on July 3, 2024

@davidedionese, @cheesyminecart, please try updating to the newest version of lightkurve which is 2.4.1, and report back here if this does not solve your issue!

from lightkurve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.