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

Add code showing how to remove NIRCam wisps #236

Merged
merged 9 commits into from
Sep 16, 2024

Conversation

bsunnquist
Copy link
Contributor

This notebook demonstrates how to scale, subtract, and/or flag the scattered light "wisps" from NIRCam data using new templates provided by the NIRCam team. The subtract_wisp.py contains the code, and the notebook shows how to use it and its optional arguments.

The First Cell

  • The title of the notebook in a first-level heading (eg. <h1> or # in markdown).
  • A brief description of the notebook.
  • A table of contents in an ordered list (1., 2., etc. in Markdown).
  • The author(s) and affiliation(s) (if relevant).
  • The date first published.
  • The date last edited (if relevant).
  • A link to the notebook's source(s) (if relevant).

The Rest of the Cells

  • There is only one H1 (# in Markdown) used in the notebook.
  • The notebook uses other heading tags in order (meaning it does not skip numbers).

Text

  • All link text is descriptive. It tells users where they will be taken if they open the link.
  • All acronyms are defined at least the first time they are used.
  • Field-specific/specialized terms are used when needed, but not excessively.

Code

  • Code sections are introduced and explained before they appear in the notebook. This can be fulfilled with a heading in a prior Markdown cell, a sentence preceding it, or a code comment in the code section.
  • Code has explanatory comments (if relevant). This is most important for long sections of code.
  • If the author has control over the syntax highlighting theme in the notebook, that theme has enough color contrast to be legible.
  • Code and code explanations focus on one task at a time. Unless comparison is the point of the notebook, only one method for completing the task is described at a time.

Images

  • All images (jpg, png, svgs) have an image description. This could be

    • Alt text (an alt property)
    • Empty alt text for decorative images/images meant to be skipped (an alt attribute with no value)
    • Captions
    • If no other options will work, the image is decribed in surrounding paragraphs.
  • 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

    • The type of visualization (like bar chart, scatter plot, etc.)
    • Title
    • Axis labels and range
    • Key or legend
    • An explanation of the visualization's significance to the notebook (like the trend, an outlier in the data, what the author learned from it, etc.)
  • 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.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@camipacifici
Copy link
Contributor

Hi @bsunnquist, thank you for the notebook! Is this ready for technical review?

@bsunnquist
Copy link
Contributor Author

Hi @camipacifici - yes, I think it's ready - thanks!

The only thing I wasn't sure on is the downloading of the wisp templates. We store them on Box, so I just provide a link for users to download them manually before running the notebook. I tried downloading them programmatically from Box but wasn't able to get it working, but let me know if that's preferred.

@camipacifici
Copy link
Contributor

The technical reviewer will help you solve that, no problem!
I forgot to ask, has this been scientifically reviewed? Maybe by somebody on the NIRCam team?

@bsunnquist
Copy link
Contributor Author

Sounds good thanks! And I've just tested it by myself, i.e. running on NIRCam data to make sure it works as expected.

@camipacifici
Copy link
Contributor

Ok, thanks. I leave it to @bhilbert4 and Roeland to decide if a science review is needed.

@bhilbert4
Copy link
Collaborator

I just reviewed the notebook, and it looks good to me. The only question I have @bsunnquist: is it possible for a user to turn on the scaling when they supply their own wisp template?
e.g. results = subtract_wisp('jw01063006004_02101_00005_nrcb4_cal.fits', wisp_data, scale_wisp=True, show_plot=True)
If so, it may be worth mentioning that explicitly.

@bsunnquist
Copy link
Contributor Author

@bhilbert4 Yes that's possible; I've added some clarification on that to the custom templates section.

@camipacifici
Copy link
Contributor

@bhilbert4 is this ready for technical review?

@bhilbert4
Copy link
Collaborator

bhilbert4 commented Aug 24, 2024

@camipacifici yes, ready for technical review.

@rizeladiaz
Copy link

@bsunnquist I forgot to mention that I had also changed the requirements.txt file to point to jwst 1.15.1 but I didn't send you that one. I tested it with that version.

  1. Could you please change the requirements.txt file to use 1.15.1
  2. Could you remove the last cell of the notebook? It adds a new empty cell after running the last cell. Probably we have to add a footer to prevent that from happening whenever there is a revision.

@bsunnquist
Copy link
Contributor Author

@rizeladiaz updated with those changes

Copy link

@rizeladiaz rizeladiaz left a comment

Choose a reason for hiding this comment

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

Ready to merge

@camipacifici camipacifici self-requested a review September 16, 2024 01:29
Copy link
Contributor

@camipacifici camipacifici left a comment

Choose a reason for hiding this comment

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

Good to go.

@camipacifici camipacifici merged commit abfb5f3 into spacetelescope:main Sep 16, 2024
6 checks passed
@camipacifici
Copy link
Contributor

Thank you @bsunnquist and @rizeladiaz!

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.

4 participants