jan-rybizki / Chempy

Start with the Chempy tutorial
https://github.com/jan-rybizki/Chempy/tree/master/tutorials
MIT License
29 stars 15 forks source link

Inconsistency in Chempy wrapper.py #13

Open jan-rybizki opened 5 years ago

jan-rybizki commented 5 years ago

Found by Oliver: In the main Chempy() function (in wrapper.py) when SSPs are created, they are initialized with the ISM metallicity at time-step i (i.e. cube.cube['Z'][i]) but the element fractions of one time-step before i.e. element_fractions = cube.cube[elements][max(i-1,0)]/cube.cube['gas'][max(i-1,0)]

Should try to change the time of the element fractions and see if chempy still runs stable. Why have I never written test code, btw?

jan-rybizki commented 5 years ago

This actually has a non-negligible effect. Changing it just for a simple run computing with prior SSP/ISM parameters at 10Gyr, and there's a difference of 0.009 dex in [Fe/H] and 0.007 dex in [He/Fe] with ~0.001-0.002 in the metal ratios.