cwitools.utils.get_skymask

cwitools.utils.get_skymask(hdr, use_vacuum=None, linewidth=None, mode='bmask')

Get mask of sky lines for specific instrument/resolution.

This is based on a list of known sky-lines built into CWITools, which is currently a work in progress. It is not an exhaustive list by any means.

Parameters:
  • inst (str) – ‘KCWI’ or ‘PCWI’ - to determine whether Keck or Palomar sky is requested.
  • use_vacuum (bool) – Set to True to convert the sky lines to vacuum wavelengths. Default is True if ‘CTYPE3’ is WAVE, False if ‘AWAV’ or otherwise.
  • linewidth (float) – The width (in Angstrom) of the mask for each line. If none provided, it will be based on the spectral resolution of the setting used, which is determined from the header.
  • mode (str) –

    The mode of the return type - ‘binmask’ or ‘tuples’ ‘bmask’ - return a 1D array where 1 = masked and 0 = unmasked ‘tuples’ - return a list of tuples indicating the (lower, upper)

    wavelength for each line, based on the linewidth.
Returns:

A 1D binary mask. Values of 1 indicate masked wavelengths. OR list of float tuples: (lower, upper) bounds for each emission line.

Return type:

numpy.array