From 24aa688f5f33deca2b909981a71f3ab1d97eb2c0 Mon Sep 17 00:00:00 2001 From: jemorrison Date: Wed, 16 Oct 2024 11:28:16 -0700 Subject: [PATCH] draft of psf model --- src/stdatamodels/jwst/datamodels/__init__.py | 2 + src/stdatamodels/jwst/datamodels/psf.py | 24 ++++++++++ .../jwst/datamodels/schemas/psf.schema.yaml | 44 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 src/stdatamodels/jwst/datamodels/psf.py create mode 100644 src/stdatamodels/jwst/datamodels/schemas/psf.schema.yaml diff --git a/src/stdatamodels/jwst/datamodels/__init__.py b/src/stdatamodels/jwst/datamodels/__init__.py index 611cf80c..085d1f13 100644 --- a/src/stdatamodels/jwst/datamodels/__init__.py +++ b/src/stdatamodels/jwst/datamodels/__init__.py @@ -53,6 +53,7 @@ from .photom import NisImgPhotomModel, NisSossPhotomModel, NisWfssPhotomModel from .photom import NrsFsPhotomModel, NrsMosPhotomModel from .pixelarea import PixelAreaModel, NirspecSlitAreaModel, NirspecMosAreaModel, NirspecIfuAreaModel +from .psf import PsfModel from .psfmask import PsfMaskModel from .quad import QuadModel from .ramp import RampModel @@ -134,6 +135,7 @@ 'NisImgPhotomModel', 'NisSossPhotomModel', 'NisWfssPhotomModel', 'NrsFsPhotomModel', 'NrsMosPhotomModel', 'PastasossModel', + 'PsfModel', 'PsfMaskModel', 'QuadModel', 'RampModel', 'RampFitOutputModel', 'ReadnoiseModel', diff --git a/src/stdatamodels/jwst/datamodels/psf.py b/src/stdatamodels/jwst/datamodels/psf.py new file mode 100644 index 00000000..667a58d0 --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/psf.py @@ -0,0 +1,24 @@ +from .reference import ReferenceFileModel + + +__all__ = ['PsfModel'] + + +class PsfModel(ReferenceFileModel): + """ + A data model for 2-D PSF reference images + + Parameters + __________ + data : numpy float32 array + The PSF image + + wave : numpy float32 array + Wavelength image + + """ + schema_url = "http://stsci.edu/schemas/jwst_datamodel/psf.schema" + + def __init__(self, init=None, **kwargs): + super(PsfModel, self).__init__(init=init, **kwargs) + diff --git a/src/stdatamodels/jwst/datamodels/schemas/psf.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/psf.schema.yaml new file mode 100644 index 00000000..34a0e801 --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/schemas/psf.schema.yaml @@ -0,0 +1,44 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/fits-schema/fits-schema" +id: "http://stsci.edu/schemas/jwst_datamodel/psf.schema" +allOf: +- $ref: referencefile.schema +- $ref: keyword_exptype.schema +- $ref: keyword_readpatt.schema +- $ref: keyword_psubarray.schema +- $ref: keyword_grating.schema +- $ref: subarray.schema + +- type: object + properties: + meta: + type: object + properties: + psf: + title: PSF parameters + type: object + properties: + subpix: + title: oversampling factor + type: number + fits_keyword: SUBPIX + center_col: + title: column ePSF shifted to + type: number + fits_keyword: CENTCOL +- type: object + properties: + data: + title: The PSF image + fits_hdu: PSF + default: 0.0 + ndim: 2 + datatype: float32 + wave: + title: Wavelength image + fits_hdu: WAVE + default: 0 + ndim: 2 + datatype: float32 +