Python API ExamplesΒΆ

SNII ():

from PyChem import chemistry
chemistry.init_chimie("../chemistry.simple.dat")
chemistry.SNII_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())
chemistry.get_allelts_labels()

SNIa ():

from PyChem import chemistry
chemistry.init_chimie("../chemistry.simple.dat")
chemistry.SNIa_single_mass_ejection(20*chemistry.SolarMass_to_CodeUnits_Factor())[2:]
chemistry.get_allelts_labels()

play with units:

from PyChem import chemistry
chemistry.init_chimie("../chemistry.simple.dat")
chemistry.GetParameters()['UnitLength_in_cm']
chemistry.GetParameters()['UnitVelocity_in_cm_per_s']
chemistry.GetParameters()['UnitMass_in_g']


from PyChem import chemistry
params={}
params['UnitMass_in_g']= 1.989e+33 # in msol
chemistry.init_chimie("../chemistry.simple.dat",params=params)
chemistry.GetParameters()['UnitMass_in_g']
chemistry.GetParameters()['UnitVelocity_in_cm_per_s']
chemistry.GetParameters()['UnitMass_in_g']