Closed gully closed 3 years ago
Here is how we made the template:
import pandas as pd
from gollum.telluric import TelFitSpectrum
from muler.hpf import HPFSpectrumList, HPFSpectrum
path = '~/libraries/raw/telfit/grid_v1p0/'
telfit_spec = TelFitSpectrum(path=path+'telfit_800_1300nm_temp286_hum050.txt').air_to_vacuum()
filename = 'muler_example_data/HPF/01_A0V_standards/Goldilocks_20210801T083618_v1.0_0036.spectra.fits'
full_spectrum = HPFSpectrumList.read(filename).normalize().stitch()
telfit_spec = telfit_spec.instrumental_broaden(resolving_power=55_000).resample(full_spectrum)
df = pd.DataFrame({'wavelength_A':telfit_spec.wavelength.value,
'transmission':telfit_spec.flux.value})
df.to_csv('telfit_HPFtemplate_temp286_hum050.csv', index=False)
The target and TelFit templates are not exactly wavelength aligned. I'm not sure why, but can think of several plausible explanations. Regardless, we should build in some resilience to such imperfections by using a binary erosion parameter, such as the one implemented in scipy.
We are going to package a TelFit template for quicklook purposes, such as masking.