diff --git a/tests/pre_3_10/test_preproc_recentering.py b/tests/pre_3_10/test_preproc_recentering.py index d90fdf35..532cbbff 100644 --- a/tests/pre_3_10/test_preproc_recentering.py +++ b/tests/pre_3_10/test_preproc_recentering.py @@ -421,14 +421,14 @@ def test_dft(debug=False): randay[0] = 0 # ===== odd, subi_size=None - size = 21 + size = 25 mean = size // 2 cube = create_cube_with_gauss2d(shape=(n_frames, size, size), mean=mean, - stddev=3.) + stddev=4.) method_args = dict( center_fr1=(mean, mean), - subi_size=15, + subi_size=19, negative=False, **method_args_additional ) @@ -444,13 +444,13 @@ def test_dft(debug=False): ) # ===== even, subi_size - size = 20 + size = 26 mean = size // 2 # - 0.5 # 0-indexed cube = create_cube_with_gauss2d(shape=(n_frames, size, size), mean=mean, - stddev=3.) + stddev=4.) method_args = dict( - center_fr1=(mean, mean), subi_size=16, negative=False, + center_fr1=(mean, mean), subi_size=20, negative=False, **method_args_additional ) do_recenter( @@ -465,7 +465,7 @@ def test_dft(debug=False): ) # ===== odd negative (ring), subi_size - size = 21 + size = 25 mean = size // 2 cube = create_cube_with_gauss2d_ring( shape=(n_frames, size, size), mean=mean, stddev_outer=3, stddev_inner=2 @@ -486,7 +486,7 @@ def test_dft(debug=False): ) # ===== even negative (ring), subi_size=None - size = 20 + size = 26 mean = size // 2 # - 0.5 cube = create_cube_with_gauss2d_ring( shape=(n_frames, size, size), mean=mean, stddev_outer=3, stddev_inner=2 @@ -708,17 +708,14 @@ def test_radon(debug=False): cropsize=131, satspots_cfg='custom', theta_0=52, - mask_center=40, + mask_center=30, verbose=True, imlib="opencv", hpf=True, filter_fwhm=2 * np.mean(fwhm), ) # # first recenter with Radon to make sure it is well recentered - try: - cube = cube_recenter_radon(cube, **method_args) - except: - pass + cube = cube_recenter_radon(cube, **method_args) # ===== shift shift_magnitude = 2 diff --git a/vip_hci/preproc/badframes.py b/vip_hci/preproc/badframes.py index 78971dc5..d3a6a011 100644 --- a/vip_hci/preproc/badframes.py +++ b/vip_hci/preproc/badframes.py @@ -1,5 +1,4 @@ #! /usr/bin/env python - """ Module with functions for outlier frame detection. """ @@ -86,8 +85,8 @@ def cube_detect_badfr_pxstats(array, mode='annulus', in_radius=10, width=10, if window is None: window = n//3 mean_smooth = pn.Series(mean_values).rolling(window, center=True).mean() - mean_smooth = mean_smooth.fillna(method='backfill') - mean_smooth = mean_smooth.fillna(method='ffill') + mean_smooth = mean_smooth.bfill() # fillna(method='backfill') + mean_smooth = mean_smooth.ffill() # fillna(method='ffill') sigma = np.std(mean_values) bad_index_list = [] good_index_list = [] diff --git a/vip_hci/preproc/recentering.py b/vip_hci/preproc/recentering.py index 7af5286a..d761f616 100644 --- a/vip_hci/preproc/recentering.py +++ b/vip_hci/preproc/recentering.py @@ -866,16 +866,16 @@ def _center_radon(array, cropsize=None, hsize=1., step=0.1, threshold=False, sigfactor=1, debug=debug, full_output=True) # optimal shift -> optimal position - opt_yind = float(fit_res['centroid_y']) - opt_xind = float(fit_res['centroid_x']) + opt_yind = float(fit_res['centroid_y'].iloc[0]) + opt_xind = float(fit_res['centroid_x'].iloc[0]) opt_yshift = -hsize + opt_yind*step opt_xshift = -hsize + opt_xind*step optimy = ori_cent_y - opt_yshift optimx = ori_cent_x - opt_xshift # find uncertainty on centering - unc_y = float(fit_res['fwhm_y'])*step - unc_x = float(fit_res['fwhm_x'])*step + unc_y = float(fit_res['fwhm_y'].iloc[0])*step + unc_x = float(fit_res['fwhm_x'].iloc[0])*step dyx = (unc_y, unc_x) # np.sqrt(unc_y**2 + unc_x**2) # Replace the position found by Gaussian fit