pyPENELOPE

distribution – Angular, energy and spatial distributions

Inheritance diagram of penelopetools.api.input.penelope.distribution

class penelopetools.api.input.penelope.distribution.AzimuthalAngular(bins=30)

Bases: penelopetools.api.input.penelope.distribution._Angular

Store the parameters for an azimuthal angular distribution (NBPH).

Parameters:bins (int) – number of bins [default=1]
KEYWORD = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4b10>
TAG_NAME = 'azimuthalAngularDistribution'
classmethod from_inputfile(lines)

Creates a _Angular from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a _Angular from a XML element.

Parameters:element – XML element
class penelopetools.api.input.penelope.distribution.Energy(energy_low=0.0, energy_high=1000000.0, bins=250)

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

Store the parameters for an energy distribution (NBE).

Parameters:
  • energy_low (float) – lower limit of the energy interval (in eV) [default=0]
  • energy_high (float) – upper limit of the energy interval (in eV)
  • bins (int) – number of bins [default=100]
ATTR_BINS = 'bins'
ATTR_ENERGY_HIGH = 'energyHigh_eV'
ATTR_ENERGY_LOW = 'energyLow_eV'
KEYWORD = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4c50>
TAG_NAME = 'energyDistribution'
bins

Number of bins in the distribution. The number of bins must be equal or greater than 1 and less than the maximum number of allowed bins (1000).

The value is stored in a magnitude.Magnitude.

energy_high

Upper limit of the energy interval (in eV). The energy must be between 0 and 1e6 eV. If the energy 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 interval (in eV). The energy must be between 0 and 1e6 eV.

The value is stored in a magnitude.Magnitude.

classmethod from_inputfile(lines)

Creates a Energy from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a Energy from a XML element.

Parameters:element – XML element
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 if the upper limit is greater than the lower limit. Raises ValueError

class penelopetools.api.input.penelope.distribution.PolarAngular(bins=45)

Bases: penelopetools.api.input.penelope.distribution._Angular

Store the parameters for a polar angular distribution (NBTH).

Parameters:bins (int) – number of bins [default=90]
KEYWORD = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4990>
TAG_NAME = 'polarAngularDistribution'
classmethod from_inputfile(lines)

Creates a _Angular from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a _Angular from a XML element.

Parameters:element – XML element
class penelopetools.api.input.penelope.distribution.Spatial(xlow=-1, xhigh=1, ylow=-1, yhigh=1, zlow=-1, zhigh=1, xbins=1, ybins=1, zbins=1, energy_low=0.0, energy_high=1000000.0)

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

Store the parameters for the spatial distribution. A spatial distribution is a 3D box with a number of bins that records the energy absorbed inside the box.

Parameters:
  • xlow – lower limit for the x coordinate (cm)
  • xhigh – upper limit for the x coordinate (cm)
  • ylow – lower limit for the y coordinate (cm)
  • yhigh – upper limit for the y coordinate (cm)
  • zlow – lower limit for the z coordinate (cm)
  • zhigh – upper limit for the z coordinate (cm)
  • xbins – number of bins in the x direction
  • ybins – number of bins in the y direction
  • zbins – number of bins in the z direction
  • energy_low – lower limit of the energy window (eV)
  • energy_high – upper limit of the energy window (eV)
ATTR_ENERGY_HIGH = 'energyHigh'
ATTR_ENERGY_LOW = 'energyLow'
ATTR_XBINS = 'xBins'
ATTR_XHIGH = 'xHigh'
ATTR_XLOW = 'xLow'
ATTR_YBINS = 'yBins'
ATTR_YHIGH = 'yHigh'
ATTR_YLOW = 'yLow'
ATTR_ZBINS = 'zBins'
ATTR_ZHIGH = 'zHigh'
ATTR_ZLOW = 'zLow'
KEYWORD_GRIDBN = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4e50>
KEYWORD_GRIDX = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4d90>
KEYWORD_GRIDY = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4dd0>
KEYWORD_GRIDZ = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4e10>
KEYWORD_XRAYE = <penelopetools.api.input.penelope.util.Keyword object at 0x59e4e90>
TAG_NAME = 'spatialDistribution'
energy_high

Upper limit of the energy interval (in eV). The energy must be between 0 and 1e6 eV. If the energy 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 interval (in eV). The energy must be between 0 and 1e6 eV.

The value is stored in a magnitude.Magnitude.

classmethod from_inputfile(lines)

Creates a Spatial from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a Spatial from a XML element.

Parameters:element – XML element
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 if the upper limits are greater than the lower limits. Raises ValueError

xbins

Number of bins in the x direction. The number of bins must be equal or greater than 1 and less than the maximum number of allowed bins (100).

The value is stored in a magnitude.Magnitude.

xhigh

Upper limit of the box in the x direction (cm). The value is stored in a magnitude.Magnitude.

xlow

Low limit of the box in the x direction (cm). The value is stored in a magnitude.Magnitude.

ybins

Number of bins in the y direction. The number of bins must be equal or greater than 1 and less than the maximum number of allowed bins (100).

The value is stored in a magnitude.Magnitude.

yhigh

Upper limit of the box in the y direction (cm). The value is stored in a magnitude.Magnitude.

ylow

Low limit of the box in the y direction (cm). The value is stored in a magnitude.Magnitude.

zbins

Number of bins in the z direction. The number of bins must be equal or greater than 1 and less than the maximum number of allowed bins (100).

The value is stored in a magnitude.Magnitude.

zhigh

Upper limit of the box in the z direction (cm). The value is stored in a magnitude.Magnitude.

zlow

Low limit of the box in the z direction (cm). The value is stored in a magnitude.Magnitude.