diff --git a/specreduce/tests/test_tracing.py b/specreduce/tests/test_tracing.py index 3421d00..b8040ed 100644 --- a/specreduce/tests/test_tracing.py +++ b/specreduce/tests/test_tracing.py @@ -156,8 +156,6 @@ def test_fit_trace(): nddat = NDData(data=img, mask=mask, unit=u.DN) warn_bins = np.arange(20) warn_bins = ', '.join([str(x) for x in warn_bins]) - msg = f"All pixels in bin 75 are masked. Falling to trace value from all-bin fit." + msg = f"All pixels in bin {warn_bins} are masked. Falling to trace value from all-bin fit." with pytest.warns(UserWarning, match=msg): FitTrace(nddat) - - # could try to catch warning thrown for all-nan bins \ No newline at end of file diff --git a/specreduce/tracing.py b/specreduce/tracing.py index f7838f3..ba06c9b 100644 --- a/specreduce/tracing.py +++ b/specreduce/tracing.py @@ -310,7 +310,6 @@ def __post_init__(self): warn_bins.append(i) peak_y_i = peak_y - if self.peak_method == 'gaussian': yy_i_above_half_max = np.sum(z_i > (z_i.max() / 2)) width_guess_i = yy_i_above_half_max / gaussian_sigma_to_fwhm @@ -355,7 +354,7 @@ def __post_init__(self): if len(warn_bins) > 20: warn_bins = warn_bins[0: 10] + ['...'] + warn_bins[10: 19] warnings.warn(f"All pixels in bin{plural} {', '.join([str(x) for x in warn_bins])}" - " are masked. Falling to trace value from all-bin fit.") + " are masked. Falling to trace value from all-bin fit.") # recenter bin positions x_bins = (x_bins[:-1] + x_bins[1:]) / 2