physdata API documentation

Contents:

xray

xray.py: A module to interface the X-Ray Mass Attenuation Coefficients data.

class physdata.xray.CompoundData(row, short_name)[source]

An composite material in the database.

short_name

str – Short name of the material.

name

str – Name of the material.

mass_ratio

float – Mean atomic number-mass ratio <Z/A>.

excitation

float – Mean excitation energy in eV.

density

float – Density in g/cm^3.

Note

Some density values are only nominal, according to the data.

class physdata.xray.ElementData(row)[source]

An element in the database.

z

int – The atomic number.

symbol

str – Symbol of the element.

name

str – Name of the element.

mass_ratio

float – Atomic number-mass ratio Z/A.

excitation

float – Mean excitation energy in eV.

density

float – Density in g/cm^3.

Note

Some density values are only nominal, according to the data. Values for Z=85 and 87 where arbitrarily set to 10.

physdata.xray.fetch_coefficients(z, density=None, border_separation=1e-08)[source]

Fetch from the website the data for an element or compound.

Parameters:
  • z (int or str) – The atomic number (element) or a string representing the compound.
  • density (float, optional) – If given, the density scaling is removed.
  • border_separation (float) – An amount in MeV to split the absorption edges in the data. If the value was so big it would overlap another energy interval, it will be reduced with a warning.
Returns:

a list with the data for each tabulated energy value, each a list with:

  • (float): Energy in MeV.
  • (float): Attenuation coefficient in cm^2/g or in cm^-1 if a density was given.
  • (float): Energy absorption coefficient in cm^2/g or in cm^-1 if a density was given.

Return type:

List

physdata.xray.fetch_compounds()[source]

Fetch the compound data from the NIST database.

Returns:A list with the info of each compound available.
Return type:List[CompoundData]
physdata.xray.fetch_elements()[source]

Fetch the element data from the NIST database.

Returns:A list with the info of each element available.
Return type:List[ElementData]

star

star.py: A module to interface the Stopping-Power & Range Tables for Electrons, Protons, and Helium Ions.

physdata.star.fetch_astar(el_id, density=None)[source]

Fetch from the website the data for alpha particles in a medium.

Check the STAR appendix for further details.

Parameters:
  • el_id (int) – The positive integer identifying the medium.
  • density (float or bool, optional) – If given, the density scaling is removed. If it is the boolean True, the
  • will be taken from the website. (density) –
Returns:

a list of lists, a list with the data for each tabulated energy value, each a list with:

  • (float): Kinetic energy in MeV.
  • (float): Electronic stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Nuclear stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Total stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): CSDA range in g/cm^2 or in cm if a density was given.
  • (float): Projected CSDA range in g/cm^2 or in cm if a density was given.
  • (float): Detour factor (projected CSDA / CSDA).

Return type:

(list)

physdata.star.fetch_estar(el_id, density=None)[source]

Fetch from the website the data for electrons in a medium.

Check the STAR appendix for further details.

Parameters:
  • el_id (int) – The positive integer identifying the medium.
  • density (float or bool, optional) – If given, the density scaling is removed. If it is the boolean True, the density will be taken from the website.
Returns:

a list of lists, a list with the data for each tabulated energy value, each a list with:

  • (float): Kinetic energy in MeV.
  • (float): Collision stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Radiative stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Total stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): CSDA range in g/cm^2 or in cm if a density was given.
  • (float): Radiation yield (fraction of kinetic energy converted into bremsstrahlung).
  • (float): Density effect parameter

Return type:

(list)

physdata.star.fetch_pstar(el_id, density=None)[source]

Fetch from the website the data for protons in a medium.

Check the STAR appendix for further details.

Parameters:
  • el_id (int) – The positive integer identifying the medium.
  • density (float or bool, optional) – If given, the density scaling is removed. If it is the boolean True, the
  • will be taken from the website. (density) –
Returns:

a list of lists, a list with the data for each tabulated energy value, each a list with:

  • (float): Kinetic energy in MeV.
  • (float): Electronic stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Nuclear stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): Total stopping power in MeV cm^2/g or in MeV/cm if a density was given.
  • (float): CSDA range in g/cm^2 or in cm if a density was given.
  • (float): Projected CSDA range in g/cm^2 or in cm if a density was given.
  • (float): Detour factor (projected CSDA / CSDA).

Return type:

(list)

Indices and tables