Instrument Configurations

The InstConfig class represents the instrumental characteristics of the spectral observations. Here is an overview of the class, as well as some of its important attributes and methods:

Overview

class chemicalc.instruments.InstConfig(name: str, res: float, samp: float, start: float, end: float, truncate: bool = False)

Object containing Instrument configuration.

Parameters
  • name (str) – Name of the instrument configuration

  • res (float) – Resolving power (\(\lambda/d\lambda\))

  • samp (float) – Pixels per Resolution element

  • start (float) – Beginning wavelength in Angstroms

  • end – Ending wavelength in Angstroms

  • truncate – If true, discards any pixels with wavelengths > ending wavelength

Variables
  • _custom_wave (bool) – True if Instrument’s wavelength has been manually set

  • wave (np.ndarray) – Instrument’s wavelength grid

  • snr (Optional[Union[float,np.ndarray]]) – Signal/Noise of observation (per pixel). Initially None.

Attributes

Wavelength

InstConfig.wave description coming soon!

Signal/Noise

InstConfig.snr description coming soon!

Custom Wavelength Flag

InstConfig._custom_wave description coming soon!

Methods

Set Custom Wavelength

InstConfig.set_custom_wave(wave: numpy.ndarray, update_config: bool = True) → None

Sets instrument wavelength array to input array

Parameters
  • wave (np.ndarray) – Array of wavelengths

  • update_config (bool) – Update instrument’s start_wavelength and end_wavelength attributes to match new wavelength grid.

Returns

Reset Wavelength

InstConfig.reset_wave(truncate: bool = False) → None

Reset wavelength based on instrument configuration (beginning and ending wavelengths, resolving power, and sampling of the resolution element).

Parameters

truncate (bool) – truncate any pixels with lambda > ending wavelength.

Returns

Set Signal/Noise of Observation

InstConfig.set_snr(snr_input: Union[int, float, numpy.ndarray, chemicalc.s2n.Sig2NoiseQuery], fill_value=None) → None

Sets S/N for instrument configuration.

  • If snr_input is an int or float, a constant S/N is set for all pixels.

  • If snr_input is a 2D array, the first row is the wavelength grid and the second row is the S/N per pixel. The S/N is then interpolated onto the instrument’s wavelength grid.

  • If snr_input is a 1D array, the wavelength grid is assumed to be linearly spaced from the instruments starting and ending wavelength. The S/N is then interpolated onto the instrument’s wavelength grid.

  • If snr_input is a Sig2NoiseQuery, the relevant ETC is queried and the S/N is interpolated onto the instrument’s wavelength grid.

Parameters
  • snr_input – Signal-to-Noise Ratio.

  • fill_value – Argument passed on to scipy.interpolate.interp1d to handle S/N for wavelength regions that extend beyond the coverage of snr_input. Common choices are “extrapolate” (to linearly extrapolate) or 0 (to set S/N to zero). If None, an error will be raised if snr_input does not span the full wavelength range of the instrument.

Returns

Pre-Configured Instrument Setups

To instantiate an InstConfig object from a pre-configured instrument setup:

from chemicalc.instruments import AllInst

spec_config = AllInst.get_spectrograph("NAME OF CONFIGURATION")

A table summarizing the complete list of the pre-configured spectroscopic setups will be added shortly. For now, you can see what is included by running the following code:

from chemicalc.instruments import AllInst

AllInst.list_spectrographs()  # Prints summary of all pre-configured instrument setups
Alternatively, you can look at the file:
PATH_TO_INSTALLATION/Chem-I-Calc/chemicalc/data/instruments.json
which has the configurations organized by telescope and spectrograph.