Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding TPF translator and parser #75

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Dec 19, 2023

Try it out with:

import astropy.units as u
from astropy.time import Time
from lightkurve import search_lightcurve, search_targetpixelfile

from lcviz import LCviz

# download a Kepler TPF:
tpf = search_targetpixelfile('KIC 6922244', author="Kepler", quarter=9, cadence="long").download()

# download a TESS TPF:
# tpf = search_targetpixelfile('TIC 307210830', mission="TESS", cadence="long").download()


# Load the light curve into LCviz:
lcviz = LCviz()
lcviz.load_data(tpf)
lcviz.show()

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (8f5d02e) 93.91% compared to head (e129bef) 93.30%.

Files Patch % Lines
lcviz/utils.py 83.66% 25 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           feature-tpf      #75      +/-   ##
===============================================
- Coverage        93.91%   93.30%   -0.61%     
===============================================
  Files               35       35              
  Lines             1545     1689     +144     
===============================================
+ Hits              1451     1576     +125     
- Misses              94      113      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I'm a bit surprised to see this actually plot the light curve... where is that happening? Do we want that? Or do we want to force the logic through the (eventual) extraction plugin?

lcviz/parsers.py Outdated Show resolved Hide resolved
@kecnry
Copy link
Member

kecnry commented Dec 20, 2023

TODO for this PR:

Follow-up efforts (out-of-scope here):

  • filter/exclude TPF entries from lc viewer data menus (might need logic or refactoring upstream)
  • plugin-managed viewer to visualize cube (with appropriate data filtering in menu)
  • extraction plugin with live-preview and pipeline defaults
  • slice plugin with indicator in all time viewers
  • mouseover support for cube viewer(s)

@bmorris3 bmorris3 changed the title Adding Kepler TPF parser Adding TPF translator and parser Dec 20, 2023
@kecnry
Copy link
Member

kecnry commented Jan 3, 2024

It seems that the resulting cube is transposed with respect to the convention in cubeviz. Should we handle this here or elsewhere?

To test, try the following with my tpf-viewer branch, built on top of this:

from lightkurve import search_targetpixelfile
from lcviz import LCviz

tpf = search_targetpixelfile("HAT-P-11", mission="Kepler", cadence="long", quarter=10).download()

lcviz = LCviz()
lcviz.load_data(tpf)
lcviz.show()

lcviz.get_data().shape
# (4447, 22, 11) which is (time, x, y) whereas cubeviz uses (x, y, spectral_axis)

@kecnry kecnry mentioned this pull request Jan 19, 2024
4 tasks
@kecnry kecnry force-pushed the tpf-parse branch 2 times, most recently from bb7473e to c912a0f Compare January 23, 2024 18:03
@kecnry kecnry changed the base branch from main to feature-tpf January 23, 2024 18:07
Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage should fill in as this actually becomes usable 🤞

@kecnry kecnry merged commit 8c680ca into spacetelescope:feature-tpf Jan 23, 2024
9 of 11 checks passed
@kecnry kecnry mentioned this pull request Feb 14, 2024
1 task
kecnry added a commit that referenced this pull request Apr 5, 2024
* Adding TPF translator and parser (#75)
* TPF viewer (#81)
* make use of upstream refactor to override indices in lcviz (#83)
* fix creating phase-viewer when TPF is loaded (#86)
* Time Selector (adapted version of cubeviz's slice) plugin (#85)
* enable clone viewer for image/TPF viewer (#101)

---------

Co-authored-by: Brett M. Morris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants