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

Created new MIRI imager notebook #23

Merged
merged 18 commits into from
Nov 14, 2024

Conversation

cracraft
Copy link

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

  • 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

@drlaw1558
Copy link
Collaborator

Thanks @cracraft ! Tagging @rizeladiaz

@rizeladiaz
Copy link
Collaborator

Will start checking this notebook now

@drlaw1558
Copy link
Collaborator

Checking in on the status of this review? @rizeladiaz

updates after technical review.
@rizeladiaz
Copy link
Collaborator

I finished with the last changes to the notebook and pushed the change to Misty's repo. Now Misty should make a pull request to the main repository to add this notebook.

@drlaw1558
Copy link
Collaborator

No new PR should be needed as your changes to Misty's branch should now be reflected in this PR. I'll aim to take a look at this later today if possible.

Copy link
Collaborator

@drlaw1558 drlaw1558 left a comment

Choose a reason for hiding this comment

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

  • Need to change the CRDS cell so that we aren't setting a CRDS version by default (since this should be handled on the CRDS side). Suggest following the updated NIRCam notebook and using the cell entry pasted below.

  • Why is this setting det1dict['refpix']['skip'] = True since this is what's already done in the parameter reference files?

  • Suggest changing some parameters used for the two plots at the end of the notebook so that they display on the page better instead of being hidden in overflowing-length cells. This should be possible just by setting the figure size to (8,8) instead of (20,20) and modifying the colorbar command to, e.g.,:
    cb = fig.colorbar(cax,fraction=0.046)

------------------------Set CRDS context and paths----------------------

Each version of the calibration pipeline is associated with a specific CRDS

context file. The pipeline will select the appropriate context file behind

the scenes while running. However, if you wish to override the default context

file and run the pipeline with a different context, you can set that using

the CRDS_CONTEXT environment variable. Here we show how this is done,

although we leave the line commented out in order to use the default context.

If you wish to specify a different context, uncomment the line below.

#%env CRDS_CONTEXT jwst_1293.pmap

Check whether the local CRDS cache directory has been set.

If not, set it to the user home directory

if (os.getenv('CRDS_PATH') is None):
os.environ['CRDS_PATH'] = os.path.join(os.path.expanduser('~'), 'crds')

Check whether the CRDS server URL has been set. If not, set it.

if (os.getenv('CRDS_SERVER_URL') is None):
os.environ['CRDS_SERVER_URL'] = 'https://jwst-crds.stsci.edu'

Echo CRDS path in use

print(f"CRDS local filepath: {os.environ['CRDS_PATH']}")
print(f"CRDS file server: {os.environ['CRDS_SERVER_URL']}")
if os.getenv('CRDS_CONTEXT'):
print(f"CRDS CONTEXT: {os.environ['CRDS_CONTEXT']}")

@drlaw1558
Copy link
Collaborator

Looks like that cell text failed entirely to format well in my comment, but I'm sure you get the idea.

@rizeladiaz
Copy link
Collaborator

HI David, I don't think you are checking the latest version of the notebook. In the new version it is not fixing CRDS and other changes to the text for the context. Not sure why it didn't merge properly to Misty's branch. Please check diaz-miriimager branch in Misty's repo. Though, there are a couple of changes that need to be added.

@drlaw1558
Copy link
Collaborator

@rizeladiaz Ah, I see, thanks. Remaining comments on that branch (now merged to Misty's main it looks like):

  • For the CRDS context text, I like the text above (comment with the awful formatting) that Bryan put in for the NIRCam notebook, so we should use that here too.
  • We should also apply the plot size and colorbar formatting to the third-from-last cell too.

@rizeladiaz
Copy link
Collaborator

Ok Done

@drlaw1558
Copy link
Collaborator

One final comment- the 20,20 should be changed to (8,8) in two places in that 3rd-to-last cell, not just one (in this case the main and subplot both declare a figure size).

@drlaw1558
Copy link
Collaborator

Another case where this is ready to merge, but I can't do so because of glitches in the automated checks (nor can I even click into the stalled check to see what the problem is). @sosey

@mgough-970 mgough-970 closed this Nov 14, 2024
@mgough-970 mgough-970 reopened this Nov 14, 2024
@mgough-970 mgough-970 merged commit f85d695 into spacetelescope:main Nov 14, 2024
8 checks passed
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