pytomography.utils.nist_data#

Module Contents#

Functions#

dual_sqrt_exponential(energy, c1, c2, d1, d2)

Function used for curve fitting of linear attenuation coefficient vs. photon energy curves from NIST. It's given by the functional form \(f(x) = c_1e^{-d_1\sqrt{x}} + c_2e^{-d_2\sqrt{x}}\). It was chosen purely because it gave good fit results.

get_E_mu_data_from_datasheet(file)

Return energy and linear attenuation data from NIST datafiles of mass attenuation coefficients between 50keV and 511keV.

get_mu_from_spectrum_interp(file, energy)

Gets linear attenuation corresponding to a given energy in in the data from file.

pytomography.utils.nist_data.dual_sqrt_exponential(energy, c1, c2, d1, d2)[source]#

Function used for curve fitting of linear attenuation coefficient vs. photon energy curves from NIST. It’s given by the functional form \(f(x) = c_1e^{-d_1\sqrt{x}} + c_2e^{-d_2\sqrt{x}}\). It was chosen purely because it gave good fit results.

Parameters:
  • energy (float) – Energy of photon

  • c1 (float) – Fit parameter 1

  • c2 (float) – Fit parameter 2

  • d1 (float) – Fit parameter 3

  • d2 (float) – Fit parameter 4

Returns:

_description_

Return type:

float

pytomography.utils.nist_data.get_E_mu_data_from_datasheet(file)[source]#

Return energy and linear attenuation data from NIST datafiles of mass attenuation coefficients between 50keV and 511keV.

Parameters:

file (str) – Location of NIST data file. Corresponds to a particular element/material.

Returns:

Energy and linear attenuation values.

Return type:

tuple[np.array, np.array]

pytomography.utils.nist_data.get_mu_from_spectrum_interp(file, energy)[source]#

Gets linear attenuation corresponding to a given energy in in the data from file.

Parameters:
  • file (str) – Filepath of the mu-energy data

  • energy (float) – Energy at which mu is computed

Returns:

Linear attenuation coefficient (in 1/cm) at the desired energies.

Return type:

np.array