Skip to content

Commit

Permalink
JP-3588: Implement new reference file datamodel for PASTASOSS transfo…
Browse files Browse the repository at this point in the history
…rmations (#320)
  • Loading branch information
tapastro authored Sep 16, 2024
2 parents ac1ebe1 + f78fb11 commit bebc1d5
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/320.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add datamodel and schema for ``PastasossModel``, a new reference file type for JWST NIRISS SOSS exposures.
2 changes: 2 additions & 0 deletions src/stdatamodels/jwst/datamodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
from .saturation import SaturationModel
from .segmap import SegmentationMapModel
from .slit import SlitModel, SlitDataModel
from .pastasossmodel import PastasossModel
from .sossextractmodel import SossExtractModel
from .sosswavegrid import SossWaveGridModel
from .spec import SpecModel
Expand Down Expand Up @@ -132,6 +133,7 @@
'NrcImgPhotomModel', 'NrcWfssPhotomModel',
'NisImgPhotomModel', 'NisSossPhotomModel', 'NisWfssPhotomModel',
'NrsFsPhotomModel', 'NrsMosPhotomModel',
'PastasossModel',
'PsfMaskModel',
'QuadModel', 'RampModel',
'RampFitOutputModel', 'ReadnoiseModel',
Expand Down
18 changes: 18 additions & 0 deletions src/stdatamodels/jwst/datamodels/pastasossmodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from .reference import ReferenceFileModel


__all__ = ['PastasossModel']


class PastasossModel(ReferenceFileModel):
"""
A data model to hold NIRISS SOSS wavelength grids.
This 1-D array of wavelengths can be saved from a processing run
and applied to future input products.
Parameters
__________
wavegrid : numpy float32 array
1-D array of the wavelengths corresponding to the ATOCA fit.
"""
schema_url = "http://stsci.edu/schemas/jwst_datamodel/pastasossmodel.schema"
9 changes: 9 additions & 0 deletions src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,15 @@ properties:
type: string
fits_keyword: R_OTE
blend_table: True
pastasoss:
title: NIRISS SOSS trace and wavecal reference file information
type: object
properties:
name:
title: SOSS trace and wavecal reference file name
type: string
fits_keyword: R_PSTSOS
blend_table: True
pathloss:
title: Pathloss reference file information
type: object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/fits-schema/fits-schema"
id: "http://stsci.edu/schemas/jwst_datamodel/pastasossmodel.schema"
allOf:
- $ref: referencefile.schema
- $ref: keyword_exptype.schema
- $ref: keyword_filter.schema
- type: object
properties:
meta:
type: object
properties:
pwcpos_cmd:
title: Commanded position
type: number
traces:
type: array
title: An array of trace models by order
items:
type: object
properties:
spectral_order:
title: Spectral order
type: integer
minimum: 1
pivot_x:
title: Pixel rotation point
type: number
pivot_y:
title: Pixel rotation point
type: number
trace:
title: The trace position
ndim: 2
datatype: float64
oversampling:
title: Pixel oversampling
type: integer
default: 1
padding:
title: Native pixel-size padding around the image
type: integer
default: 0
wavecal_models:
type: array
title: Polynomial regression model fitting wavelength to x, offset
items:
type: object
properties:
spectral_order:
title: Spectral order
type: integer
minimum: 1
polynomial_degree:
title: Polynomial degree of model
type: integer
coefficients:
title: List of polynomial coefficients
ndim: 1
datatype: float64
coefficient_labels:
title: Coefficient order specification
type: string
scale_extents:
title: Range of values for normalization
ndim: 2
datatype: float64
throughputs:
type: array
title: An array of GR700XD throughputs by order
items:
type: object
properties:
spectral_order:
title: Spectral order
type: integer
minimum: 1
throughput:
title: The throughput array
ndim: 1
datatype: float64
wavelength:
title: The wavelength array
ndim: 1
datatype: float64
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def flatten(xs):
'msaoper': None,
'nrm': dm.NRMModel,
'ote': dm.OTEModel,
'pastasoss': dm.PastasossModel,
'persat': dm.PersistenceSatModel,
'psfmask': dm.PsfMaskModel,
'readnoise': dm.ReadnoiseModel,
Expand Down

0 comments on commit bebc1d5

Please sign in to comment.