-
Notifications
You must be signed in to change notification settings - Fork 26
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
MIRI LRS specwcs datamodel #382
Conversation
Here is the first attempt at a data model for specwcs for MIRI slit data. This data model can be used for slit or slitless. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #382 +/- ##
==========================================
+ Coverage 67.59% 77.58% +9.98%
==========================================
Files 115 115
Lines 5932 5193 -739
==========================================
+ Hits 4010 4029 +19
+ Misses 1922 1164 -758 ☔ View full report in Codecov by Sentry. |
unit: pixels | ||
- name: y3 | ||
datatype: float32 | ||
unit: pixels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be helpful to add description (or title) for each of these fields. These can come as a minimum from the names in the FITS table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nden The names in the fits file are exactly these names and no more information in fits file is provided. I will give a shot at a description and run that by Greg Sloan who I think made these reference files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. The names are the same. I sent you a document with the description. I think it's good to add the descriptions because the meaning of the names is not obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
""" | ||
schema_url = "http://stsci.edu/schemas/jwst_datamodel/specwcs_miri_lrs.schema" | ||
reftype = "specwcs" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to be able to programmatically create a MIRILRSModel then you need to implement the __init__
method.
A populate_meta
method may be useful to make sure the required meta keywords are present.
Would yo consider renaming the model to MiriLRSSpecwcs
to be consistent with the other simialr models?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nden I will add init and populate_meta. I will follow what the other models do in wcs_ref_models.py. I have never made a model like this. Could you explain the reason these methods are in the model. Is it to able to create
a model in python - on the fly and not use a reference file.
On the name I tried to name the model in a way that was consistent with the other models defined in wcs_ref_models.py.
All the models had the instrument capitalized and did not have Specwcs in the model name. Am I missing something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it to able to create a model in python - on the fly and not use a reference file.
Yes, that's the only reason. If you think the model will be be initialized only by a file then it's not necessary to add an __init__
.
@braingram I am hoping you can help me. I have made a new datamodel MIRILrsModel (it is a specwcs model). |
The |
@braingram |
Thanks for the update. Having the test (or tests) closely match the usage is jwst seems most useful. Is there a jwst PR using this new model? If it's opening a reference file from CRDS one option would be to construct a test that opens a "faked" reference file with the new datamodel. Here's a test that does something similar:
I assume one other use will be for defining a reference file. In that case providing an array to the constructor, then saving the model, then verifying the contents seems like a good test to consider. Finally if this is a reference model mapped to a CRDS reference file the
|
@braingram I just pushed up changes. class wavetable_test: I get an error when I run this: |
@braingram |
Thanks for sharing the example. That error is caused by the schema expecting a structured array for the
Sounds good. This repository should hopefully be done with major style changes (and now aligns with the in-progress changes in jwst). These can certainly be disruptive to ongoing work. |
CLOSING PR in favor of #393
Helps to resolveJP-3848
Closes #
This PR adds a datamodel for the reference file type, specwcs, for the LRS. It can be used for Fixed slit and slitless.
The reference file for Fixed slit contains the V2, V3 corners of the slit. These values are not in the slitless reference file
and default to None when the reference files are read in using datamodels.
Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)jwst
regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>"
)news fragment change types...
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.misc.rst
: infrastructure or miscellaneous change