Compute_GreedyPCA

muse_origin.Compute_GreedyPCA(cube_in, test, thresO2, Noise_population, itermax)[source]

Function to compute greedy svd. thanks to the test (test_fun) and according to a defined threshold (threshold_test) the cube is segmented in nuisance and background part. A part of the background part (1/Noise_population %) is used to compute a mean background, a signature. The Nuisance part is orthogonalized to this signature in order to not loose this part during the greedy process. SVD is performed on nuisance in order to modelized the nuisance part and the principal eigen vector, only one, is used to perform the projection of the whole set of data: Nuisance and background. The Nuisance spectra which satisfied the test are updated in the background computation and the background is so cleaned from sources signature. The iteration stop when all the spectra satisfy the criteria

Parameters
Cube_inarray

The 3D cube data clean

test_fun: function

the test to be performed on data

Noise_populationfloat

Fraction of spectra estimated as background

itermaxint

Maximum number of iterations

Returns
faintarray

cleaned cube

mapO2array

2D MAP filled with the number of iteration per spectra

thresO2float

Threshold for the O2 test

nstopint

Nb of times the iterations have been stopped when > itermax