cwitools.synthesis.obj_spec

cwitools.synthesis.obj_spec(fits_in, obj_cube, obj_id, var_cube=None, extend_z=False, rescale_cov=True)

Get 1D spectrum of a 3D object or multiple objects.

Input can be ~astropy.io.fits.HDUList, ~astropy.io.fits.PrimaryHDU or ~astropy.io.fits.ImageHDU. If HDUList given, PrimaryHDU will be used.

Parameters:
  • fits_in (astropy HDU or HDUList) – Input HDU/HDUList with 3D data.
  • obj_cube (NumPy.ndarray) – Data cube containing labelled 3D regions.
  • obj_id (list or int) – ID or list of IDs of objects to include.
  • var_cube (NumPy.ndarray) – Data cube containing 3D variance estimate.
  • extend_z (bool) – Set to TRUE to include full spectrum range from each object spaxel.
  • rescale_cov (bool) – Rescale the variance cube based on the covariance information in the FITS header. This only works when relevant keywords are presented in the input FITS file.
Returns:

Table with columns ‘wav’ (wavelength), ‘flux’,

and - if var_cube was provided - ‘flux_err’.

Return type:

astropy.io.fits.TableHDU