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.
- Condition 2
- Masking out telluric lines deeper than \(\tau\) (e.g. \(\tau=0.98\) for 2%).
- 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
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
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
-
Constructors
¶
-
------------
-
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:
-
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:
-
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:
-
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:
-
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