specex.stack module

SPECEX - SPECtra EXtractor.

This module provides functions to stack spectral cubes.

Copyright (C) 2022-2023 Maurizio D’Addona <mauritiusdadd@gmail.com>

specex.stack.cube_stack(options=None)[source]

Run the main program of this module.

Returns

None.

specex.stack.stack_and_plot(ext, basename, suffix='', is_mask=False, override_wcs=None, dpi=150, wave_ranges=None)[source]

Stack and plot a spectral datacube.

Stack a datacube along the spectral axis and plot the result as a PNG and a FITS file.

Parameters

extastropy.io.fits.ImageHDU

The fits exension containing the datacube.

basenamestr

The name of the output images.

suffixstr, optional

An optional suffix for the output image names. The default is “”.

is_maskbool, optional

If True, the stacked image is trated as a boolean mask where every pixel having non-zero value will be considered as True. The default is False.

override_wcsastropy.wcs.WCS, optional

An optional WCS to override the one present in the datacube. The default is None.

dpiint, optional

The resolution of the output PNG file. The default is 150.

wave_rangeTYPE, optional

The optional wavelength range to use, if None all the available wavelenghts are used. The default is None.

Returns

new_datanumpy.ndarray

The stacked image.

img_wcsastropy.wcs.WCS

The WCS of the stacked image.