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

JWST L1 ramp parser for Rampviz #3148

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Aug 12, 2024

Follow up after #3120 adding support for JWST L1 ramps.

The only major difference between JWST ramp files (any instrument) and Roman WFI is that JWST bundles time-series observations with multiple integrations into one 4D array of dimensions (integrations, groups, x-pixel, y-pixel), whereas Roman only ships single integrations in a 3D array.

This PR adds a parser for JWST Level 1 data products as fits files or Level1bModel models. By default, rampviz will load the zeroth integration, and specific integrations can be selected with, e.g.:

rampviz.load_data(path, integration=3)

Since this PR adds support for JWST, without the need for the optional Roman dependencies, the project code coverage test here is more useful than in #3120.

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added documentation Explanation of code and concepts cubeviz specviz testing imviz plugin Label for plugins common to multiple configurations labels Aug 12, 2024
@bmorris3 bmorris3 force-pushed the rampviz-jwst-parser branch from 14cfc61 to 566aebb Compare August 22, 2024 17:50
@bmorris3 bmorris3 added this to the 4.0 milestone Aug 22, 2024
@bmorris3 bmorris3 marked this pull request as ready for review August 22, 2024 19:22
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 57.57576% with 14 lines in your changes missing coverage. Please review.

Project coverage is 88.42%. Comparing base (3fc9f8d) to head (22546d9).
Report is 115 commits behind head on main.

Files with missing lines Patch % Lines
jdaviz/configs/rampviz/plugins/parsers.py 54.83% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3148      +/-   ##
==========================================
+ Coverage   87.21%   88.42%   +1.20%     
==========================================
  Files         122      122              
  Lines       18260    18264       +4     
==========================================
+ Hits        15926    16150     +224     
+ Misses       2334     2114     -220     

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


🚨 Try these New Features:

# swap axes per the conventions of ramp cubes
# (group axis comes first) and the default in
# rampviz (group axis expected last)
return np.swapaxes(x, 0, -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you ever plan to support beyond Roman vs JWST? Maybe instead of swapping, should hardcode the index by telescope name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not in the plans for now. If they become part of the plan, we'd need to build a parser for those "non-standard" cubes anyway, so I'll keep it like this for now.

@bmorris3 bmorris3 force-pushed the rampviz-jwst-parser branch from 1717d47 to 1b01efc Compare August 23, 2024 13:59
Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

Code looks good to me, and more importantly I ran the notebook and it works! The only thing I might suggest is splitting the imports in the concept notebook into a separate cell, so you don't have to download the Roman file from Box if you just want to run the JWST example.

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.

LGTM!

@bmorris3 bmorris3 merged commit a9b559b into spacetelescope:main Aug 26, 2024
18 of 19 checks passed
@bmorris3 bmorris3 mentioned this pull request Aug 26, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cubeviz documentation Explanation of code and concepts imviz plugin Label for plugins common to multiple configurations rampviz specviz testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants