@@ -21,7 +21,7 @@ class PixelReplacement:
2121
2222 # Shortcuts for DQ Flags
2323 DO_NOT_USE = datamodels .dqflags .pixel ['DO_NOT_USE' ]
24- REPLACED = datamodels .dqflags .pixel ['LOW_QE ' ]
24+ FLUX_ESTIMATED = datamodels .dqflags .pixel ['FLUX_ESTIMATED ' ]
2525 NON_SCIENCE = datamodels .dqflags .pixel ['NON_SCIENCE' ]
2626
2727 # Shortcuts for dispersion direction for ease of reading
@@ -71,7 +71,7 @@ def replace(self):
7171 # ImageModel inputs (MIR_LRS-FIXEDSLIT)
7272 if isinstance (self .input , datamodels .ImageModel ):
7373 self .output = self .algorithm (self .input )
74- n_replaced = np .count_nonzero (self .output .dq & self .REPLACED )
74+ n_replaced = np .count_nonzero (self .output .dq & self .FLUX_ESTIMATED )
7575 log .info (f"Input model had { n_replaced } pixels replaced." )
7676 elif isinstance (self .input , datamodels .IFUImageModel ):
7777 # Attempt to run pixel replacement on each throw of the IFU slicer
@@ -107,12 +107,12 @@ def replace(self):
107107 self .output .dq
108108 )
109109
110- n_replaced = np .count_nonzero (trace_model .dq & self .REPLACED )
110+ n_replaced = np .count_nonzero (trace_model .dq & self .FLUX_ESTIMATED )
111111 log .info (f"Input MRS frame had { n_replaced } pixels replaced in IFU slice { i + 1 } ." )
112112
113113 trace_model .close ()
114114
115- n_replaced = np .count_nonzero (self .output .dq & self .REPLACED )
115+ n_replaced = np .count_nonzero (self .output .dq & self .FLUX_ESTIMATED )
116116 log .info (f"Input MRS frame had { n_replaced } total pixels replaced." )
117117 else :
118118 # NRS_IFU method - Fixed number of IFU slices to iterate over
@@ -145,12 +145,12 @@ def replace(self):
145145 self .output .dq
146146 )
147147
148- n_replaced = np .count_nonzero (trace_model .dq & self .REPLACED )
148+ n_replaced = np .count_nonzero (trace_model .dq & self .FLUX_ESTIMATED )
149149 log .info (f"Input NRS_IFU frame had { n_replaced } pixels replaced in IFU slice { i + 1 } ." )
150150
151151 trace_model .close ()
152152
153- n_replaced = np .count_nonzero (self .output .dq & self .REPLACED )
153+ n_replaced = np .count_nonzero (self .output .dq & self .FLUX_ESTIMATED )
154154 log .info (f"Input NRS_IFU frame had { n_replaced } total pixels replaced." )
155155
156156 # MultiSlitModel inputs (WFSS, NRS_FIXEDSLIT, ?)
@@ -160,7 +160,7 @@ def replace(self):
160160 slit_model = datamodels .SlitModel (self .input .slits [i ].instance )
161161 slit_replaced = self .algorithm (slit_model )
162162
163- n_replaced = np .count_nonzero (slit_replaced .dq & self .REPLACED )
163+ n_replaced = np .count_nonzero (slit_replaced .dq & self .FLUX_ESTIMATED )
164164 log .info (f"Slit { i } had { n_replaced } pixels replaced." )
165165
166166 self .output .slits [i ] = slit_replaced
@@ -177,7 +177,7 @@ def replace(self):
177177 dummy_model = datamodels .ImageModel (data = self .input .data [i ], dq = self .input .dq [i ])
178178 dummy_model .update (self .input )
179179 dummy_replaced = self .algorithm (dummy_model )
180- n_replaced = np .count_nonzero (dummy_replaced .dq & self .REPLACED )
180+ n_replaced = np .count_nonzero (dummy_replaced .dq & self .FLUX_ESTIMATED )
181181 log .info (f"Input TSO integration { i } had { n_replaced } pixels replaced." )
182182
183183 self .output .data [i ] = dummy_replaced .data
@@ -322,7 +322,7 @@ def fit_profile(self, model):
322322 replaced_dq = np .where (
323323 (current_dq & self .DO_NOT_USE ^ current_dq & self .NON_SCIENCE == 1 ) &
324324 ~ (np .isnan (replaced_current )),
325- current_dq ^ self .DO_NOT_USE ^ self .REPLACED ,
325+ current_dq ^ self .DO_NOT_USE ^ self .FLUX_ESTIMATED ,
326326 current_dq
327327 )
328328
0 commit comments