Simulations with pyFIT3D

Presentation

We have created two simple simulations using pyFIT3D module. Both examples are coded using the classic notebook interface Jupyter Notebook, which is very easy to edit, modify and run.

Emission Lines simulations

This simulation creates a \({\rm [NII]+H}\alpha\) model spectrum, adds noise and fit it with the function fit_elines_main(). At the end, all simulation output (properties and spectra) is stored in FITS files.

Stellar population analysis simulation

NOTE: This example requires Pandas (pip install pandas).

This example uses a SSP library (see Format of the SSP library template FITS file) and a file with the coefficients (weights) of each SSP model inside the library, in order to to create a known age-metallicity representative spectrum. Kinematics and dust extinction effects applyied. After this, the spectrum is analyzed using the function auto_ssp_spec().

Needed files

In addition to the files needed to the stellar population analysis (see Stellar population synthesis configuration file), this example need some auxiliary files.

  1. Input real parameters file (used in this example: real_parameters.csv)

  2. Foreach line in real pars file, a file with the coeffs for the spectrum creation is needed.

  3. SSP libraries (used in this example: gsd01_12.fits and gsd01_156.fits)

Files formats

Input real parameters file: Each line of the file represents one input spectrum for the simulation. The line should be composed of the non-linear parameters (redshift, velocity dispersion and A_V, the dust extinction parameter). Example of parameters file:

redshift,Av,LOSVD
0.03186,0.23318,314.72231
0.02176,0.42848,193.17778

Coefficients filenames for the parameters file above:

coeffs_input.losvd314p7223-av0p2332-redshift0p0319.txt
coeffs_input.losvd193p1778-av0p4285-redshift0p0218.txt

I.e., the value of the parameters formatted with 4 decimals and the ‘.’ replaced to ‘p’.

Each coefficient file should carry the ID, AGE, MET and the COEFF:

#ID MET AGE COEFF
0.000 3.7047000e-03 1.0000021e-03 5.7196858e-03
1.000 7.5640000e-03 1.0000021e-03 1.0281415e-02
2.000 1.8999999e-02 1.0000021e-03 5.3646386e-03
(...)

For this particular example we use the SSP library gsd01_156.fits to generate the spectrum and the same library to fit it. The compact version of this library (gsd01_12.fits) is used to the non-linear fit. We also leave a 2000 examples of coefficients files and a real_parameters.csv file containing all of them.