Skip to content

JP-3622 Update refpix step for NIR detectors to use convolution kernel #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d8593c1
initial changes for convolution kernel at refpix
penaguerrero Aug 28, 2024
6fc2b3d
Merge branch 'main' into conv_kernel_model
penaguerrero Aug 29, 2024
1eed540
adding convolution kernel model to init
penaguerrero Aug 29, 2024
f3f0dfc
Merge branch 'main' into conv_kernel_model
penaguerrero Aug 30, 2024
f7765d0
Merge branch 'main' into conv_kernel_model
penaguerrero Sep 10, 2024
d1c67da
Merge branch 'main' into conv_kernel_model
penaguerrero Sep 13, 2024
de8c3e7
Merge branch 'main' into conv_kernel_model
penaguerrero Sep 17, 2024
d1fc7b0
Merge branch 'main' into conv_kernel_model
penaguerrero Oct 3, 2024
63462e2
Merge branch 'main' into conv_kernel_model
penaguerrero Oct 10, 2024
1d3f3fe
adding pr number and changes
penaguerrero Oct 22, 2024
236415a
Merge branch 'main' into conv_kernel_model
penaguerrero Nov 19, 2024
f66a0e4
Merge branch 'main' into conv_kernel_model
penaguerrero Nov 20, 2024
f917469
Merge branch 'main' into conv_kernel_model
penaguerrero Nov 20, 2024
96a1de8
Merge branch 'main' into conv_kernel_model
penaguerrero Nov 21, 2024
752344c
Update src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml
penaguerrero Nov 22, 2024
49c67bb
Update src/stdatamodels/jwst/datamodels/schemas/conv_kernel.schema.yaml
penaguerrero Nov 22, 2024
4ab95e5
Merge branch 'main' into conv_kernel_model
penaguerrero Nov 26, 2024
636b2f3
Update src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
braingram Nov 26, 2024
b7e50f9
addressing changes in PR
penaguerrero Nov 26, 2024
35f2ecf
Merge branch 'main' into conv_kernel_model
penaguerrero Dec 3, 2024
788f7bd
Merge branch 'main' into conv_kernel_model
penaguerrero Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/321.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding datamodel schema for jwst refpix convolution kernel.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth explicitly specifying it as the SIRSKernelModel here as well.

3 changes: 2 additions & 1 deletion src/stdatamodels/jwst/datamodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
from .rscd import RSCDModel
from .saturation import SaturationModel
from .segmap import SegmentationMapModel
from .sirs_kernel import SIRSKernelModel
from .slit import SlitModel, SlitDataModel
from .pastasossmodel import PastasossModel
from .sossextractmodel import SossExtractModel
Expand Down Expand Up @@ -140,7 +141,7 @@
'ReferenceFileModel', 'ReferenceCubeModel', 'ReferenceImageModel', 'ReferenceQuadModel',
'RegionsModel', 'ResetModel',
'ResolutionModel', 'MiriResolutionModel',
'RSCDModel', 'SaturationModel', 'SlitDataModel', 'SlitModel', 'SpecModel',
'RSCDModel', 'SaturationModel', 'SIRSKernelModel', 'SlitDataModel', 'SlitModel', 'SpecModel',
'SegmentationMapModel',
'SossExtractModel',
'SossWaveGridModel',
Expand Down
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 @@ -1790,6 +1790,15 @@ properties:
type: string
fits_keyword: R_COLLIM
blend_table: True
sirskernel:
title: NIR Optimized Convolution Kernel reference file information
type: object
properties:
name:
title: NIR Simple Improved Reference Subtraction
type: string
fits_keyword: R_SIRSKL
blend_table: True
cubepar:
title: IFU cube reference file information
type: object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/asdf/asdf-schema-1.0.0"
id: "http://stsci.edu/schemas/jwst_datamodel/sirs_kernel.schema"
allOf:
- $ref: referencefile.schema
- type: object
patternProperties:
"^(nrca1|nrca2|nrca3|nrca4|nrcalong|nrcb1|nrcb2|nrcb3|nrcb4|nrcblong|nrs1|nrs2|mirimage|mirifulong|mirifushort|nis)$":
type: object
properties:
gamma:
datatype: float64
zeta:
datatype: float64
required: [gamma, zeta]
32 changes: 32 additions & 0 deletions src/stdatamodels/jwst/datamodels/sirs_kernel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from .reference import ReferenceFileModel


__all__ = ['SIRSKernelModel']


class SIRSKernelModel(ReferenceFileModel):
"""
A data model for the NIR Optimized Convolution Kernel Fourier Coefficients,
also called Simple Improved Reference Subtraction (SIRS).

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/sirs_kernel.schema"
reftype = "sirskernel"

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

def on_save(self, path=None):
self.meta.reftype = self.reftype

Check warning on line 29 in src/stdatamodels/jwst/datamodels/sirs_kernel.py

View check run for this annotation

Codecov / codecov/patch

src/stdatamodels/jwst/datamodels/sirs_kernel.py#L29

Added line #L29 was not covered by tests

def validate(self):
super(SIRSKernelModel, self).validate()

Check warning on line 32 in src/stdatamodels/jwst/datamodels/sirs_kernel.py

View check run for this annotation

Codecov / codecov/patch

src/stdatamodels/jwst/datamodels/sirs_kernel.py#L32

Added line #L32 was not covered by tests
Loading