From d8593c1b591dbf54ab633a842ff4c9b0d4e8851c Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Wed, 28 Aug 2024 09:47:34 -0400 Subject: [PATCH 1/3] initial changes for convolution kernel at refpix --- .../jwst/datamodels/conv_kernel.py | 31 +++++++++++++++++++ .../schemas/conv_kernel.schema.yaml | 22 +++++++++++++ .../jwst/datamodels/schemas/core.schema.yaml | 9 ++++++ 3 files changed, 62 insertions(+) create mode 100644 src/stdatamodels/jwst/datamodels/conv_kernel.py create mode 100644 src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml diff --git a/src/stdatamodels/jwst/datamodels/conv_kernel.py b/src/stdatamodels/jwst/datamodels/conv_kernel.py new file mode 100644 index 00000000..8dc461e4 --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/conv_kernel.py @@ -0,0 +1,31 @@ +from .reference import ReferenceFileModel + + +__all__ = ['ConvKernelModel'] + + +class ConvKernelModel(ReferenceFileModel): + """ + A data model for the NIR Optimized Convolution Kernel Fourier Coefficients. + + Parameters + __________ + data : numpy table + The reference waves to correct for 1/f at the REFPIX step for NIR data. + A table-like object containing the Fourier Coefficients for the + optimized convolution kernel. The format is the same for all NIR files + - Detector name: str + - gamma: float32 1D array + - zeta: float32 1D array + """ + schema_url = "http://stsci.edu/schemas/jwst_datamodel/conv_kernel.schema" + reftype = "conv_kernel" + + def __init__(self, init=None, **kwargs): + super(ConvKernelModel, self).__init__(init=init, **kwargs) + + def on_save(self, path=None): + self.meta.reftype = self.reftype + + def validate(self): + super(ConvKernelModel, self).validate() diff --git a/src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml new file mode 100644 index 00000000..1bba6621 --- /dev/null +++ b/src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml @@ -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/conv_kernel.schema" +allOf: +- $ref: referencefile.schema +- type: object + properties: + data: + title: NIR Optimized Convolution Kernel Fourier Coefficients + type: object + properties: + meta: + type: object + frequencies: + type: object + description: | + Detector name, gamma, and zeta values + subarray_cases: + type: object + description: | + Fourier Coefficients for NIR Optimized Convolution Kernel diff --git a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml index 08a7c72c..81d3167d 100644 --- a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml +++ b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml @@ -1785,6 +1785,15 @@ properties: type: string fits_keyword: R_COLLIM blend_table: True + conv_kernel: + title: NIR Optimized Convolution Kernel reference file information + type: object + properties: + name: + title: NIR Optimized Convolution Kernel reference file name + type: string + fits_keyword: R_CONVKL + blend_table: True cubepar: title: IFU cube reference file information type: object From 1eed54075299b0247b893d61a786d767d9f45bd7 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Thu, 29 Aug 2024 13:27:18 -0400 Subject: [PATCH 2/3] adding convolution kernel model to init --- src/stdatamodels/jwst/datamodels/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdatamodels/jwst/datamodels/__init__.py b/src/stdatamodels/jwst/datamodels/__init__.py index ac4b52d2..8af12073 100644 --- a/src/stdatamodels/jwst/datamodels/__init__.py +++ b/src/stdatamodels/jwst/datamodels/__init__.py @@ -12,6 +12,7 @@ from .barshadow import BarshadowModel from .combinedspec import CombinedSpecModel from .contrast import ContrastModel +from .conv_kernel import ConvKernelModel from .cube import CubeModel from .dark import DarkModel from .darkMIRI import DarkMIRIModel @@ -102,7 +103,7 @@ 'NrsMosApcorrModel', 'NrsFsApcorrModel', 'NrsIfuApcorrModel', 'AsnModel', 'BarshadowModel', 'CameraModel', 'CollimatorModel', - 'CombinedSpecModel', 'ContrastModel', 'CubeModel', + 'CombinedSpecModel', 'ContrastModel', 'ConvKernelModel','CubeModel', 'DarkModel', 'DarkMIRIModel', 'DisperserModel', 'DistortionModel', 'DistortionMRSModel', 'DrizParsModel', From 1d3f3fed95614a25f605c77696c30b27e6067499 Mon Sep 17 00:00:00 2001 From: Maria Pena-Guerrero Date: Tue, 22 Oct 2024 11:59:36 -0400 Subject: [PATCH 3/3] adding pr number and changes --- changes/321.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/321.feature.rst diff --git a/changes/321.feature.rst b/changes/321.feature.rst new file mode 100644 index 00000000..273889fb --- /dev/null +++ b/changes/321.feature.rst @@ -0,0 +1 @@ +Adding datamodel schema for jwst refpix convolution kernel.