Library of functions to produce stacks of spectra

This class is dedicated to stack spectra.

class SpectraStacking.SpectraStacking[source]

The class SpectraStacking is dedicated to stacking spectra

class SpectraStacking.SpectraStacking(LF_file, Nspec=400, dLambda=0.0001, dV=-9999.99)[source]

The model luminosity function class :param LF_file: fits file generated with a LF. :param Resolution: Resolution :param Nspec: Initial guess of the parameters :param outputDirectory: where to output the fits :param fileName: file name where things are saved.

convertSpectrum(redshift)[source]

Shifts the spectrum in the rest-frame and creates a spectrum with the sampling desired. :param redshift: redshift of the spectrum

stackSpectra()[source]

Function that constructs the stacks for a luminosity function. It loops over the list of spectra given in the catalog of the LF. First it sorts the catalog by the line luminosity. And then stacks the first Nspec, then the next Nspec together.

stack_function(specMatrix, specMatrixWeight)[source]

Creates the stack. :param specMatrix: matrix of observed spectra :param specMatrixWeight: matrix of the statistical weights used in the LF.