PENEPMA¶
Input¶
Input of PENEPMA simulation.
-
class
pypenelopetools.penepma.input.
PenepmaInput
[source]¶ Bases:
pypenelopetools.penelope.input.PenelopeInputBase
Creates an object representing a PENEPMA input file.
-
IFORCE
¶ IFORCE
– Forcing of interactions.
-
photon_detectors
¶ PhotonDetectors
– Definition of the photon detectors.
-
REFLIN
¶ REFLIN
– Termination of simulation based on relative statistical uncertainty of the intensity of line.
-
read
(fileobj)¶ Reads an input file (i.e.
.in
).Parameters: fileobj (file object) – File object opened with read access.
-
write
(fileobj)¶ Writes to an input file (i.e.
.in
).Parameters: fileobj (file object) – File object opened with write access.
-
Results¶
Results of PENEPMA simulation.
-
class
pypenelopetools.penepma.results.
PenepmaIntensityResult
(detector_index)[source]¶ Bases:
pypenelopetools.penepma.results.PenepmaPhotonDetectorResultBase
Results from
pe-intens-XX.dat
, whereXX
is the index of the detector. The intensities are given for each characteristic x-ray detected by the detector.Note
The characteristic x-rays are expressed using
XrayLine
object of the pyxray package.XrayLine
objects define the atomic number and x-ray transition of characteristic x-rays.The intensities are expressed using the uncertainties package. The nominal value can be accessed with the property
nominal_value
or the abbreviationn
, whereas the standard deviation (1-sigma), with the propertystd_dev
ors
.For example:
import pyxray x = pyxray.XrayLine(29, 'Ka1') result.total_intensities_1_per_sr_electron[x].n #-> 8.56e-10 result.total_intensities_1_per_sr_electron[x].s #-> 0.15e-10
Parameters: detector_index (int) – Index of the detector to read the results from. -
detector_index
¶ int – Index of detector
-
theta1_deg
¶ ufloat – Lower limit polar angle in deg.
-
theta2_deg
¶ ufloat – Upper limit polar angle in deg.
-
phi1_deg
¶ ufloat – Lower limit azimuthal angle in deg.
-
phi2_deg
¶ ufloat – Upper limit azimuthal angle in deg.
-
primary_intensities_1_per_sr_electron
¶ dict(XrayLine, ufloat) – Intensities of characteristic x-rays generated by primary electrons and measured by the detector.
-
characteristic_fluorescence_intensities_1_per_sr_electron
¶ dict(XrayLine, ufloat) – Intensities of characteristic x-rays generated by the fluorescence of characteristic x-rays and measured by the detector.
-
bremsstrahlung_fluorescence_intensities_1_per_sr_electron
¶ dict(XrayLine, ufloat) – Intensities of characteristic x-rays generated by the fluorescence of Bremsstrahlung x-rays and measured by the detector.
-
total_fluorescence_intensities_1_per_sr_electron
¶ dict(XrayLine, ufloat) – Intensities of characteristic x-rays generated by fluorescence (characteristic and Bremsstrahlung) and measured by the detector. Intensities are equal to the sum of characteristic_fluorescence_intensities_1_per_sr_electron and bremsstrahlung_fluorescence_intensities_1_per_sr_electron.
-
total_intensities_1_per_sr_electron
¶ dict(XrayLine, ufloat) – Intensities of characteristic x-rays generated and measured by the detector. Intensities are equal to the sum of primary_intensities_1_per_sr_electron and total_fluorescence_intensities_1_per_sr_electron.
-
-
class
pypenelopetools.penepma.results.
PenepmaPhotonDetectorResultBase
(detector_index)[source]¶ Bases:
pypenelopetools.penelope.result.PenelopeResultBase
Base result associated with a photon detector.
Parameters: detector_index (int) – Index of the detector to read the results from. -
detector_index
¶ int – Index of detector
-
theta1_deg
¶ ufloat – Lower limit polar angle in deg.
-
theta2_deg
¶ ufloat – Upper limit polar angle in deg.
-
phi1_deg
¶ ufloat – Lower limit azimuthal angle in deg.
-
phi2_deg
¶ ufloat – Upper limit azimuthal angle in deg.
-
-
class
pypenelopetools.penepma.results.
PenepmaResult
[source]¶ Bases:
pypenelopetools.penelope.result.PenelopeResultBase
Results from
penepma-res.dat
.Note
All results are expressed using the uncertainties package. The nominal value can be accessed with the property
nominal_value
or the abbreviationn
, whereas the standard deviation (1-sigma), with the propertystd_dev
ors
. For example:result.simulation_time_s.n #-> 100.0 result.simulation_time_s.s #-> 0.0
-
simulation_time_s
¶ ufloat – Simulation time in seconds.
-
simulation_speed_1_per_s
¶ ufloat – Simulation speed in simulation per second.
-
simulated_primary_showers
¶ ufloat – Number of primary showers simulated.
-
upbound_primary_particles
¶ ufloat – Number of primary particles that exited the geometry upwards.
-
downbound_primary_particles
¶ ufloat – Number of primary particles that exited the geometry downwards.
-
absorbed_primary_particles
¶ ufloat – Number of primary particles that were absorbed within the geometry.
-
upbound_fraction
¶ ufloat – Fraction of primary particles that exited the geometry upwards.
-
downbound_fraction
¶ ufloat – Fraction of primary particles that exited the geometry downwards.
-
absorbed_fraction
¶ ufloat – Fraction of primary particles that were absorbed within the geometry.
-
upbound_secondary_electron_generation_probabilities
¶ ufloat – Probability of second generation electrons exited the geometry upwards.
-
downbound_secondary_electron_generation_probabilities
¶ ufloat – Probability of second generation electrons exited the geometry downwards.
-
absorbed_secondary_electron_generation_probabilities
¶ ufloat – Probability of second generation electrons absorbed within the geometry.
-
upbound_secondary_photon_generation_probabilities
¶ ufloat – Probability of second generation photons exited the geometry upwards.
-
downbound_secondary_photon_generation_probabilities
¶ ufloat – Probability of second generation photons exited the geometry downwards.
-
absorbed_secondary_photon_generation_probabilities
¶ ufloat – Probability of second generation photons absorbed within the geometry.
-
upbound_secondary_positron_generation_probabilities
¶ ufloat – Probability of second generation positrons exited the geometry upwards.
-
downbound_secondary_positron_generation_probabilities
¶ ufloat – Probability of second generation positrons exited the geometry downwards.
-
absorbed_secondary_positron_generation_probabilities
¶ ufloat – Probability of second generation positrons absorbed within the geometry.
-
average_deposited_energy_eV
¶ dict(int, ufloat) – Average deposited energy in each body. Dictionary where keys are indexes of body and values, the average deposited energy in eV.
-
average_photon_energy_eV
¶ dict(int, ufloat) – Average photon energy in each detector. Dictionary where keys are indexes of detector and values, the average energy in eV.
-
last_random_seed1
¶ ufloat – Last first seed of the random number generator.
-
last_random_seed2
¶ ufloat – Last second seed of the random number generator.
-
reference_line_uncertainty
¶ ufloat – Relative uncertainty of the x-ray line used as a termination condition
-
-
class
pypenelopetools.penepma.results.
PenepmaSpectrumResult
(detector_index)[source]¶ Bases:
pypenelopetools.penepma.results.PenepmaPhotonDetectorResultBase
Results from
pe-spect-XX.dat
, whereXX
is the index of the detector. The spectrum is stored as a numpy array where the first column contains the energies in eV and the second the intensities in 1/(sr.electron).Note
The energies and intensities are expressed using the uncertainties package. The nominal value can be accessed with the property
nominal_value
or the abbreviationn
, whereas the standard deviation (1-sigma), with the propertystd_dev
ors
.For example:
from uncertainty import unumpy energies_eV = unumpy.nominal_values(result.spectrum[:,0]) intensities = unumpy.nominal_values(result.spectrum[:,1])
Parameters: detector_index (int) – Index of the detector to read the results from. -
detector_index
¶ int – Index of detector
-
theta1_deg
¶ ufloat – Lower limit polar angle in deg.
-
theta2_deg
¶ ufloat – Upper limit polar angle in deg.
-
phi1_deg
¶ ufloat – Lower limit azimuthal angle in deg.
-
phi2_deg
¶ ufloat – Upper limit azimuthal angle in deg.
-
energy_window_start_eV
¶ ufloat – Energy of first window in eV.
-
energy_window_end_eV
¶ ufloat – Energy of last window in eV.
-
channel_width_eV
¶ ufloat – Width of one channel in eV.
-
spectrum
¶ unumpy.uarray – Array where the first column contains the energies in eV and the second the intensities measured by the detector in 1/(sr.electron).
-
energies_eV
¶ numpy array – Nominal values of the energy axis in eV.
-
intensities_1_per_sr_electron
¶ numpy array – Nominal values of the intensity axis in 1/(sr.electron).
-
Keywords¶
Keywords used specifically for PENEPMA.
-
class
pypenelopetools.penepma.keywords.
PhotonDetectorGroup
[source]¶ Bases:
pypenelopetools.penelope.keyword.KeywordGroupBase
Definition of photon detector.
Each detector collects photons that leave the sample with directions within a rectangle( on the unit sphere, limited by the *parallels THETA1 and THETA2 and the meridians PHI1 and PHI2. The output spectrum is the energy distribution of photons that emerge within the acceptance solid angle of the detector with energies in the interval from EDEL to EDEU, recorded using NCHE channels. Notice that the spectrum is given in absolute units (per incident electron, per eV and per unit solid angle).
-
set
(theta1, theta2, phi1, phi2, ipsf, edel, edeu, nche, emission_filename=None)[source]¶ Sets parameters of detector.
Note
phi1
andphi2
must be both either in the interval (0,360) or in the interval (-180,180).Parameters: - theta1 (float) – Lower limit polar angle in deg.
- theta2 (float) – Upper limit polar angle in deg.
- phi1 (float) – Lower limit azimuthal angle in deg.
- phi2 (float) – Upper limit azimuthal angle in deg.
- ipsf (int) –
Flag to activate the creation of a phase-space file (psf), which contains the state variables and weights of particles that enter the detector. Use this option with care, because psf’s may grow very fast.
ipsf=0
: the psf is not created.ipsf=1
: a psf is created.ipsf>1
: a psf is created, but contains only state variables of detected photons that have ILB(4)=IPSF (used for studying angular distributions of x rays).
Generating the psf is useful for tuning interaction forcing, which requires knowing the weights of detected particles.
- edel (float) – Lower limits of the energy window covered by the detector in eV.
- edeu (float) – Upper limits of the energy window covered by the detector in eV.
- nche (int) – Number of energy channels in the output spectrum. Should be less than 1000.
- emission_filename (str, optional) – File name of the generation file. Specifying a file name activates the generation of a file with the position coordinates of the emission sites of the photons that reach the detector. Notice that the file may grow very fast, so use this option only in short runs. The output file is overwritten when a simulation is resumed.
-
-
class
pypenelopetools.penepma.keywords.
PhotonDetectors
(maxlength=25)[source]¶ Bases:
pypenelopetools.penelope.keyword.KeywordSequence
Definition of the photon detectors.
Up to 25 different detectors can be defined.
-
add
(theta1, theta2, phi1, phi2, ipsf, edel, edeu, nche, emission_filename=None)[source]¶ Add a new photon detector.
Note
phi1
andphi2
must be both either in the interval (0,360) or in the interval (-180,180).Important
The theta angles are defined as angles from the positive z-axis. This is different than the take-off angle usually used in microanalysis. For a take-off angle of 30deg, theta would be 60deg.
Parameters: - theta1 (float) – Lower limit polar angle in deg.
- theta2 (float) – Upper limit polar angle in deg.
- phi1 (float) – Lower limit azimuthal angle in deg.
- phi2 (float) – Upper limit azimuthal angle in deg.
- ipsf (int) –
Flag to activate the creation of a phase-space file (psf), which contains the state variables and weights of particles that enter the detector. Use this option with care, because psf’s may grow very fast.
ipsf=0
: the psf is not created.ipsf=1
: a psf is created.ipsf>1
: a psf is created, but contains only state variables of detected photons that have ILB(4)=IPSF (used for studying angular distributions of x rays).
Generating the psf is useful for tuning interaction forcing, which requires knowing the weights of detected particles.
- edel (float) – Lower limits of the energy window covered by the detector in eV.
- edeu (float) – Upper limits of the energy window covered by the detector in eV.
- nche (int) – Number of energy channels in the output spectrum. Should be less than 1000.
- emission_filename (str, optional) – File name of the generation file. Specifying a file name activates the generation of a file with the position coordinates of the emission sites of the photons that reach the detector. Notice that the file may grow very fast, so use this option only in short runs. The output file is overwritten when a simulation is resumed.
-
-
class
pypenelopetools.penepma.keywords.
REFLIN
[source]¶ Bases:
pypenelopetools.penelope.keyword.TypeKeyword
Termination of simulation based on relative statistical uncertainty of the intensity of line.
-
class
pypenelopetools.penepma.keywords.
SAPERT
[source]¶ Bases:
pypenelopetools.penelope.keyword.TypeKeyword
Angular aperture of the electron beam.
-
class
pypenelopetools.penepma.keywords.
SDIREC
[source]¶ Bases:
pypenelopetools.penelope.keyword.TypeKeyword
Polar and azimuthal angles of the electron beam axis direction.
-
class
pypenelopetools.penepma.keywords.
SRADI
[source]¶ Bases:
pypenelopetools.penelope.keyword.TypeKeyword
Initial position of the particle is sampled randomly within a circle.
The circle is centered at (SX0,SY0,SZ0) and perpendicular to the beam axis direction.
-
class
pypenelopetools.penepma.keywords.
XRAYE
(maxlength=10)[source]¶ Bases:
pypenelopetools.penelope.keyword.KeywordSequence
Space distribution of emission sites of x rays within an energy interval.
-
class
pypenelopetools.penepma.keywords.
XRLINE
(maxlength=10)[source]¶ Bases:
pypenelopetools.penelope.keyword.KeywordSequence
Space distribution of emission sites of x rays.