Skip to content

Commit

Permalink
JP-3543: Allow alternate resampling weight type in outlier detection (#…
Browse files Browse the repository at this point in the history
…8290)

Co-authored-by: Howard Bushouse <bushouse@stsci.edu>
  • Loading branch information
melanieclarke and hbushouse authored Apr 12, 2024
1 parent 903cc3c commit 6f412d7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ outlier_detection

- Add association id to ``outlier_i2d`` intermediate filenames. [#8418]

- Pass the ``weight_type`` parameter to all resampling function calls so that
the default weighting can be overridden by the input step parameter. [#8290]

pipeline
--------

Expand Down
4 changes: 2 additions & 2 deletions jwst/outlier_detection/outlier_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _convert_inputs(self):
dq=self.inputs.dq[i])
image.meta = self.inputs.meta
image.wht = build_driz_weight(image,
weight_type='ivm',
weight_type=self.outlierpars['weight_type'],
good_bits=bits)
self.input_models.append(image)
self.converted = True
Expand Down Expand Up @@ -199,7 +199,7 @@ def do_detection(self):
for i in range(len(self.input_models)):
drizzled_models[i].wht = build_driz_weight(
self.input_models[i],
weight_type='ivm',
weight_type=pars['weight_type'],
good_bits=pars['good_bits'])

# Initialize intermediate products used in the outlier detection
Expand Down
2 changes: 1 addition & 1 deletion jwst/outlier_detection/outlier_detection_scaled.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def do_detection(self):
for image in self.input_models:
image.wht = resample_utils.build_driz_weight(
image,
weight_type='ivm',
weight_type=pars['weight_type'],
good_bits=pars['good_bits']
)

Expand Down
2 changes: 1 addition & 1 deletion jwst/outlier_detection/outlier_detection_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def do_detection(self):
for i in range(len(self.input_models)):
drizzled_models[i].wht = resample_utils.build_driz_weight(
self.input_models[i],
weight_type='ivm',
weight_type=pars['weight_type'],
good_bits=pars['good_bits'])

# Initialize intermediate products used in the outlier detection
Expand Down
3 changes: 2 additions & 1 deletion jwst/outlier_detection/outlier_detection_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def process(self, input_data):

# Setup outlier detection parameters
pars = {
'weight_type': self.weight_type,
'weight_type': self.weight_type, # for calling the resample step
'wht_type': self.weight_type, # for calling the resample class directly
'pixfrac': self.pixfrac,
'kernel': self.kernel,
'fillval': self.fillval,
Expand Down

0 comments on commit 6f412d7

Please sign in to comment.