Skip to content

Commit

Permalink
remove resample_data boolean argument
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jul 26, 2024
1 parent 20207b1 commit 61aeee8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 1 addition & 9 deletions src/stcal/outlier_detection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def flag_resampled_crs(
scale1,
scale2,
backg,
resample_data,
):
"""
Detect outliers (CRs) using resampled reference data.
Expand All @@ -164,8 +163,7 @@ def flag_resampled_crs(
Error estimates for sci_data
blot_data : numpy.ndarray
Reference data used to detect outliers. If this reference data
was generated through resampling resample_data should be True.
Reference data used to detect outliers.
snr1 : float
Signal-to-noise ratio threshold used prior to smoothing.
Expand All @@ -182,17 +180,11 @@ def flag_resampled_crs(
backg : float
Scalar background to subtract from the difference.
resample_data : bool
If False skip the resampled data algorithm and instead call
`flag_crs` with a limited set of these parameters.
Returns
-------
cr_mask : numpy.ndarray
boolean array where outliers (CRs) are true
"""
if not resample_data:
return flag_crs(sci_data, sci_err, blot_data, snr1)
err_data = np.nan_to_num(sci_err)

blot_deriv = _abs_deriv(blot_data)
Expand Down
3 changes: 1 addition & 2 deletions tests/outlier_detection/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def test_flag_resampled_crs():
snr1, snr2 = 5, 4
scale1, scale2 = 1.2, 0.7
backg = 0.0
resample = True
crs = flag_resampled_crs(sci, err, blot, snr1, snr2, scale1, scale2, backg, resample)
crs = flag_resampled_crs(sci, err, blot, snr1, snr2, scale1, scale2, backg)
ys, xs = np.where(crs)
np.testing.assert_equal(ys, 2)
np.testing.assert_equal(xs, 3)
Expand Down

0 comments on commit 61aeee8

Please sign in to comment.