Bug fix for bad pixel correction by interpolation in 2D input frame
@@ -1170,11 +1170,13 @@ def cube_fix_badpix_interp(array, bpm_mask, mode='fft', fwhm=4., kernel_sz=None,
# first replace all bad pixels with NaNs - they will be interpolated
array_corr[np.where(bpm_mask)] = np.nan
if ndims == 2:
- array_corr = frame_filter_lowpass(array_corr, mode=mode,
- fwhm_size=fwhm, conv_mode='conv',
+ array_corr_filt = frame_filter_lowpass(array_corr, mode=mode,
+ fwhm_size=fwhm,
+ conv_mode='conv',
kernel_sz=kernel_sz, psf=psf,
iterate=True,
- half_res_y=half_res_y, **kwargs)
+ half_res_y=half_res_y,
+ **kwargs)
else:
array_corr_filt = array_corr.copy()
if np.isscalar(fwhm):
@@ -1188,7 +1190,8 @@ def cube_fix_badpix_interp(array, bpm_mask, mode='fft', fwhm=4., kernel_sz=None,
elif psf.shape[0] != nz:
raise ValueError("input psf must have same z dimension as array")
for z in range(nz):
- array_corr_filt[z] = frame_filter_lowpass(array_corr[z], mode=mode,
+ array_corr_filt[z] = frame_filter_lowpass(array_corr[z],
+ mode=mode,
fwhm_size=fwhm[z],
conv_mode='conv',
kernel_sz=kernel_sz,
