-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JP-3622 Update refpix step for NIR detectors to use convolution kernel (
#321)
- Loading branch information
Showing
5 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Adding datamodel schema for jwst refpix convolution kernel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/stdatamodels/jwst/datamodels/schemas/sirs_kernel.schema.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
def validate(self): | ||
super(SIRSKernelModel, self).validate() |