Adapted residual speckle noise estimation function for compatibility with the case of forced r and PA
@@ -208,7 +208,7 @@ def speckle_noise_uncertainty(cube, p_true, angle_range, derot_angles, algo,
if len(mu_sigma) != 2:
raise TypeError("If a tuple, mu_sigma must have 2 elements")
elif mu_sigma is not None:
- ncomp = algo_options.get('ncomp', None)
+ ncomp = algo_options.get('ncomp', 1)
annulus_width = algo_options.get('annulus_width', int(fwhm))
if weights is not None:
if not len(weights) == cube.shape[0]:
@@ -293,12 +293,16 @@ def speckle_noise_uncertainty(cube, p_true, angle_range, derot_angles, algo,
if bins is None:
bins = int(offset.shape[0]/10)
- if cube.ndim == 3:
- labels=['r', 'theta', 'f']
+ if force_rPA:
+ labels = []
else:
labels = ['r', 'theta']
+
+ if cube.ndim == 3:
+ labels.append('f')
+ else:
for ch in range(nch):
- labels.append('f{}'.append(ch))
+ labels.append('f{}'.format(ch))
mean_dev, sp_unc = confidence(offset, cfd=68.27, bins=bins,
gaussian_fit=True, verbose=True, save=False,
@@ -327,7 +331,7 @@ def _estimate_speckle_one_angle(angle, cube_pf, psfn, angs, r_true, f_true,
imlib=imlib, interpolation=interpolation,
verbose=False)
- ncomp = algo_options.get('ncomp', None)
+ ncomp = algo_options.get('ncomp', 1)
annulus_width = algo_options.get('annulus_width', int(fwhm))
if cube_pf.ndim == 4:
