Optimized NEGFC for nmf-annular (in addition to existing optimization for pca-annular)
@@ -13,7 +13,7 @@ from skimage.draw import disk
from ..fm import cube_inject_companions
from ..var import (frame_center, get_annular_wedge, cube_filter_highpass,
get_annulus_segments)
-from ..psfsub import pca_annulus, pca_annular, pca
+from ..psfsub import pca_annulus, pca_annular, nmf_annular, pca
from ..preproc import cube_crop_frames
@@ -316,7 +316,7 @@ def get_values_optimize(cube, angs, ncomp, annulus_width, aperture_radius,
collapse_ifs=collapse_ifs, weights=weights,
nproc=nproc)
- elif algo == pca_annular:
+ elif algo == pca_annular or algo == nmf_annular:
tol = algo_options.get('tol', 1e-1)
min_frames_lib = algo_options.get('min_frames_lib', 2)
@@ -333,7 +333,8 @@ def get_values_optimize(cube, angs, ncomp, annulus_width, aperture_radius,
else:
crop_cube = cube
pad = 0
- res_tmp = pca_annular(crop_cube, angs, radius_int=radius_int, fwhm=fwhm,
+ if algo == pca_annular:
+ res_tmp = algo(crop_cube, angs, radius_int=radius_int, fwhm=fwhm,
asize=annulus_width, delta_rot=delta_rot,
ncomp=ncomp, svd_mode=svd_mode, scaling=scaling,
imlib=imlib, interpolation=interpolation,
@@ -342,6 +343,15 @@ def get_values_optimize(cube, angs, ncomp, annulus_width, aperture_radius,
min_frames_lib=min_frames_lib,
max_frames_lib=max_frames_lib, full_output=False,
verbose=False)
+ else:
+ res_tmp = algo(crop_cube, angs, radius_int=radius_int, fwhm=fwhm,
+ asize=annulus_width, delta_rot=delta_rot,
+ ncomp=ncomp, scaling=scaling, imlib=imlib,
+ interpolation=interpolation, collapse=collapse,
+ weights=weights, nproc=nproc,
+ min_frames_lib=min_frames_lib,
+ max_frames_lib=max_frames_lib, full_output=False,
+ verbose=False)
# pad again now
res = np.pad(res_tmp, pad, mode='constant', constant_values=0)
@@ -365,7 +375,7 @@ def get_values_optimize(cube, angs, ncomp, annulus_width, aperture_radius,
inner_rad = r_guess-annulus_width/2
yy_a, xx_a = get_annulus_segments((fr_size, fr_size), inner_rad,
annulus_width, nsegm=1)[0]
- ## only consider overlapping indices
+ # only consider overlapping indices
yy_f = []
xx_f = []
for i in range(len(yy)):
