FEAT: add LLSG HCIPostProcAlgo
@@ -10,6 +10,7 @@ __author__ = 'Carlos Alberto Gomez Gonzalez, Ralf Farkas'
__all__ = ['HCIMedianSub',
'HCIPca',
'HCILoci',
+ 'HCILLSG',
'HCIAndromeda']
import pickle
@@ -21,6 +22,7 @@ from .medsub import median_sub
from .metrics import snrmap_fast, snrmap
from .andromeda import andromeda
from .pca import pca
+from .llsg import llsg
from .leastsq import xloci
from .conf.utils_conf import algo_calculates_decorator as calculates
@@ -574,6 +576,53 @@ class HCILoci(HCIPostProcAlgo):
self.cube_res, self.cube_der, self.frame_final = res
+class HCILLSG(HCIPostProcAlgo):
+ """
+ HCI LLSG algorithm.
+ """
+
+ def __init__(self, dataset=None, rank=10, thresh=1, max_iter=10,
+ low_rank_ref=False, low_rank_mode='svd', auto_rank_mode='noise',
+ residuals_tol=1e-1, cevr=0.9, thresh_mode='soft', nproc=1,
+ asize=None, n_segments=4, azimuth_overlap=None, radius_int=None,
+ random_seed=None, imlib='opencv', interpolation='lanczos4',
+ high_pass=None, collapse='median', verbose=True):
+ super(HCILLSG, self).__init__(locals())
+
+ @calculates("frame_final", "frame_l", "frame_s", "frame_g")
+ def run(self, dataset=None, nproc=1, verbose=True):
+ """
+ Run the HCI LLSG algorithm for model PSF subtraction.
+
+ """
+
+ dataset = self._get_dataset(dataset, verbose)
+
+ res = llsg(
+ dataset.cube, dataset.angles, dataset.fwhm,
+ rank=self.rank, thresh=self.thresh, max_iter=self.max_iter,
+ low_rank_ref=self.low_rank_ref, low_rank_mode=self.low_rank_mode,
+ auto_rank_mode=self.auto_rank_mode,
+ residuals_tol=self.residuals_tol, cevr=self.cevr,
+ thresh_mode=self.thresh_mode, nproc=nproc, asize=self.asize,
+ n_segments=self.n_segments, azimuth_overlap=self.azimuth_overlap,
+ radius_int=self.radius_int, random_seed=self.random_seed,
+ imlib=self.imlib, interpolation=self.interpolation,
+ high_pass=self.high_pass, collapse=self.collapse, full_output=True,
+ verbose=verbose, debug=False
+ )
+
+ self.list_l_array_der = res[0]
+ self.list_s_array_der = res[1]
+ self.list_g_array_der = res[2]
+
+ self.frame_l = res[3]
+ self.frame_s = res[4]
+ self.frame_g = res[5]
+
+ self.frame_final = self.frame_s
+
+
class HCIAndromeda(HCIPostProcAlgo):
"""
HCI ANDROMEDA algorithm.
