-
Notifications
You must be signed in to change notification settings - Fork 21
Add NRC imaging notebook #19
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
Add NRC imaging notebook #19
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@drlaw1558 @sosey here is the NIRCam imaging mode notebook. It's essentially a copy of the NIRISS notebook from #18. Currently it downloads and processes one SW filter and one LW filter for a single program. One question I have though, is that I would like to address a question we get semi-regularly. That is: How do I resample data from multiple filters onto the same pixel grid. I could do that in a separate notebook in some other repo, or I could potentially add another filter to this notebook and do it here. Or swap out the LW data with a second SW filter? Currently, with one SW filter and one LW filter, the notebook produces ~8GB of data, and takes ~20 minutes to run (on my laptop). Total data volume of reference files is about 71 GB. |
@bhilbert4 Thanks! Also tagging @rizeladiaz |
@drlaw1558 Looks like I had some extra rate files sitting in the data directory from before I cut down the number of detectors. I was also double counting in a couple cases. The notebook now uses only 3 detectors. That translates into about 18GB of dark current data. All the other reference files only add another 1 GB or so. The LW data could be resampled onto the same pixel grid as the SW, or vice versa, but that does involve some non-default settings when calling image3. I'm not sure non-default you want to get in these notebooks. Maybe I could run the SW and LW through image3 with default settings, and then call image3 a second time on the LW data in order to put it on the SW grid? |
@bhilbert4 Great, that sounds like a much more tractable data volume in family with the other modes. Another way of looking at the issue: which approach will make it easier for a user to run the notebook on data from some arbitrary other program? Is the resampling onto a common grid something that could be achieved with just a few commented-out options in the image3 parameters block? If they only have one SW and one LW filter of data will the notebook fail? Is the method for getting two SW filter outputs to match the same as getting a LW and a SW filter to match? |
I'm not sure it's really possible to have this notebook act as a push-button way for all users to process all data from an arbitrary program. Some programs have a single SW/LW filter pair, while others have multiple pairs. So users will always have to think a little bit when trying to use this notebook with their data. Or at the very least, they may need a separate copy of the notebook for each filter pair they have. Resampling two datasets onto the same pixel grid is the same process whether you're talking about two SW filters, or a LW and a SW. Outside of setting parameter values in the resample step, there is one line of extra code needed. That's to save the gWCS from a first mosaic into an asdf file. This asdf file is then fed to the resampling of the second filter's data via the output_wcs parameter. So I could set up this notebook to run the LW data and save the asdf file. Then when calling image3 on the SW data I could add a note saying that if the user wants to resample onto the same grid, they just need to uncomment the output_wcs parameter. I'd probably add some text at that point mentioning that if the user has multiple SW filters they want on the same grid, they can use the same process. I think that makes more sense than changing the notebook to work on generic "filter 1" and "filter 2" data rather than SW and LW, even if the former case would cover more arbitrary use cases. |
Sounds good to me. |
@drlaw1558 @rizeladiaz I think this is ready for review. |
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.
- In the CRDS setup cell, we should not set an explicit CRDS version; this should be commented out (i.e., an option for users to explore). Correct CRDS version handling to match the pipeline software use will be done on the CRDS backend now, and doing this in the notebook makes it harder to run the notebook with more-recent pipeline versions.
- Likewise, remove the line printing the context from this cell since the keyword may be undefined. The CRDS version used will be printed in the log for each pipeline step.
@drlaw1558 I'm unable to merge because of the failing tests (which are failing because of the memory issue). Do you have permissions to merge a PR where all the tests are not passing? |
Hm, doesn't look like I can either. Passing this over to @sosey |
@bhilbert4 A few additional things that I just encountered:
|
@drlaw1558 I made updates so that the print statements in the demo setup are only called if demo_mode is true. I also separated the sw and lw statements such that when the user provides data, they can provide only sw, only lw, or both, and the notebook completes without errors. |
Looks good, thanks @bhilbert4 ! |
This notebook checklist has been made available to us by the the Notebooks For All team.
Its purpose is to serve as a guide for both the notebook author and the technical reviewer highlighting critical aspects to consider when striving to develop an accessible and effective notebook.
The First Cell
<h1>
or# in markdown
).1., 2.,
etc. in Markdown).The Rest of the Cells
#
in Markdown) used in the notebook.Text
Code
Images
All images (jpg, png, svgs) have an image description. This could be
alt
property)alt
attribute with no value)Any text present in images exists in a text form outside of the image (this can be alt text, captions, or surrounding text.)
Visualizations
All visualizations have an image description. Review the previous section, Images, for more information on how to add it.
Visualization descriptions include
All visualizations and their parts have enough color contrast (color contrast checker) to be legible. Remember that transparent colors have lower contrast than their opaque versions.
All visualizations convey information with more visual cues than color coding. Use text labels, patterns, or icons alongside color to achieve this.
All visualizations have an additional way for notebook readers to access the information. Linking to the original data, including a table of the data in the same notebook, or sonifying the plot are all options.