dfm / python-fsps

Python bindings to Charlie Conroy's Flexible Stellar Population Synthesis (FSPS) Fortran code
https://python-fsps.readthedocs.io
MIT License
67 stars 38 forks source link

Relation between logzsol of fsps.StellarPopulation() and log(Z) of isochrone file #156

Open kh-kr opened 3 years ago

kh-kr commented 3 years ago

Hi, How does the input of metallicity ( logzsol ) work. When I give

sps = fsps.StellarPopulation(zcontinuous=1,logzsol=-0.4) iso = sps.isochrones()

In the output, I get

age log(Z) mini mact logl logt logg phase composition log(weight) log(mdot) mags 5.5000 -2.0969 0.150000010 0.150000000 -2.4525 3.5402 NaN 0.0000 0.0000 -0.1873 -99.0000...

In input, I provided logzsol = -0.4, but in the output I get log(Z) = -2.0969. How logzsol and log(Z) are related?

I think it is a very silly question, but I am confused. I would be very grateful if anyone can help me with this.

bd-j commented 3 years ago

isochrones() is a special method that works differently from get_spectrum or get_mags. It gives you the parameters (stellar parameters, IMF weight, and magnitudes) of every single isochrone grid point - all ages and all metallicities. Thus logzsol is ignored, since no metallicity interpolation is performed.

But in general, logzsol = log(Z) - log (Z_sun), where log(Z_sun)=0.019 for Padova isochrones, and 0.014 for MIST isochrones

kh-kr commented 3 years ago

Hi @bd-j,

Sorry for the late reply.

I am using BASTI stellar isochrone library. For different values of logzsol in input, I was getting different values of log(Z). The difference between both the values was not constant. Hence to check the relation between them, I plotted z_sol vs (z_sol - Z). Kindly see the attached values below.

log(z_sol) | z_sol | log(Z) | Z | z_sol-Z -2 | 0.01 | -3.2218 | 0.000600067353864 | 0.009399932646136 -1.5 | 0.031622776601684 | -3 | 0.001 | 0.030622776601684 -1 | 0.1 | -2.699 | 0.001999861869633 | 0.098000138130367 -0.5 | 0.316227766016838 | -2.069 | 0.008531001140176 | 0.307696764876662 0 | 1 | -1.699 | 0.019998618696328 | 0.980001381303672 0.5 | 3.16227766016838 | -1.3979 | 0.040003685104613 | 3.12227397506377

The got a linear relation between z_sol and (z_sol - Z). The equation of the best-fitted line is

(z_sol - Z) = 0.9875697 x z_sol - 0.0024506

which is equal to

=> Z = (1-0.9875697) x z_sol + 0.0024506 => Z = 0.0124303 x z_sol + 0.0024506

Hence, using this equation, I can get a specific value of Z.

Am I correct? Kindly suggest.