MCAL - A method to calculate high precision [Fe/H] and Teff for M dwarfs


The relevant files used to calculate the [Fe/H] and Teff using the M dwarf method are available for download here:

An earlier version of this technique is presented briefly in the Appendix of Neves et al. 2013.

All programs are written on Python 2.6.  

For any doubt and bug reports please send an email to

This file contains:

  1. - script to run all the other programs. In the startup section one can choose to use FFT to filter high frequency noise, the file type of the input spectra (FITS or text file), and the name of the file with the full path of the spectra. The script also calculates the H? index described by Gomes da Silva et al. (2011) and warns if the star is too active.

NOTE: Use the FFT filter at your own risk! The filter should be fine tuned manually, and one should not choose a frequency cut too far from the Nyquist frequency. Moreover, it does not work well for low SNR. Check the function for details.

NOTE 2 : The input spectra should always have a step of 0.01 A. If the step is different you need to interpolate the spectra before using this method.

NOTE 3: The spectral range of the technique is 5339-6907 A. 

NOTE 4: The minimum recommended resolution of the spectra to use this method is R = 40.000, with a SNR of at least 25. The details regarding this constraints are given in Neves et al. (2014).

  1. - The function that performs the FFT filtering of the spectra.

  2. - function to calculate the pseudo EWs of the relevant lines. It uses lines.rdb as input. An output file, ew_out.npz, is also created. It takes 4-5 minutes per star to calculate the EWs on a 2010 i5 2.4 Ghz computer.

  3. mcalv3.npz - function that calculates the [Fe/H] and Teff of each star using the calibration matrix file coef_calv3.npz. The output will be displayed on the screen and can also be optionally saved to a file (check for details). 

  4. stars.txt - Text file with the full path of the spectra. This file should have all the spectra files for analysis.

  5. Gl105B_S1D.fits and Gl849_S1D.fits are two HARPS spectra that can be used to demonstrate how the program works. Their full file names appear in the file stars.txt. One should remove them from stars.txt before calibrating new stars.