Added tests for more PCA options
@@ -74,9 +74,14 @@ def algo_pca(ds):
return vip.psfsub.pca(ds.cube, ds.angles)
+def algo_pca_drot(ds):
+ return vip.psfsub.pca(ds.cube, ds.angles, ncomp=2, delta_rot=0.5,
+ source_xy=ds.injections_yx[0][::-1])
+
+def algo_pca_cevr(ds):
+ return vip.psfsub.pca(ds.cube, ds.angles, ncomp=0.95)
+
def algo_pca_grid(ds):
- """ PCA grid, obtaining the optimal residual for given location
- """
return vip.psfsub.pca(ds.cube, ds.angles, ncomp=(1, 2),
source_xy=ds.injections_yx[0][::-1])
@@ -86,7 +91,12 @@ def algo_pca_incremental(ds):
def algo_pca_annular(ds):
- return vip.psfsub.pca_annular(ds.cube, ds.angles, fwhm=ds.fwhm)
+ return vip.psfsub.pca_annular(ds.cube, ds.angles, fwhm=ds.fwhm,
+ n_segments='auto')
+
+def algo_pca_annular_auto(ds):
+ return vip.psfsub.pca_annular(ds.cube, ds.angles, fwhm=ds.fwhm,
+ ncomp='auto')
# ====== SNR map
@@ -145,9 +155,12 @@ def check_detection(frame, yx_exp, fwhm, snr_thresh, deltapix=3):
(algo_frdiff, snrmap_fast),
(algo_frdiff4, snrmap_fast),
(algo_pca, snrmap_fast),
+ (algo_pca_drot, snrmap_fast),
+ (algo_pca_cevr, snrmap_fast),
(algo_pca_grid, snrmap_fast),
(algo_pca_incremental, snrmap_fast),
(algo_pca_annular, snrmap_fast),
+ (algo_pca_annular_auto, snrmap_fast),
],
ids=lambda x: (x.__name__.replace("algo_", "") if callable(x) else x))
def test_algos(injected_cube_position, algo, make_detmap):
