Skip to content

Commit

Permalink
creating emicorr datamodel and schema
Browse files Browse the repository at this point in the history
  • Loading branch information
penaguerrero committed Oct 9, 2023
1 parent 661f8c4 commit 2754fd2
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
*.DS_Store

# C extensions
*.so
Expand Down
25 changes: 21 additions & 4 deletions src/stdatamodels/jwst/datamodels/emi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from .reference import ReferenceFileModel
from stdatamodels.dynamicdq import dynamic_mask
from .dqflags import pixel


__all__ = ['EmiModel']
Expand All @@ -10,10 +12,25 @@ class EmiModel(ReferenceFileModel):
Parameters
__________
rfc_freq_short : numpy table
rfc_freq_medium : numpy table
rfc_freq_long : numpy table
max_amp : numpy table
data : numpy float32 array
The science data
dq : numpy uint32 array
Data quality array
err : numpy float32 array
Error array
dq_def : numpy table
DQ flag definitions
"""
schema_url = "http://stsci.edu/schemas/jwst_datamodel/emi.schema"

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

self.dq = dynamic_mask(self, pixel)

# Implicitly create arrays
self.err = self.err

37 changes: 37 additions & 0 deletions src/stdatamodels/jwst/datamodels/schemas/emi.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/fits-schema/fits-schema"
id: "http://stsci.edu/schemas/jwst_datamodel/emi.schema"
allOf:
- $ref: referencefile.schema
- $ref: subarray.schema
- $ref: keyword_exptype.schema
- $ref: keyword_filter.schema
- $ref: keyword_pfilter.schema
- $ref: keyword_readpatt.schema
- $ref: keyword_preadpatt.schema
- $ref: keyword_pupil.schema
- $ref: keyword_ppupil.schema
- $ref: keyword_channel.schema
- $ref: keyword_pchannel.schema
- $ref: keyword_band.schema
- $ref: keyword_pband.schema
- type: object
properties:
data:
title: The science data
fits_hdu: SCI
default: 0.0
ndim: 2
datatype: float32
dq:
title: Data quality array
fits_hdu: DQ
default: 0
datatype: uint32
err:
title: Error array
fits_hdu: ERR
default: 0.0
datatype: float32
- $ref: dq_def.schema

0 comments on commit 2754fd2

Please sign in to comment.