File tree Expand file tree Collapse file tree 5 files changed +63
-4
lines changed
src/wfi_reference_pipeline Expand file tree Collapse file tree 5 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 103103REF_TYPE_MASK = "MASK"
104104REF_TYPE_MULTIACCUMULATIONTABLE = "MATABLE"
105105REF_TYPE_PEDESTAL = "PEDESTAL"
106+ REF_TYPE_PHOTOM = "PHOTOM"
106107REF_TYPE_PIXELAREA = "PIXELAREA"
107108REF_TYPE_READNOISE = "READNOISE"
108109REF_TYPE_REF_COMMON = "REF_COMMON"
111112REF_TYPE_REFPIX = "REFPIX"
112113REF_TYPE_SATURATION = "SATURATION"
113114REF_TYPE_SUPERBIAS = "SUPERBIAS"
114- REF_TYPE_WFI_IMG_PHOTOM = "WFI_IMG_PHOTOM"
115+
115116
116117WFI_REF_TYPES = {
117118 REF_TYPE_ABVEGAMAGNITUDEOFFSET ,
130131 REF_TYPE_MASK ,
131132 REF_TYPE_MULTIACCUMULATIONTABLE ,
132133 REF_TYPE_PEDESTAL ,
134+ REF_TYPE_PHOTOM ,
133135 REF_TYPE_PIXELAREA ,
134136 REF_TYPE_READNOISE ,
135137 REF_TYPE_REF_COMMON ,
136138 REF_TYPE_REF_EXPOSURE_TYPE ,
137139 REF_TYPE_REF_OPTICAL_ELEMENT ,
138140 REF_TYPE_REFPIX ,
139141 REF_TYPE_SATURATION ,
140- REF_TYPE_SUPERBIAS ,
141- REF_TYPE_WFI_IMG_PHOTOM ,
142+ REF_TYPE_SUPERBIAS
142143}
143144
144145WFI_REF_TYPES_WITHOUT_INPUT_DATA = {
147148 REF_TYPE_DARKDECAYSIGNAL ,
148149 REF_TYPE_DETECTORSTATUS ,
149150 REF_TYPE_ETC ,
150- REF_TYPE_WFI_IMG_PHOTOM ,
151+ REF_TYPE_PHOTOM ,
151152}
152153
153154WFI_TYPE_IMAGE = "WFI_IMAGE"
Original file line number Diff line number Diff line change 88Also see https://github.com/spacetelescope/roman-wfi-reference-pipeline/blob/main/src/docs/how_to_make_new_reftype.txt
99which is basically a step by step procedure needed to generate a new reference type and meta handlers used for development
1010and testing.
11+
12+ Example code to utilize meta makers:
13+ from wfi_reference_pipeline.resources.make_dev_meta import MakeDevMeta
14+ from wfi_reference_pipeline.resources.make_test_meta import MakeTestMeta
15+
16+ tmp = MakeDevMeta(ref_type='PHOTOM')
17+ tmp_test = MakeTestMeta(ref_type='PHOTOM')
18+
19+ print(tmp.meta_photom)
1120"""
Original file line number Diff line number Diff line change 3838 WFIMetaMultiAccumulationTable ,
3939)
4040from wfi_reference_pipeline .resources .wfi_meta_pedestal import WFIMetaPedestal
41+ from wfi_reference_pipeline .resources .wfi_meta_photom import WFIMetaPhotom
4142from wfi_reference_pipeline .resources .wfi_meta_readnoise import WFIMetaReadNoise
4243from wfi_reference_pipeline .resources .wfi_meta_referencepixel import (
4344 WFIMetaReferencePixel ,
@@ -130,6 +131,9 @@ def _create_dev_meta_matable(self, meta_data):
130131 def _create_dev_meta_pedestal (self , meta_data ):
131132 self .meta_pedestal = WFIMetaPedestal (* meta_data )
132133
134+ def _create_dev_meta_photom (self , meta_data ):
135+ self .meta_photom = WFIMetaPhotom (* meta_data )
136+
133137 def _create_dev_meta_readnoise (self , meta_data ):
134138 mode = WFI_MODE_WIM
135139 type = WFI_TYPE_IMAGE
@@ -224,6 +228,9 @@ def __init__(self, ref_type):
224228
225229 if ref_type == "PEDESTAL" :
226230 self ._create_dev_meta_pedestal (meta_data_params )
231+
232+ if ref_type == "PHOTOM" :
233+ self ._create_dev_meta_photom (meta_data_params )
227234
228235 if ref_type == "READNOISE" :
229236 self ._create_dev_meta_readnoise (meta_data_params )
Original file line number Diff line number Diff line change 1313 REF_TYPE_LINEARITY ,
1414 REF_TYPE_MASK ,
1515 REF_TYPE_PEDESTAL ,
16+ REF_TYPE_PHOTOM ,
1617 REF_TYPE_READNOISE ,
1718 REF_TYPE_REFPIX ,
1819 REF_TYPE_SATURATION ,
4445from wfi_reference_pipeline .resources .wfi_meta_linearity import WFIMetaLinearity
4546from wfi_reference_pipeline .resources .wfi_meta_mask import WFIMetaMask
4647from wfi_reference_pipeline .resources .wfi_meta_pedestal import WFIMetaPedestal
48+ from wfi_reference_pipeline .resources .wfi_meta_photom import WFIMetaPhotom
4749from wfi_reference_pipeline .resources .wfi_meta_readnoise import WFIMetaReadNoise
4850from wfi_reference_pipeline .resources .wfi_meta_referencepixel import (
4951 WFIMetaReferencePixel ,
@@ -124,6 +126,9 @@ def _create_test_meta_mask(self, meta_data):
124126 def _create_test_meta_pedestal (self , meta_data ):
125127 self .meta_pedestal = WFIMetaPedestal (* meta_data )
126128
129+ def _create_test_meta_photom (self , meta_data ):
130+ self .meta_photom = WFIMetaPhotom (* meta_data )
131+
127132 def _create_test_meta_readnoise (self , meta_data ):
128133 mode = WFI_MODE_WIM
129134 type = WFI_TYPE_IMAGE
@@ -209,6 +214,9 @@ def __init__(self, ref_type):
209214 if ref_type == REF_TYPE_PEDESTAL :
210215 self ._create_test_meta_pedestal (meta_data_params )
211216
217+ if ref_type == REF_TYPE_PHOTOM :
218+ self ._create_test_meta_photom (meta_data_params )
219+
212220 if ref_type == REF_TYPE_READNOISE :
213221 self ._create_test_meta_readnoise (meta_data_params )
214222
Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+ import wfi_reference_pipeline .constants as constants
4+ from wfi_reference_pipeline .resources .wfi_metadata import WFIMetadata
5+
6+
7+ @dataclass
8+ class WFIMetaPhotom (WFIMetadata ):
9+ """
10+ Class WFIMetaPhotom() Metadata Specific to Photom Reference File Type
11+ inherits WFIMetadata
12+ All Fields are required and positional with base class fields first
13+
14+ """
15+
16+ def __post_init__ (self ):
17+ super ().__post_init__ ()
18+ self .reference_type = constants .REF_TYPE_PHOTOM
19+
20+ def export_asdf_meta (self ):
21+ asdf_meta = {
22+ # Common meta
23+ 'reftype' : self .reference_type ,
24+ 'pedigree' : self .pedigree ,
25+ 'description' : self .description ,
26+ 'author' : self .author ,
27+ 'useafter' : self .use_after ,
28+ 'telescope' : self .telescope ,
29+ 'origin' : self .origin ,
30+ 'instrument' : {'name' : self .instrument ,
31+ 'detector' : self .instrument_detector
32+ },
33+ }
34+ return asdf_meta
You can’t perform that action at this time.
0 commit comments