Skip to content

Commit

Permalink
miri lrs specwcs datamodel
Browse files Browse the repository at this point in the history
  • Loading branch information
jemorrison committed Jan 28, 2025
1 parent b49f5f4 commit 49456a8
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/stdatamodels/jwst/datamodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
RegionsModel, WavelengthrangeModel, CameraModel, CollimatorModel, OTEModel,
FOREModel, FPAModel, IFUPostModel, IFUFOREModel, IFUSlicerModel, MSAModel,
FilteroffsetModel, DisperserModel, NIRCAMGrismModel, NIRISSGrismModel,
WaveCorrModel)
WaveCorrModel, MIRILrsModel)
from .wfssbkg import WfssBkgModel
from .util import open

Expand Down
109 changes: 109 additions & 0 deletions src/stdatamodels/jwst/datamodels/schemas/specwcs_miri_lrs.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.1.0"
id: "http://stsci.edu/schemas/jwst_datamodel/specwcs_miri_lrs.schema"
title: MIRI LRS Spec Schema
allOf:
- $ref: referencefile.schema
- $ref: keyword_pexptype.schema
- $ref: keyword_exptype.schema
- $ref: keyword_readpatt.schema
- $ref: keyword_filter.schema
- $ref: keyword_band.schema
- $ref: subarray.schema
- type: object
properties:
wave_table:
title: Wavelengths and x, y locations of wavelengths
fits_hdu: WAVETABLE
datatype:
- name: x_center
datatype: float32
unit: pixels
- name: y_center
datatype: float32
unit: pixels
- name: wavelength
datatype: float32
unit: microns
- name: x0
datatype: float32
unit: pixels
- name: y0
datatype: float32
unit: pixels
- name: x1
datatype: float32
unit: pixels
- name: y1
datatype: float32
unit: pixels
- name: x2
datatype: float32
unit: pixels
- name: y2
datatype: float32
unit: pixels
- name: x3
datatype: float32
unit: pixels
- name: y3
datatype: float32
unit: pixels
- type: object
properties:
meta:
type: object
properties:
x_ref:
type: number
title: x coord of ref position of MIRIM_SLIT
default: pixels
fits_keyword: IMX
y_ref:
type: number
title: y coord of ref position of MIRIM_SLIT
default: pixels
fits_keyword: IMY
x_ref_slitless:
type: number
title: x coord of ref position of MIRIM_SLITLESS
default: pixels
fits_keyword: IMXSLTL
y_ref_slitless:
type: number
title: y coord of ref position of MIRIM_SLITLESS
default: pixels
fits_keyword: IMYSLTL
v2_vert1:
type: number
title: Slit vertex 1 in V2 frame
fits_keyword: V2VERT1
v2_vert2:
type: number
title: Slit vertex 2 in V2 frame
fits_keyword: V2VERT2
v2_vert3:
type: number
title: Slit vertex 3 in V2 frame
fits_keyword: V2VERT3
v2_vert4:
type: number
title: Slit vertex 4 in V2 frame
fits_keyword: V2VERT4
v3_vert1:
type: number
title: Slit vertex 1 in V3 frame
fits_keyword: V3VERT1
v3_vert2:
type: number
title: Slit vertex 2 in V3 frame
fits_keyword: V3VERT2
v3_vert3:
type: number
title: Slit vertex 3 in V3 frame
fits_keyword: V3VERT3
v3_vert4:
type: number
title: Slit vertex 4 in V3 frame
fits_keyword: V3VERT4
39 changes: 38 additions & 1 deletion src/stdatamodels/jwst/datamodels/wcs_ref_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'WavelengthrangeModel', 'CameraModel', 'CollimatorModel', 'OTEModel',
'FOREModel', "FPAModel", 'IFUPostModel', 'IFUFOREModel', 'IFUSlicerModel',
'MSAModel', 'FilteroffsetModel', 'DisperserModel',
'NIRCAMGrismModel', 'NIRISSGrismModel', 'WaveCorrModel']
'NIRCAMGrismModel', 'NIRISSGrismModel', 'WaveCorrModel', 'MIRILrsModel']


class _SimpleModel(ReferenceFileModel):
Expand Down Expand Up @@ -343,6 +343,43 @@ def to_fits(self):
raise NotImplementedError("FITS format is not supported for this file.")


class MIRILrsModel(ReferenceFileModel):
"""
A model for a reference file of type "specwcs" for MIRI LRS Slit.
Parameters
----------
x_ref : float
x coordinate of reference position of fixed slit aperture
y_ref : float
y coordinate of reference position of fixed slit aperture
x_ref_slitless : float
x coordinate of reference position of slitless aperture
y_ref_slitless : float
y coordinate of reference position of slitless aperture
v2vert1 : float
slit vertex 1 in V2 frame
v2vert2 : float
slit vertex 2 in V2 frame
v2vert3 : float
slit vertex 3 in V2 frame
v2vert4 : float
slit vertex 4 in V2 frames
v3vert1 : float
slit vertex 1 in V3 frames
v3vert2 : float
slit vertex 2 in V3 frames
v3vert3 : float
slit vertex 3 in V3 frames
v3vert4 : float
slit vertex 4 in V3 frames
wavetable : numpy 2-D array
For each row in the slit hold wavelength, and
x center, ycenter, x and y box region cooresponding to the wavelength
"""
schema_url = "http://stsci.edu/schemas/jwst_datamodel/specwcs_miri_lrs.schema"
reftype = "specwcs"

class RegionsModel(ReferenceFileModel):
"""
A model for a reference file of type "regions".
Expand Down

0 comments on commit 49456a8

Please sign in to comment.