pyPENELOPE

photondetectors – Photon detectors

Inheritance diagram of penelopetools.api.input.penepma.photondetectors

Definition of the detectors to detect the emitted photons.

exception penelopetools.api.input.penepma.photondetectors.MaximumPhotonDetectorsError(value)

Bases: exceptions.Exception

Exception raised when trying to add a material passed the maximum.

class penelopetools.api.input.penepma.photondetectors.PhotonDetector(polar_angle_low=35, polar_angle_high=45, azimuthal_angle_low=0, azimuthal_angle_high=360, energy_low=0.0, energy_high=1000000.0, channels=1000, phase_state_flag=0, emissionmap_filename=None)

Bases: misctools.base.Validable

Store the parameters for a x-ray detector in PENEPMA (PDANGL, PDENER and XORIG).

If the upper limit of the energy window is Default, the beam energy of the source is used.

Parameters:
  • polar_angle_low – lower polar angle limit (in degrees)
  • polar_angle_high – upper polar angle limit (in degrees)
  • azimuthal_angle_low – lower azimuthal angle limit (in degrees)
  • azimuthal_angle_high – upper azimuthal angle limit (in degrees)
  • energy_low – lower limit of the energy window (in eV)
  • energy_high – upper limit of the energy window (in eV)
  • channels – number of channels in the energy spectrum
  • phase_state_flag

    flag of the phase-state file (psf)

    • PSF_NOFILE: the psf is not created.
    • PSF_CREATED: a psf is created.
    • PSF_CREATED_LIMITED: 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).
  • emissionmap_filename – filename for the emission map position of the coordinates of the emission sites of the photons that reach the detector. The file may grow very fast, so use this option only in short runs. A value of None indicates that the file will not be created.
ATTR_AZIMUTHAL_HIGH = 'azimuthalAngleHigh_deg'
ATTR_AZIMUTHAL_LOW = 'azimuthalAngleLow_deg'
ATTR_CHANNELS = 'channels'
ATTR_EMISSION_MAP = 'emissionMapFilename'
ATTR_ENERGY_HIGH = 'energyHigh_eV'
ATTR_ENERGY_LOW = 'energyLow_eV'
ATTR_POLAR_HIGH = 'polarAngleHigh_deg'
ATTR_POLAR_LOW = 'polarAngleLow_deg'
ATTR_PSF = 'phaseStateFlag'
KEYWORD_PDANGL = <penelopetools.api.input.penelope.util.Keyword object at 0x69740d0>
KEYWORD_PDENER = <penelopetools.api.input.penelope.util.Keyword object at 0x6974150>
KEYWORD_XRORIG = <penelopetools.api.input.penelope.util.Keyword object at 0x6974190>
TAG_NAME = 'photonDetector'
azimuthal_angle_high

Upper limit of the azimuthal angle of the detector. The angle must be between 0 and 360 degrees. The value is stored in a magnitude.Magnitude.

azimuthal_angle_low

Lower limit of the azimuthal angle of the detector. The angle must be between 0 and 360 degrees. The value is stored in a magnitude.Magnitude.

channels

Number of channels of the detector. The number of channels must be between 10 and 1000. The value is stored in a magnitude.Magnitude.

emissionmap_filename

filename for the emission map position of the coordinates of the emission sites of the photons that reach the detector. The file may grow very fast, so use this option only in short runs. If the attribute is deleted, it indicates that the file will not be created.

energy_high

Upper limit of the energy window of the detector. The energy must be between 0 and 1e6 eV. If the attribute is deleted, the beam energy of the source is used. The value is stored in a magnitude.Magnitude.

energy_low

Lower limit of the energy window of the detector. The energy must be between 0 and 1e6 eV. If the attribute is deleted, the value of 0.0 eV is used as the lower limit. The value is stored in a magnitude.Magnitude.

classmethod from_inputfile(lines)

Creates a PhotonDetector from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(element)

Creates a PhotonDetector from a XML element.

Parameters:element – XML element
has_emissionmap()
phase_state_flag
Flag of the phase-state file (psf), either:
  • PSF_NOFILE: the psf is not created.

  • PSF_CREATED: a psf is created.

  • PSF_CREATED_LIMITED: 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).

polar_angle_high

Upper limit of the polar angle of the detector. The angle must be between 0 and 180 degrees. The value is stored in a magnitude.Magnitude.

polar_angle_low

Lower limit of the polar angle of the detector. The angle must be between 0 and 180 degrees. The value is stored in a magnitude.Magnitude.

solid_angle

Returns the solid angle of the detector based on the polar and azimuthal angles.

to_html(header_level=1)

Returns a HTML representation of this option.

to_inputfile()

Returns the lines of this option to create a IN file.

to_xml()

Returns a XML representation of this option.

validate()

Validates the detector to check that the lower angle and energy limits are lower than the upper limits. Raises ValueError

class penelopetools.api.input.penepma.photondetectors.PhotonDetectors(data=[])

Bases: list, penelopetools.api.input.penelope.option.Option

Store the x-ray detectors of a simulation job in a list object. It checks that the number of detectors is below the limit (50). If the number of detectors is above the maximum number of detectors, MaximumPhotonDetectorsError is raised.

Parameters:data (list) – list of PhotonDetector
TAG_NAME = 'photonDetectors'
append(value)

Appends a PhotonDetector to the list of photon detectors. If the number of detectors is above the maximum number of detectors, MaximumPhotonDetectorsError is raised.

clear()

Removes all photon detectors from the list.

extend(values)

Extends the list of photon detectors by another list of photon detectors. If the number of detectors is above the maximum number of detectors, MaximumPhotonDetectorsError is raised.

classmethod from_inputfile(lines)

Creates a PhotonDetectors from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a PhotonDetectors from a XML element.

Parameters:element – XML element
insert(index, value)

Insert a PhotonDetector at index. If the number of detectors is above the maximum number of detectors, MaximumPhotonDetectorsError is raised.

to_html(header_level=1)

Returns a HTML representation of this option.

to_inputfile()

Returns the lines of this option to create a IN file.

to_xml()

Returns a XML representation of this option.

validate()

Validates that there is at least one photon detector in the list and that each photon detector is valid. Raises ValueError