X-ray Spectra Modeling
- xrayphysics.xrayPhysics.simulateSpectra(self, kV, takeOffAngle=11.0, Z=74, gammas=None)
x-ray source spectra model
- Parameters:
kV (scalar) – voltage of a bremsstrahlung spectrum
takeOffAngle (scalar) – the take-off angle (degrees) of the reflection anode
Z (int) – the atomic number of the anode material, must be 29, 42, 74, or 79 (Cu, Mo, W, Au)
gammas (numpy array) – the energies for which to model the spectra, if unspecified uses default values
- Returns:
The x-ray source spectra model
- xrayphysics.xrayPhysics.changeTakeOffAngle(self, kV, takeOffAngle_cur, takeOffAngle_new, Z, gammas, spectrum_cur)
Change the anode take-off angle of a given x-ray source spectra model
- Parameters:
kv (scalar) –
takeOffAngle_cur (scalar) – the take-off angle (degrees) of the input spectra
takeOffAngle_new (scalar) – the take-off angle (degress) of the output spectra
Z (int) – the atomic number of the anode material, must be 29, 42, 74, or 79 (Cu, Mo, W, Au)
gammas (numpy array) – the energy samples at which the input spectra is defined
spectrum_cur (numpy array) – the current x-ray spectra model (from any source; does not have to be created by this package)
- Returns:
The modified x-ray spectra model
- xrayphysics.xrayPhysics.detectorResponse(self, chemicalFormula, density, thickness, gammas)
Analytic detector response model
- Parameters:
chemicalFormula (string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
density (scalar) – the mass density (g/cm^3) of the scintillator
thickness (scalar) – the thickness (cm) of the scintillator
gammas (numpy array) – the energy samples (keV) at which to calculate the detector response
- Returns:
A model of the detector response
- xrayphysics.xrayPhysics.filterResponse(self, chemicalFormula, density, thickness, gammas)
X-ray Filter response model
- Parameters:
chemicalFormula (string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
density (scalar) – the mass density (g/cm^3) of the filter material
thickness (scalar) – the thickness (cm) of the filter material
gammas (numpy array) – the energy samples (keV) at which to calculate the filter response
- Returns:
A model of the response to the given x-ray filter
- xrayphysics.xrayPhysics.meanEnergy(self, spectralResponse, gammas)
Calculates the mean energy of a given spectra
- Parameters:
spectralResponse (numpy array) – spectra model
gammas (numpy array) – energies at which the spectra model is defined
- Returns:
The mean energy (keV) of the given spectra
- xrayphysics.xrayPhysics.normalizeSpectrum(self, spectralResponse, gammas)
Normalizes the given spectra
- Parameters:
spectralResponse (numpy array) – spectra model
gammas (numpy array) – energies at which the spectra model is defined
- Returns:
The normalized spectra