Skip to content

Commit

Permalink
JP-3248: Add ref file data model and step keywords for new MIRI EMI c…
Browse files Browse the repository at this point in the history
…orrection (#200)
  • Loading branch information
penaguerrero authored Dec 7, 2023
1 parent e1d435d commit 1180473
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
*.DS_Store

# C extensions
*.so
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Other
- Updated JWST core datamodel schema to include the new step status keyword
"S_NSCLEN" for the new "nsclean" calibration step. [#237]

- Adding emicorr datamodel and schema, as well as
corresponding completion and reference file keywords [#200]



1.8.4 (2023-12-04)
==================
Expand Down
2 changes: 2 additions & 0 deletions src/stdatamodels/jwst/datamodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .darkMIRI import DarkMIRIModel
from .drizpars import DrizParsModel
from .drizproduct import DrizProductModel
from .emi import EmiModel
from .extract1dimage import Extract1dImageModel
from .extract1d_spec import Extract1dIFUModel
from .flat import FlatModel
Expand Down Expand Up @@ -107,6 +108,7 @@
'DisperserModel', 'DistortionModel', 'DistortionMRSModel',
'DrizParsModel',
'DrizProductModel',
'EmiModel',
'Extract1dImageModel',
'Extract1dIFUModel',
'FilteroffsetModel',
Expand Down
35 changes: 35 additions & 0 deletions src/stdatamodels/jwst/datamodels/emi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from .reference import ReferenceFileModel


__all__ = ['EmiModel']


class EmiModel(ReferenceFileModel):
"""
A data model to correct MIRI images for EMI contamination.
Parameters
__________
data : numpy table
The reference waves to correct for MIRI EMI.
A table-like object containing phase amplitude values
corresponding to the appropriate frequency
- Hz390: float32 1D array
- Hz218a: float32 1D array
- Hz218b: float32 1D array
- Hz218c: float32 1D array
- Hz164: float32 1D array
- Hz10: float32 1D array
"""
schema_url = "http://stsci.edu/schemas/jwst_datamodel/emi.schema"
reftype = "emicorr"

def __init__(self, init=None, **kwargs):
super(EmiModel, self).__init__(init=init, **kwargs)

def on_save(self, path=None):
self.meta.reftype = self.reftype
self.meta.instrument.name = "MIRI"

def validate(self):
super(EmiModel, self).validate()
14 changes: 14 additions & 0 deletions src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,15 @@ properties:
type: string
fits_keyword: R_DRZPAR
blend_table: True
emicorr:
title: MIRI EMI reference file information
type: object
properties:
name:
title: MIRI EMI correction reference file name
type: string
fits_keyword: R_MIREMI
blend_table: True
extract1d:
title: 1-D extraction parameters reference file information
type: object
Expand Down Expand Up @@ -2325,6 +2334,11 @@ properties:
type: string
fits_keyword: S_DQINIT
blend_table: True
emicorr:
title: MIRI EMI Correction
type: string
fits_keyword: S_MIREMI
blend_table: True
emission:
title: Telescope Emission Correction
type: string
Expand Down
22 changes: 22 additions & 0 deletions src/stdatamodels/jwst/datamodels/schemas/emi.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0"
id: "http://stsci.edu/schemas/jwst_datamodel/emi.schema"
allOf:
- $ref: referencefile.schema
- type: object
properties:
data:
title: MIRI Reference Waves Table for EMI correction
type: object
properties:
meta:
type: object
frequencies:
type: object
description: |
Frequency names, values, and phase amplitude values
subarray_cases:
type: object
description: |
Frequencies to correct for according to subarray

0 comments on commit 1180473

Please sign in to comment.