The PyChem.libmetalsSNII module

PyChem.libmetalsSNII.ComputeEjectats(Mi1, datai, elts, Mi2, Resi, Hcoi, Ms1, Ms2)

From the interpolated values _i return the interpolation of ejectats

PyChem.libmetalsSNII.ComputeIntegrals(Mi1, datai, elts, Mi2, Resi, Hcoi, Mmin, Mmax, m_s, a_s, Ms1, Ms2)

From the interpolated values _i, integrate and return interpolation

PyChem.libmetalsSNII.Plot()

Do some plotting

PyChem.libmetalsSNII.ReadAndInterpolate(MetalFile, Mmin1, Mmax1, dM)

Read yields file and compute a linear interpolation of the values in the range Mmin1,Mmax1:

Parameters
  • MetalFiles (string) – file name of the file containing yields information

  • Mmin1 (float) – min star mass for the interpolation

  • Mmax1 (float) – max star mass for the interpolation

  • dM (float) – mass steps

Returns Mi2,Resi,Hcoi

Warning

values in solar mass are converted in mass fraction

PyChem.libmetalsSNII.ReadAndInterpolateHeliumCore(HeliumCoreFile, Mmin2, Mmax2, dM)

Read helium core file and compute a linear interpolation of the values in the range Mmin2,Mmax2:

Parameters
  • HeliumCoreFile (string) – file name of the file containing helium core information

  • Mmin2 (float) – min star mass for the interpolation

  • Mmax2 (float) – max star mass for the interpolation

  • dM (float) – mass steps

Returns Mi2,Resi,Hcoi

PyChem.libmetalsSNII.WriteH5Output(Group, eltsList, n, nelts)

Write a block of yields

PyChem.libmetalsSNII.WriteH5Params(ParentGroup, Mmin, Mmax, m_s, a_s, MetalFiles, HeliumCoreFile, elts, nelts, Mmin1, Mmax1, Mmin2, Mmax2, dM, n)

Write the SNII parameters in a file:

Parameters
  • f (file handler) – file

  • Mmin (float) – min SNII mass

  • Mmax (float) – max SNII mass

  • m_s (ndarray) – IMF masses

  • a_s (ndarray) – IMF slopes

  • MetalFiles (string) – file name of the file containing yields information

  • HeliumCoreFile (string) – file name of the file containing helium core information

  • elts (python list) – list of elements

  • nelts (int) – number of elements

  • Mmin1 (float) – min star mass for yields interpolation

  • Mmax1 (float) – min SNII mass for yields interpolation

  • Mmin2 (float) – min star mass for helium core interpolation

  • Mmax2 (float) – max star mass for helium core interpolation

  • dM (float) – mass steps

  • n (int) –

    ???

Returns

elts

PyChem.libmetalsSNII.WriteOutput(f, label, eltsList, n, nelts)

Write a block of yields

PyChem.libmetalsSNII.WriteParams(f, Mmin, Mmax, m_s, a_s, MetalFiles, HeliumCoreFile, elts, nelts, Mmin1, Mmax1, Mmin2, Mmax2, dM, n)

Write the SNII parameters in a file:

Parameters
  • f (file handler) – file

  • Mmin (float) – min SNII mass

  • Mmax (float) – max SNII mass

  • m_s (ndarray) – IMF masses

  • a_s (ndarray) – IMF slopes

  • MetalFiles (string) – file name of the file containing yields information

  • HeliumCoreFile (string) – file name of the file containing helium core information

  • elts (python list) – list of elements

  • nelts (int) – number of elements

  • Mmin1 (float) – min star mass for yields interpolation

  • Mmax1 (float) – min SNII mass for yields interpolation

  • Mmin2 (float) – min star mass for helium core interpolation

  • Mmax2 (float) – max star mass for helium core interpolation

  • dM (float) – mass steps

  • n (int) –

    ???

Returns

elts

PyChem.libmetalsSNII.read_MetalFile(file, columns=None, lines=None, dtype=<class 'float'>, skipheader=False, cchar='#')

Read a file containing metal information:

Parameters
  • fd (string or file handler) – file name

  • columns (python list) – columns to read

  • lines (python list) – lines to read

  • dtype (dtype) – output dtype

  • skipheader (bool) – skip header

  • cchar (string) – comment charater

Returns

data

[X,Y,Z] = READ('FILE',[1,4,13],lines=[10,1000])            Read columns 1,4 and 13 from 'FILE'  from line 10 to 1000    into array X,Y and Z