Comments (11)
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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
@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)
- New feature request with pull request coming: lc.remove_data(start=start,end=end,col='str') HOT 3
- search_lightcurve unexpectedly can't find data HOT 9
- Issue with lk.search_lightcurve(TIC, author = 'SPOC') with AttributeError: module 'lightkurve' has no attribute 'search_lightcurve' HOT 6
- Can't access hdu from tesscut without saving file HOT 1
- Light curve does not search multiple cadences correctly HOT 3
- Error calling .to_periodogram HOT 10
- Typo in "Searching & downloading Kepler, K2, and TESS data" tutorial HOT 5
- LightCurve.to_fits extra_data keyword not working? HOT 2
- lc.to_fits() + lk.io.read() does not preserve correct FLUX_ORIGIN meta data for SAP_FLUX data HOT 1
- Type error on stitch() HOT 4
- Attempts to download from lightkurve results in a KeyError: 'dataURL' HOT 14
- branch v2.4.x and main is of of sync that could cause merge headache
- Unable to download a lightcurve HOT 1
- showing key error "data URL" while trying to download a targetpixelfile HOT 3
- SearchResult no longer ordered chronologically, it could break user expectation HOT 4
- Having Trouble with lc.download for various stars trying to download TESS-SPOC data HOT 3
- Enhance `TargetPixelFile.interact()` to let user access the selected pixels mask directly in Jupyter notebooks
- Potential memory leak using `lightkurve.read` HOT 3
- Support changes in QLP lightcurves in sectors 56+ (renaming of detrended flux columns, etc.) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightkurve.