pca_solve

pydl.pydlspec2d.spec1d.pca_solve(newflux, newivar, maxiter=0, niter=10, nkeep=3, nreturn=None, verbose=False)[source]

Replacement for idlspec2d pca_solve.pro.

Parameters:
newfluxarray-like

The input spectral flux, assumed to have a common wavelength and redshift system.

newivararray-like

The inverse variance of the spectral flux.

maxiterint, optional

Stop PCA+reject iterations after this number.

niterint, optional

Stop PCA iterations after this number.

nkeepint, optional

Number of PCA components to keep.

nreturnint, optional

Number of PCA components to return, usually the same as nkeep.

verbosebool, optional

If True, print extra information.

Returns:
dict

The PCA solution.