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

NRMModel updates #359

Open
rcooper295 opened this issue Nov 11, 2024 · 6 comments · May be fixed by #361
Open

NRMModel updates #359

rcooper295 opened this issue Nov 11, 2024 · 6 comments · May be fixed by #361

Comments

@rcooper295
Copy link
Contributor

rcooper295 commented Nov 11, 2024

Discussion originating on #342) with @braingram :

I'm working on changing the AMI code to use values from the header of the NRM reference file rather than the hardcoded ones currently in mask_definitions.py. When I load the reference file as an NRMModel, the keywords I need are in the extra_fits part of the tree, but instead of being accessed like this they seem to be stored in nested lists and have to be accessed by their index [...] This whole issue may be irrelevant anyways; since these values will be important to the AMI code I was thinking it might make sense to have them be defined/required in the schema.

The reference file keywords aren't listed in the keyword dictionary and are in different schemas in this package. Adding them to the schema is required to get them out of "extra_fits". Adding them will require picking an attribute name so feel free to suggest one (or we can just use the current variable names) in that issue.

We concluded the values we need should be added to the NRMModel schema and therefore the keyword dictionary. I will confirm with other AMI team members what we want to call the attribute names (if different from the current FITS keyword names).

@rcooper295
Copy link
Contributor Author

I think we'd like the following FITS keywords to be defined in the NRMModel schema:

  • F2F = 0.82 / flat2flat hole size m
  • NRM_X_A1= 0.0 / X coordinate (m) of NRM sub-aperture 0
  • NRM_Y_A1= -2.64 / Y coordinate (m) of NRM sub-aperture 0
  • NRM_X_A2= -2.28631 / X coordinate (m) of NRM sub-aperture 1
  • NRM_Y_A2= 0.0 / Y coordinate (m) of NRM sub-aperture 1
  • NRM_X_A3= 2.28631 / X coordinate (m) of NRM sub-aperture 2
  • NRM_Y_A3= -1.3200001 / Y coordinate (m) of NRM sub-aperture 2
  • NRM_X_A4= -2.28631 / X coordinate (m) of NRM sub-aperture 3
  • NRM_Y_A4= 1.3200001 / Y coordinate (m) of NRM sub-aperture 3
  • NRM_X_A5= -1.14315 / X coordinate (m) of NRM sub-aperture 4
  • NRM_Y_A5= 1.98 / Y coordinate (m) of NRM sub-aperture 4
  • NRM_X_A6= 2.28631 / X coordinate (m) of NRM sub-aperture 5
  • NRM_Y_A6= 1.3200001 / Y coordinate (m) of NRM sub-aperture 5
  • NRM_X_A7= 1.14315 / X coordinate (m) of NRM sub-aperture 6
  • NRM_Y_A7= 1.98 / Y coordinate (m) of NRM sub-aperture 6

I've just copied these as they appear in the header currently. I think for the schema since we don't have the same character limits we could expand "f2f" to be "flat_to_flat". I'll also change the FITS comment for each keyword to match the 1-indexing in the names (apertures 1-7 instead of 0-6), but I think the other keyword names are ok as-is.

I can open a JWSTKD project JIRA ticket to get these added to the keyword dictionary as well, and I'll look at adding them to the NRMModel schema.
Do I just need to add a block like:

- type: object
  properties:
    meta:
      type: object
      properties:
        flat_to_flat:
          type: object
          required: [f2f]
        nrm_x_a1:
          type: object
          required: [nrm_x_a1]
        [...]
        required: [flat_to_flat, nrm_x_a1, ...]
  required: [meta]

@braingram
Copy link
Collaborator

Thanks!

Are these only for the NRMModel reference file? If so, there's no need for a keyword dictionary ticket (as that resource doesn't list reference file keywords).

@braingram
Copy link
Collaborator

As far as the schema update, if it works for you I'll open a PR with proposed changes and ping you for review/testing.

The example changes are on the right track but are missing fits_keyword entries, etc.

@braingram braingram linked a pull request Nov 12, 2024 that will close this issue
5 tasks
@braingram
Copy link
Collaborator

@rcooper295 How does #361 look?

@rcooper295
Copy link
Contributor Author

Are these only for the NRMModel reference file? If so, there's no need for a keyword dictionary ticket (as that resource doesn't list reference file keywords).

Yes, these are only for this reference file. Ok, I think I get it -- so the keyword dictionary only needs to have keywords that are in data products, but there are datamodel schemas for reference files as well as data products, and some individual keywords as well?

@braingram
Copy link
Collaborator

Exactly! The reference files datamodels use different schemas than the science product datamodels. The latter are the only ones that contain fits keywords that are also covered by the keyword dictionary.

I just merged a PR with docs updates that are relevant here:
https://stdatamodels.readthedocs.io/en/latest/jwst/datamodels/schemas.html

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 a pull request may close this issue.

2 participants