diff --git a/CHANGES.rst b/CHANGES.rst index 7794cb28..001bb430 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,11 @@ Changes to API Bug Fixes --------- +jump +~~~~ + +- Catch some additional warnings about all-NaN slices. [#258] + ramp_fitting ~~~~~~~~~~~~ diff --git a/setup.py b/setup.py index 592058e6..d5e47f0f 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,8 @@ # Setup C module macros define_macros = [("NUMPY", "1")] +# importing these extension modules is tested in `.github/workflows/build.yml`; +# when adding new modules here, make sure to add them to the `test_command` entry there extensions = [ Extension( "stcal.ramp_fitting.ols_cas22._ramp", diff --git a/src/stcal/jump/jump.py b/src/stcal/jump/jump.py index 47248831..f6e0e258 100644 --- a/src/stcal/jump/jump.py +++ b/src/stcal/jump/jump.py @@ -973,13 +973,13 @@ def find_faint_extended( all_ellipses = [] first_diffs_masked = np.ma.masked_array(first_diffs, mask=np.isnan(first_diffs)) + warnings.filterwarnings("ignore") if nints > minimum_sigclip_groups: mean, median, stddev = stats.sigma_clipped_stats(first_diffs_masked, sigma=5, axis=0) else: median_diffs = np.nanmedian(first_diffs_masked, axis=(0, 1)) sigma = np.sqrt(np.abs(median_diffs) + read_noise_2 / nframes) - warnings.filterwarnings("ignore") for intg in range(nints): # calculate sigma for each pixel if nints < minimum_sigclip_groups: diff --git a/src/stcal/jump/twopoint_difference.py b/src/stcal/jump/twopoint_difference.py index 5d3e4705..5be6b595 100644 --- a/src/stcal/jump/twopoint_difference.py +++ b/src/stcal/jump/twopoint_difference.py @@ -240,7 +240,9 @@ def find_crs( first_diffs = np.diff(dat, axis=1) if total_usable_diffs >= min_diffs_single_pass: + warnings.filterwarnings("ignore", ".*All-NaN slice encountered.*", RuntimeWarning) median_diffs = np.nanmedian(first_diffs, axis=(0, 1)) + warnings.resetwarnings() # calculate sigma for each pixel sigma = np.sqrt(np.abs(median_diffs) + read_noise_2 / nframes) # reset sigma so pixels with 0 read noise are not flagged as jumps