instrument module

class ariastrotools.instrument.Handle_NEID[source]

Bases: object

Class to handle NEID spectrograph FITS data.

This class provides methods for reading NEID FITS files, applying barycentric corrections to the wavelength solution, and performing basic blaze correction on the extracted orders.

name

Instrument identifier, set to “NEID”.

Type:

str

__init__():

Initializes the NEID handler.

getfull_data(fname):

Reads all extensions from a FITS file and returns data and headers.

barycorr(wl_array, header):

Applies barycentric correction to the wavelength array using header keywords SSBZxxx.

process_data(fname):

Reads the FITS file, applies barycentric and blaze corrections, and returns corrected data and headers.

barycorr(wl_array, header)[source]

Apply barycentric correction to the wavelength array.

For each spectral order, the barycentric correction factor is retrieved from the header keywords SSBZxxx (where xxx is the order number, zero-padded to 3 digits). The factor is then applied multiplicatively to the wavelength array.

Parameters:
  • wl_array (ndarray) – 2D array of wavelength values (orders x pixels).

  • header (astropy.io.fits.Header) – FITS header containing the barycentric correction keywords.

Returns:

  • corr_wl_array (ndarray) – Wavelength array corrected for barycentric motion.

  • header (astropy.io.fits.Header) – Updated header with SSBZxxx values reset to zero.

fits_extensions()[source]
getfull_data(fname)[source]

Extract all extensions from a NEID FITS file.

Parameters:

fname (str) – Path to the FITS file.

Returns:

  • datadict (dict) – Dictionary mapping extension keywords to numpy arrays containing the data.

  • headerdict (dict) – Dictionary mapping extension keywords to FITS headers.

name = 'NEID'
process_data(fname, contnorm=False)[source]

Process a NEID FITS file.

This method reads the science data from a NEID FITS file, applies the barycentric correction to the wavelength arrays, and optionally continuum-normalizes the science spectra.

Parameters:
  • fname (str) – Path to the NEID FITS file.

  • contnorm (bool, optional) – If True, continuum-normalize the science flux and variance using continuum_normalize(). Default is False.

Returns:

  • datadict (dict) – Dictionary containing the processed data arrays. The science flux and variance are stored as float64 arrays, and the wavelength arrays are updated with the barycentric correction. If contnorm is True, the science flux and variance are continuum-normalized.

  • headerdict (dict) – Dictionary containing the updated FITS headers. The primary header is modified to include the barycentric correction keywords.

req_qtys()[source]

Dictonary format: {Name of extension: List of keys from that extension}

telluric_correction(datadict)[source]

Apply telluric correction to the science spectrum.

The science flux is divided by the combined telluric transmission, computed as the product of the two telluric components stored in the TELLURIC array. The corresponding variance is scaled by the square of the transmission to preserve uncertainty propagation.

After the correction, the telluric transmission is replaced with a unity array of the same shape to indicate that the telluric correction has already been applied.

Parameters:

datadict (dict) –

Dictionary containing the extracted science data. The following keys are required:

  • 'SCIFLUX' : ndarray Science flux array.

  • 'SCIVAR' : ndarray Variance corresponding to SCIFLUX.

  • 'TELLURIC' : ndarray Telluric transmission array of shape (n_orders, n_pixels, 2), where the final dimension contains two multiplicative telluric components.

Returns:

The input dictionary with the following updates:

  • 'SCIFLUX' replaced by the telluric-corrected flux.

  • 'SCIVAR' replaced by the propagated variance.

  • 'TELLURIC' replaced by a unity transmission array with the same shape as the original telluric array.

Return type:

dict