Atmospheric Transmission

For ground-based observations it is important to understand the how the atmospheric absorption affects the Radial Velocity precision. Eniric does this in two scenarios; masking out all wavelength regions affected by telluric lines over adjusting for barycentric motion, or assuming perfect atmospheric correction, in which the variance of the photon noise is adjusted.

For this eniric contains a average telluric transmission model. It is an average model was created from weekly transmission spectra in 2014 simulated with the TAPAS software (Bertaux et al 2014) as detailed in (Figueira et al. 2016). The main parameters are

  • La Silla Observatory
  • airmass = 1.2 (z = 33.5 degrees)
  • R = 100,000
  • sampling = 10

This average model that is used is available at data/atmmodel/Average_TAPAS_2014.txt. It has 4 columns, wavelength (in nano-meters), transmission (between 0-1), std, mask (0 or 1). The mask is 0 for telluric lines deeper than 2%, 1 elsewhere. The std is the standard deviation of the transmission across the year but is not used in deriving precision.

You may supply your own transmission atmospheric models if you wish., e.g. my_telluric_model.txt To make individual precision calculations faster this model can be split into the separate spectroscopic bands using the scrip scripts/split_atmmodels.py, making smaller files to load later, but taking up more disk space.

e.g. Use split_atmmodels.py -h to get the description of flags to use.

split_atmmodels.py My_telluric_model.txt -b H K

Will create the subsets of my_telluric_model_H.txt and my_telluric_model_K.txt from my_teluric_model.txt. If the the band subset cannot be found the my_telluric_model.txt will be used as a fallback.

You can configure the location of and atmmodel to use in config.yaml.

Telluric Masking

In real observations telluric lines contaminate the spectra and need to be removed. Typically this is done by excluding waveelengths that are near deep (e.g. >2%) telluric lines. Figueria et al. (2016) condsidered three different conditions which can be

The atmospheric absorption can be used to mask

The three default cases treated in Figueira et al. (2016) were no telluric corection, masking, assumption of perfect telluric correction.

The masks \(M\) for these three cases are as follows, given the atmospheretic transmission \(T\) for each wavelenght or pixel, \(i\).

  • Condition 1
    No telluric treatment, theoretical precision of the spectrum.
\[M(i) = 1\]
  • Condition 2
    Masking out telluric lines deeper than \(\tau\) (e.g. \(\tau=0.98\) for 2%).
\[\begin{split}M(i) &= \begin{cases} 0, \hspace{1em} T(i) < \tau\\ 1, \hspace{1em} T(i) \ge \tau\\ \end{cases}\label{eqn:mask2}\\\end{split}\]
  • Condition 3
    The assumption of perfect telluric correction. The telluric lines have been completely removed however the flux variance at the locations of the lines increases due to the lower flux received. This can be implemented with the following mask
\[M(i) = {T(i)}^2\]

For examples using these masks see Masking or the usage in phoenix_precision.py.

The mask for Condition 2 can be created using Atmosphere class

Atmosphere.mask_transmission(depth: float = 2.0) → None[source]

Mask the transmission below given depth. e.g. 2%.

Updates the mask.

Parameters:depth (float) – Telluric line depth percentage to mask out. Default is 2.0. E.g. depth=2 will mask transmission deeper than 2%.

Barycentric Motion

To exclude wavelength regions that will be affected by telluric lines at some point during the year you can extend out the telluric mask.

new_mask = barycentric_broaden(wav, transmission, mask)

This extends the regions that are masked out, you can check that the mask continues to mask out deep lines like so…

assert np.all(transmission[mask] > 0.98)     # Check old mask works
assert np.all(transmission[new_mask] > 0.98) # Check new mask
# More points should be zero in extended mask
assert np.sum(new_mask) < np.sum(mask)

The fraction (np.sum(new_mask) - np.sum(mask)) /np.sum(mask) can also indicate the increase in masked out wavelengths.

Telluric Preparation

The default telluric transmission spectrum provided with eniric is given in data\Atmodel\Average_TAPAS_2014.dat. This is quite unweildly, opening and slicing of the large telluric spectrum reduces performance.

To prepare this for computations it is better to split the spectra into the individual wavelength bands and apply the barycentric shifts.

split_atmmodel.py
barycenter_broaden_atmmodel.py

These two scripts will split the large telluirc spectra into the bands specified in the config.yaml. They default to a mask of 2% depth. To change the masking cutoff depth use the --cutoff-depth flag.

split_atmmodel.py --cutoff-depth 4

The Atmosphere class will try to load the individaul band spectra but will fall back to the base file.

