Use interact() with Short-Cadence Data
See original GitHub issueProblem description
When attempting to use intereact() on short-cadence TPF file, a RunTimeError comes up due to having more than 20,000 cadences.
Example
from lightkurve import KeplerTargetPixelFile
tpf=KeplerTargetPixelFile("ktwo212460519-c17_spd-targ.fits")
tpf.pipeline_mask
tpf.interact()
BokehJS 0.12.16 successfully loaded.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-141-79d3753be6aa> in <module>()
4 tpf=KeplerTargetPixelFile("ktwo212460519-c17_spd-targ.fits")
5 tpf.pipeline_mask
----> 6 tpf.interact()
7
/home/jeff/anaconda2/lib/python2.7/site-packages/lightkurve/targetpixelfile.pyc in interact(self, lc)
459 # https://github.com/bokeh/bokeh/issues/7490
460 if len(lc.cadenceno) > 30000:
--> 461 raise RuntimeError('Interact cannot display more than 20000 cadences.')
462
463 # Map cadence to index for quick array slicing.
RuntimeError: Interact cannot display more than 20000 cadences.
Expected behavior
Ideally either a TPF could be trimmed to only include a certain cadence or time range, or interact() could have a variable that controls only including every Nth data point, or intereact() could have a cadence or time range as an input. Any of these options could get cadences < 20000 to allow interact() to work and perform smoothly.
Environment:
- Linx
- 1.0b9
- pip
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Use interact() with Short-Cadence Data · Issue #201 - GitHub
When attempting to use intereact() on short-cadence TPF file, a RunTimeError comes up due to having more than 20,000 cadences. Example. from ...
Read more >lightkurve.KeplerTargetPixelFile.interact
Display an interactive Jupyter Notebook widget to inspect the pixel data. ... more than ~30,000 cadences are contained in the TPF (e.g. short...
Read more >Using Interact — Jupyter Widgets 7.7.0 documentation
The interact function ( ipywidgets.interact ) automatically creates user interface (UI) controls for exploring code and data interactively. It is the easiest ...
Read more >kplr—A Python interface to the Kepler data
The basic work flow for interacting with the APIs starts by initializing an API object: import kplr client = kplr.API(). Then, this object...
Read more >eleanor Documentation - Adina Feinstein
If you use these data products, please cite Powell et al. ... point source will likely interact with the most, is a TargetData...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m going to close this issue since Short Cadence interact is now possible, albeit with some loss of the “big picture”. If anyone out there wants a range slider for interactively defining the short cadence data window size, please open an issue requesting this feature.
Note that this slicing should work for both Kepler/K2 and TESS data! Enjoy!
The new
.interact()
tool that is about to be released ( #216 ) does not support short cadence yet. The next step for interact is to add a module that detects whether the input TargetPixelFile is short cadence and, if so, adds a slider like the one @nattieg made at cool stars. Using bokeh widgets makes this task much easier now, so I am confident we will be able to resolve this issue soon.