-
Notifications
You must be signed in to change notification settings - Fork 76
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
Update Mosviz parser to load level 2 data #1835
Conversation
afc8112
to
8b09ea6
Compare
Need a change log. Thanks! |
I know! I thought we agreed that can wait until after approvals in case the PR drags on with lots of changes and conflicts in the changelog happen 😅 |
The NIRCam test data download link is here . Working on uploading the level 2 NIRSpec data I've been using to Box as well. |
Codecov ReportBase: 88.43% // Head: 88.46% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1835 +/- ##
==========================================
+ Coverage 88.43% 88.46% +0.02%
==========================================
Files 95 95
Lines 10487 10529 +42
==========================================
+ Hits 9274 9314 +40
- Misses 1213 1215 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
A sample NIRSpec level 2 dataset for testing is now on Box as well. |
6e1b18a
to
6432696
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a general review.
im_split = image_file.stem.split("_")[0] | ||
pupil = fits.getheader(image_file, ext=0).get('PUPIL') | ||
if "Direct Image" in files_by_labels: | ||
print("Loading: Images") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never liked printing stuff out to the notebook. While you are at this, should we move this to the snackbar info?
data_iter = get_image_data_iterator(app, temp, "Image", ext=None) | ||
data_obj = [d[0] for d in data_iter] # We do not use the generated labels | ||
image_data = data_obj[0] # Grab the first one. | ||
# TODO: Error if multiple found? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO for this PR or future work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question - I think I should do it here (or alternatively at least think about it and decide it's not needed). I can do that after meetings today.
Was able to get NIRCAM and NIRSpec level 2 data to load, nice work!! I can approve once CI passes or if local CI passes (assuming that astropy CI bug is ongoing). |
Nice try but change log is not astropy's fault. 😆 |
@rosteen , if you rebase again, doc should pass. |
5df9b00
to
c3b93ca
Compare
* JWST NIRISS | ||
* JWST NIRCam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only NIRSpec has (levels 2 and 3)
specified? What about NIRISS and NIRCam?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIRISS and NIRCam only have level 2 available from what I've been told, there is no level 3.
@@ -50,8 +67,6 @@ and for NIRISS: | |||
|
|||
jdaviz mosviz /path/to/my/data --instrument=niriss | |||
|
|||
If an instrument is not specified in either case, Mosviz will default to NIRSpec parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to keep this sentence but tell the user now that it would throw an error.
mosviz_helper.load_data(directory=data_dir) | ||
|
||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels unnatural to return
in a test function. Maybe this is a sign that parametrize is not suitable for this test case anymore. You don't need remote data to prove that the function will throw an exception, right? Theoretically, you could give a dummy file name/object and it would still throw the same exception?
Anyways, if we want to chuck this in the technical debt bin, we can refactor in the future and leave this as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Into the bin!
@javerbukh Tests passed, mind approving? |
9ff3b46
to
bb3951c
Compare
If you rebase, CI should be all green. FYI. |
Fix indent
Codestyle Add more checks to NIRCam test
Co-authored-by: P. L. Lim <[email protected]>
Co-authored-by: P. L. Lim <[email protected]>
bb3951c
to
30452e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks like code. Thanks!
Does what it says on the tin. In-progress, currently (mostly) working for NIRSpec level 2.
EDIT: ready for review, now also loads NIRCam data. I have NIRCam test data, I can upload that to Box (I trimmed a couple real files from ~1200 sources down to 20 to speed things up) and add a test.