Module

class eniric.atmosphere.Atmosphere(wavelength, transmission, mask=None, std=None, shifted=False, verbose=False)[source]

Atmospheric transmission object.

Stores wavelength and atmospheric transmission arrays. Enables telluric masking and accounting for barycentric motion.

wl

Wavelength array.

Type:ndarray
transmission

Atmospheric transmission (between 0 and 1).

Type:ndarray
std

Standard deviation of transmission.

Type:ndarray
mask

Transmission mask (1’s are kept).

Type:ndarray
shifted

Indicate shifted mask. Default is False.

Type:bool
verbose

Enable verbose. Default is False.

Type:bool
Constructors
------------
from_file(atmmodel)[source]

Read in atmospheric model and prepare.

from_band(band, bary=False)[source]

Read in atmospheric model for given band.

to_file(fname, header, fmt)[source]

Save the atmospheric model to a txt file.

at(wave)[source]

Return the transmission value at the closest points to wave.

wave_select(wl_min, wl_max)[source]

Slice Atmosphere between two wavelengths.

band_select(band)[source]

Slice Atmosphere to a given band.

copy()[source]

Make a copy of atmosphere object.

mask_transmission(depth)[source]

Mask the transmission below given depth. e.g. 2%

barycenter_broaden(rv, consecutive_test)[source]

Sweep telluric mask symmetrically by +/- a velocity.

broaden(resolution, *kwargs)[source]

Instrument broadening of the atmospheric transmission profile.

Configuration()
-------------
Two things can be set for the Atmosphere class in the `config.yaml` file.
The path to the atmosphere data
e.g.
paths:
atmmodel: “path/to/atmmodel/directory”
The name for the atmosphere model *.dat file
atmmodel:
base: “Average_TAPAS_2014”
at(wave)[source]

Return the transmission value at the closest points to wave.

This assumes that the atmosphere model is sampled at a higher rate than the stellar spectra.

For instance, the default Tapas model has a sampling if 10 compared to 3.

Parameters:wave (ndarray) – Wavelengths at which to return closest atmosphere values.
band_select(band)[source]

Slice Atmosphere to a given Band.

barycenter_broaden(rv: float = 30.0, consecutive_test: bool = False)[source]

Sweep telluric mask symmetrically by +/- a velocity.

Updates the objects mask.

Parameters:
  • rv (float) – Velocity to extend masks in km/s. Default is 30 km/s.
  • consecutive_test (bool) – Checks for 3 consecutive zeros to mask out transmission. Default is False.
broaden(resolution: float, fwhm_lim: float = 5, num_procs=None)[source]

Instrument broadening of the atmospheric transmission profile.

This does not change any created masks.

Parameters:
  • resolution (float) – Instrumental resolution R.
  • fwhm_lim (int/float) – Number of FWHM to extend the wings of the convolution kernel.
  • num_procs (Optional[int]) – Number of processors to use. Default = total processors - 1
copy()[source]

Make a copy of atmosphere object.

classmethod from_band(band: str, bary: bool = False)[source]

Read in atmospheric model for given band.

Alternate constructor for Atmosphere. Base on “base” path in config.yaml.

Parameters:
  • band (str) – Name of atmosphere file.
  • bary (bool) – Barycentric shift the mask.
classmethod from_file(atmmodel: str)[source]

Read in atmospheric model and prepare.

Alternate constructor for Atmosphere.

Parameters:atmmodel (str) – Name of atmosphere file.
mask_transmission(depth: float = 2.0) → None[source]

Mask the transmission below given depth. e.g. 2%.

Updates the mask.

Parameters:depth (float) – Telluric line depth percentage to mask out. Default is 2.0. E.g. depth=2 will mask transmission deeper than 2%.
to_file(fname: str, header: Optional[List[str]] = None, fmt: str = '%11.8f')[source]

Save the atmospheric model to a txt file.

Converts micron back into nanometers to be consistent with from_file().

Parameters:
  • fname (str) – Name of atmosphere file to save to.
  • header – Header lines to add.
  • fmt (str) – String formatting
wave_select(wl_min, wl_max)[source]

Slice Atmosphere between two wavelengths.

eniric.atmosphere.consecutive_truths(condition: numpy.ndarray) → numpy.ndarray[source]

Length of consecutive true values in an bool array.

Parameters:condition (ndarray of bool) – True False array of a condition.
Returns:len_consecutive – Array of lengths of consecutive true values of the condition.
Return type:ndarray of ints

Notes

Solution found at http://stackoverflow.com/questions/24342047