pysep.misc.abun package

Submodules

pysep.misc.abun.utils module

pysep.misc.abun.utils.a_to_mfrac(a, amass, X)

Convert a for the ith element to the mass fraction of the ith element using the equation:

\[F_{i} = \left[\frac{Xm_{i}}{1.008}\right]\times 10^{a(i)-12}\]

Where \(F_{i}\) is the mass fraction for the \(i^{th}\) element and \(m_{i}\) is the mass fraction for the \(i^{th}\) element.

Parameters
  • a (float) – a for the ith element

  • amass (float) – Mass of the ith element in atomic mass units.

  • X (float) – Hydrogen mass fraction

Returns

mfrac – mass fraction for the ith element

Return type

float

pysep.misc.abun.utils.est_feh_from_Z_and_X(abunTable: dict, Xt: float, Zt: float) float

Analytically estimate feh from Z and X

Parameters
  • abunTable (dict) – Abundance Table dictionary in the form described in the docs for pysep.misc.abun.util.open_and_parse.

  • Xt (float) – Target X to move to

  • Zt (float) – Target Z to move to.

Returns

FeH – [Fe/H] value to add to every a(i) for every tracked element i where i > 2 (i.e all the metals).

Return type

float

pysep.misc.abun.utils.gen_abun_map(abunTable)

Generate an analytic mapping between X, Y, Z and FeH given an abundance table.

Parameters

abunTable (str) – Path of checmical abundance table to use for composition. Format of this table is defined in the ext module documentation.

Returns

MetalAbunMap – Function build from interpolation of a grid of FeH, alpha/Fe, and a(He) which will returned the set of those values giving the composition most similar to an input X, Y, and Z.

Return type

function(X,Y,Z) -> (Fe/H,0.0,a(He))

pysep.misc.abun.utils.get_atomic_masses()

Return a dict of atomic masses from Hydrogen all the way to plutonium

Returns

amasses – Dicionary of atomic masses in atomic mass units indexed by elemental symbol.

Return type

dict of floats

pysep.misc.abun.utils.mfrac_to_a(mfrac, amass, X, Y)

Convert mass fracition of a given element to a for that element at a given hydrogen mass fraction using the equation

\[a(i) = \log(1.008) + \log(F_{i}) - \left[\log(X) + \log(m_{i}) \right]\]

Where \(F_{i}\) is the mass fraction for the \(i^{th}\) element and \(m_{i}\) is the mass fraction for the \(i^{th}\) element.

Parameters
  • mfrac (float) – Mass fraction of the ith element.

  • amass (float) – Mass of the ith element in atomic mass units.

  • X (float) – Hydrogen mass fraction

  • Y (float) – Helium mass fraction, will be used as reference if X = 0

Returns

a – a for the ith element

Return type

float

pysep.misc.abun.utils.parse_abundance_map() numpy.ndarray

Parse Hydroge, Helium, and metal mass fraction out of a csv where each row is one composition, the first column is X, second is Y, and the third is Z. Comments may be included in the file if the first non white space charectar on the line is a hash.

Returns

pContents – numpy array of all the compositions of length n where n is the number of rows whos first non white space charectar was not a hash. For a dsep n=126. Along the second axis the first column is X, the second is Y, and the third is Z.

Return type

np.ndarray(shape=(n,3))

Module contents

Chemical abundance tables which might be needed.

Avalible Aubundance Tables

GS98.abun

[1] Grevesse, N. and Sauval, A.J., 1998. Standard solar composition. Space Science Reviews, 85(1), pp.161-174.

AGSS09.abun

[1] Asplund, M., Grevesse, N., Sauval, A.J. and Scott, P., 2009. The chemical composition of the Sun. Annual review of astronomy and astrophysics, 47, pp.481-522.