molecfit

tayph.molecfit(dataname, mode='both', instrument='HARPS', save_individual='', configfile=None, plot_spec=False, time_average=False, guide_plot=False)[source] [edit on github]

This is the main wrapper for molecfit that pipes a list of s1d spectra and executes it. It first launces the molecfit gui on the middle spectrum of the sequence, and then loops through the entire list, returning the transmission spectra of the Earths atmosphere in the same order as the list provided. These can then be used to correct the s1d spectra or the e2ds spectra. Note that the s1d spectra are assumed to be in the barycentric frame in vaccuum, but that the output transmission spectrum is in the observers frame, and e2ds files are in air wavelengths by default. ERROR: THE INSTRUMENT PARFILE DECIDES WHETHER THE INPUT S1D SPECTRA ARE IN AIR OR IN VACCUUM. NO STANDARD IS NEEDED.

PROPOSED IMPROVEMENT OF THIS TEXT SEPTEMBER 2023: Note that the s1d spectra onto which Molecfit will fit should be in air (unless set otherwise in the molecfit configuration file and in the tayph configuration file) and in the observatory rest-frame, as should be the e2ds spectra. This may mean that in read_e2ds, a BERV correction has to be undone and this should be hardcoded for the various instruments.

You can also set save_individual to a path to an existing folder to which the transmission spectra of the time-series can be written one by one.

Set the mode keyword to either ‘GUI’, ‘batch’ or ‘both’, to run molecfit in respectively GUI mode (requiring connection to an X-window), batch mode (which can be run in the background without access to a window environment, or both, in which the GUI and the batch are executed in the same call to molecfit.)

Set the time-average keyword to do a fit on the time-average spectrum. This is useful in case the individual spectra are too noisy to see the telluric lines well. Although this will help you to better set the inclusion and exclusion regions, the resulting fit may not be very good because the telluric lines shift due to the BERV, and because the time of the observation changes during the run. Therefore, after selecting inclusion regions, you are advised to re-run this function in GUI mode with time_average switched off, to make sure that you are getting a good fit on individual spectra.