From cdb416354f513464461195ae9331d428c8888a35 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Wed, 28 Feb 2024 15:38:32 -0500 Subject: [PATCH] add schema and model for nrm reference file (#253) --- CHANGES.rst | 2 +- src/stdatamodels/jwst/datamodels/__init__.py | 2 ++ src/stdatamodels/jwst/datamodels/nrm.py | 16 ++++++++++++++++ .../jwst/datamodels/schemas/core.schema.yaml | 9 +++++++++ .../jwst/datamodels/schemas/nrm.schema.yaml | 15 +++++++++++++++ .../datamodels/tests/test_schema_against_crds.py | 1 + 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/stdatamodels/jwst/datamodels/nrm.py create mode 100644 src/stdatamodels/jwst/datamodels/schemas/nrm.schema.yaml diff --git a/CHANGES.rst b/CHANGES.rst index d4465a47..3891b6ba 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,7 +13,7 @@ Bug Fixes Changes to API -------------- -- +- Add ``NRMModel`` for new NIRISS NRM reference file [#253] Other ----- diff --git a/src/stdatamodels/jwst/datamodels/__init__.py b/src/stdatamodels/jwst/datamodels/__init__.py index 1b9819ed..ca2e1003 100644 --- a/src/stdatamodels/jwst/datamodels/__init__.py +++ b/src/stdatamodels/jwst/datamodels/__init__.py @@ -46,6 +46,7 @@ from .multislit import MultiSlitModel from .multispec import MultiSpecModel from .nirspec_flat import NirspecFlatModel, NirspecQuadFlatModel +from .nrm import NRMModel from .outlierpars import OutlierParsModel from .outlierifuoutput import OutlierIFUOutputModel from .pathloss import PathlossModel, MirLrsPathlossModel @@ -98,6 +99,7 @@ 'AmiLgModel', 'AmiLgFitModel', 'AmiOIModel', + 'NRMModel', 'FgsImgApcorrModel', 'MirImgApcorrModel', 'NrcImgApcorrModel', 'NisImgApcorrModel', 'MirLrsApcorrModel', 'MirMrsApcorrModel', 'NrcWfssApcorrModel', 'NisWfssApcorrModel', 'NrsMosApcorrModel', 'NrsFsApcorrModel', 'NrsIfuApcorrModel', diff --git a/src/stdatamodels/jwst/datamodels/nrm.py b/src/stdatamodels/jwst/datamodels/nrm.py new file mode 100644 index 00000000..5d7fddda --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/nrm.py @@ -0,0 +1,16 @@ +from .reference import ReferenceFileModel + + +__all__ = ['NRMModel'] + + +class NRMModel(ReferenceFileModel): + """ + A data model for Non-Redundant Mask. + + Parameters + __________ + nrm : numpy float32 array + Non-Redundant Mask + """ + schema_url = "http://stsci.edu/schemas/jwst_datamodel/nrm.schema" diff --git a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml index 853b9a42..ca1e3e4f 100644 --- a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml +++ b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml @@ -2028,6 +2028,15 @@ properties: type: string fits_keyword: R_MRSPT blend_table: True + nrm: + title: Non-Redundant mask reference file information + type: object + properties: + name: + title: Non-Redundant mask reference file name + type: string + fits_keyword: R_NRM + blend_table: True ote: title: Nirspec OTE Model reference file information type: object diff --git a/src/stdatamodels/jwst/datamodels/schemas/nrm.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/nrm.schema.yaml new file mode 100644 index 00000000..b79c0ae3 --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/schemas/nrm.schema.yaml @@ -0,0 +1,15 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/fits-schema/fits-schema" +id: "http://stsci.edu/schemas/jwst_datamodel/nrm.schema" +title: Non-Redundant Mask data model +allOf: +- $ref: referencefile.schema +- $ref: keyword_exptype.schema +- type: object + properties: + nrm: + title: Non-Redundant Mask + fits_hdu: NRM + ndim: 2 + datatype: float32 diff --git a/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py b/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py index 1bc6451f..20fb8dce 100644 --- a/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py +++ b/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py @@ -145,6 +145,7 @@ def flatten(xs): 'mrsptcorr': dm.MirMrsPtCorrModel, 'msa': dm.MSAModel, 'msaoper': None, + 'nrm': dm.NRMModel, 'ote': dm.OTEModel, 'persat': dm.PersistenceSatModel, 'psfmask': dm.PsfMaskModel,