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 fits keywords to NRMModel schema #361

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Nov 12, 2024

Closes #359

The NRM reference files contain FITS keywords useful to CAL.
https://jwst-crds.stsci.edu/browse/jwst_niriss_nrm_0001.fits

This PR adds those keywords to the schema so they are accessible via the datamodel interface:

  • model.flat_to_flat
  • model.x_a1 etc...

Regression tests running at https://github.com/spacetelescope/RegressionTests/actions/runs/11802888443

Tasks

  • update or add relevant tests
  • update relevant docstrings and / or docs/ page
  • Does this PR change any API used downstream? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • run jwst regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>")
news fragment change types...
  • changes/<PR#>.feature.rst: new feature
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.doc.rst: documentation change
  • changes/<PR#>.removal.rst: deprecation or removal of public API
  • changes/<PR#>.misc.rst: infrastructure or miscellaneous change

@braingram braingram marked this pull request as ready for review November 12, 2024 17:51
@braingram braingram requested a review from a team as a code owner November 12, 2024 17:51
@braingram braingram mentioned this pull request Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.51%. Comparing base (a6994fa) to head (c6133f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #361   +/-   ##
=======================================
  Coverage   67.51%   67.51%           
=======================================
  Files         114      114           
  Lines        5913     5913           
=======================================
  Hits         3992     3992           
  Misses       1921     1921           

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

@rcooper295
Copy link
Contributor

I think this looks good! To make sure I understand, these will not be accessed via the meta tree but rather from the "top level" of the datamodel? I.e. model.x_a1 rather than model.meta.x_a1?

@braingram
Copy link
Collaborator Author

I think this looks good! To make sure I understand, these will not be accessed via the meta tree but rather from the "top level" of the datamodel? I.e. model.x_a1 rather than model.meta.x_a1?

Exactly! Feel free to give it a try with the current NRM reference file (and this branch) if you're curious.

@rcooper295
Copy link
Contributor

Thanks! I was able to try it with your branch and it looks good! I realized that there may be two additional keywords whose values are currently hardcoded but that we could read in from this model instead, but I need to confirm if they are actually the same as values we already have in the FITS header, and if so, what we should call the attributes. I should have an answer on that tomorrow.
(For more details, this is the message I sent the AMI team):

mask_definitions.py contains:

self.activeD = 6.559 * m  # webbpsf kwd DIAM  - not a 'circle including all holes'
self.OD = 6.610645669291339 * m  # Full pupil file size, incl padding, webbpsf kwd PUPLDIAM

while the NRM reference file currently contains:

DIAM    =             6.559348 / Flat-to-flat distance across pupil in V3 axis  
PUPLDIAM=             6.603464 / Full pupil file size, incl padding.            
PUPL_CRC=             6.603464 / Circumscribing diameter for JWST primary

I'm not sure if activeD should be the same as DIAM (it is, at least up to the fourth decimal place) and if OD should be the same as PUPLDIAM (it isn't quite) but if these are referring to the same quantity we should probably make them consistent.

@braingram
Copy link
Collaborator Author

I'll mark this as draft until we hear back about the extra keywords.

@braingram braingram marked this pull request as draft November 13, 2024 21:38
@rcooper295
Copy link
Contributor

I spoke to my AMI team members and chased down the source of these numbers (or what we should be using) and we'd like to add these two:

 diameter:
      fits_keyword: DIAM
      title: "[m] Flat-to-flat distance across pupil in V3 axis"
pupil_circumscribed:
      fits_keyword: PUPL_CRC
      title: "[m] Circumscribing diameter for JWST primary"

Thanks for your patience!!

@braingram braingram marked this pull request as ready for review November 14, 2024 14:44
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.

NRMModel updates
2 participants