compute_spectrum

mpdaf.sdetect.compute_spectrum(cube, weights)[source]

Compute a spectrum for a cube by summing along the spatial axis.

The method conserves the flux by using the algorithm from Jarle Brinchmann (jarle@strw.leidenuniv.nl): It takes into account bad pixels in the addition, and normalize for flux conservation.

Parameters
cubeCube

Input data cube.

weightsarray_like

An array of weights associated with the data values.