-
Notifications
You must be signed in to change notification settings - Fork 25
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
Several AMI related fits keywords in keyword dictionary not in datamodel schemas #342
Comments
I populated (or tried to populate?) the CALIB keyword here: https://github.com/spacetelescope/jwst/blob/main/jwst/ami/oifits.py#L583 |
Thanks! The datamodel schemas have no definition for self.calib_oimodel.meta.oifits.calib = calname doesn't produce a It is possible to list optional values in the datamodel schema (this is the default and extra schema keywords are needed to make something a requirement). The jwst files are extra complicated because there is also a keyword dictionary which separately lists all the FITS keywords in a different format. At the moment there are CALIB and PA keywords in the keyword dictionary but not in the datamodel schemas. Since the keywords are not in the schema they will never end up in a file. |
Thanks for the explanation! So will the line above that puts |
Possibly. It depends on how we define The mapping between datamodel tree location and FITS keyword is defined in the datamodel schemas (we can ignore the keyword dictionary as it's unused by cal). For example consider the beginning of the "core" schema:
which (in part) maps meta.date to the fits keyword DATE (in the default PRIMARY HDU). For CALIB (and possibly PA ) we could add those in a similar way to either the amioi schema or if the norm files have more differences perhaps a different schema and datamodel.
|
Sorry, I wrote a reply here but I guess didn't actually hit the comment button, and when my computer restarted it was lost... |
Thanks! Additional keywords and data columns should be fine (they are allowed by the OIFITS standard and the jwst datamodel schemas). I think for CALIB and PA it makes sense to put them in a different schema (not in the oifits schema directly). Let me know if a more detailed look is helpful (and a PR to update the schemas). If so I can see when I can fit that in. |
Thanks Brett! If it's not too much trouble for you to assist with a more detailed look at what changes need to be made that would be great. I'm definitely getting more familiar with the datamodels and can take a stab at it myself but that might end up taking longer for both of us. I also wanted to make sure @melanieclarke was in the loop on this as she's been my pipeline point-person for the rest of these changes. |
Certainly! I'm happy to help. Let me take a look at your draft jwst PR, the keyword dictionary tickets and schemas. I should hopefully be up to speed by mid-week and reach out with questions. Let me know if it's more urgent than that and we can set up a time to chat. |
Thanks so much! Let me know if there's any info I can help provide to clarify things. Mid-week would be amazing, I have a nominal goal to have the PR moved out of draft stage and towards actually being merged by the end of the week but that was before I knew about the datamodel changes we would need to make, so that can be flexible. |
How "sold" are you on "meta.oifits.calib" and "meta.oifits.pa" for the datamodel metadata attributes? How about "meta.calibrator_object_id" and "meta.telescope_roll_angle" instead: #357 |
That looks great to me! I'm not particularly attached to that nomenclature, so I'm happy to adopt your suggested ones. |
This will probably need to be opened as a separate issue, but while we're talking about datamodels, I have some more questions about FITS keywords. 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:
I'm wondering if I'm just opening the datamodel the wrong way, or if it's an issue with how the fits file was written in the first place, or something else? |
Thanks! Would you open a separate issue? 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. |
HDU: PRIMARY KEYWORD: CALIB
HDU: PRIMARY KEYWORD: PA
These may have been added in anticipation of future datamodel/pipeline work.
See: https://jira.stsci.edu/browse/JWSTKD-545
The text was updated successfully, but these errors were encountered: