Module Contents
This documentation is a listing of the ZapMeNot classes that are useful to the shielding practitioner. Each class description includes the parameters necessary to create an object of that class as well as the methods (i.e. functions) that the class provides.
Note that some classes are based on other ZapMeNot classes. The base classes may be selected to show additional methods available from the base class. For example. the BoxSource class is based on both the Source and shield.Box classes. An instance of the BoxSource class includes all of the methods available from the Source and shield.Box classes.
ZapMeNot Isotope
- class zapmenot.isotope.Isotope(name)[source]
Bases:
objectEncapsulates isotope data from the IsotopeLibrary.yml file.
The object is intended to make available the half life and photon intensities of the requested isotope.
- Parameters:
name (
str) – The isotope to be extracted from the isotope library.
ZapMeNot Material
- class zapmenot.material.Material(name)[source]
Bases:
objectEncapsulates the data in the MaterialLibrary.yml file.
Makes available the mean free path, mass energy absorption coefficient, the mass attenuation coefficient, and the exposure buildup factor of the requested material.
- Parameters:
name (
str) – The material to be extracted from the material library
- get_mfp(energy, distance)[source]
Calculates the mean free path for a given distance and photon energy
- get_mass_atten_coeff(energy)[source]
Calculates the mass attenuation coefficient at the given energy
- Parameters:
energy (
float) – The photon energy in MeV- Raises:
ValueError – Photon energy is out of range
- Return type:
- Returns:
The mass attenuation coefficient in cm2/g
- get_mass_energy_abs_coeff(energy)[source]
Calculates the mass energy absorption coefficient at the given energy
- Parameters:
energy (
float) – The photon energy in MeV- Raises:
ValueError – Photon energy is out of range
- Return type:
- Returns:
The mass energy absorption coefficient in cm2/g
- get_buildup_factor(energy, mfps, formula='GP')[source]
Calculates the photon buildup factor at the given energy and mfp
- Parameters:
- Raises:
ValueError – Photon energy is out of range
ValueError – Only GP buildup factors are currently supported
- Return type:
- Returns:
A vector of photon exposure buildup factors in air, one for each specified mfp
ZapMeNot Ray
- class zapmenot.ray.FiniteLengthRay(start, end)[source]
Bases:
objectRepresents a ray in three-space.
The FiniteLengthRay object has a defined starting point, a defined end, and a resulting direction.
- Parameters:
ZapMeNot Detector
ZapMeNot Shield
- class zapmenot.shield.Shield(material_name=None, density=None)[source]
Bases:
ABCAbtract class to model a photon shield.
- abstractmethod is_hollow()[source]
Returns true if the body is annular or hollow, false otherwise
- Return type:
- abstractmethod get_crossing_mfp(a_ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
a_ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- class zapmenot.shield.SemiInfiniteShield(material_name=None, density=None)[source]
Bases:
ShieldAbtract class to model a photon shield.
- abstractmethod draw()
Creates a display object
- abstractmethod get_crossing_mfp(a_ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
a_ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- class zapmenot.shield.SemiInfiniteXSlab(material_name, x_start, x_end, density=None)[source]
Bases:
SemiInfiniteShieldA semi-infinite slab shield perpendicular to the X axis.
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
a_ray – The finite length ray that is checked for intersections with the shield.
photon_energy (
float) – The photon energy in MeVray (FiniteLengthRay)
- Return type:
- class zapmenot.shield.Sphere(material_name, sphere_center, sphere_radius, density=None)[source]
Bases:
ShieldA spherical shield.
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.Shell(material_name, sphere, thickness, density=None)[source]
Bases:
ShieldA shell that surrounds a spherical shield or source.
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.Box(material_name, box_center, box_dimensions, density=None)[source]
Bases:
Shield- A rectangular polyhedron shield.
All sides of the box shield must be axis-aligned.
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.InfiniteAnnulus(material_name, cylinder_origin, cylinder_axis, cylinder_inner_radius, cylinder_outer_radius, density=None)[source]
Bases:
SemiInfiniteShieldAn annular shield of infinite length
- Parameters:
material_name (
str) – Name of the material composing the shield.cylinder_origin (
list[float]) – X, Y, and Z coordinates of the point on the cylinder centerline.cylinder_axis (
list[float]) – X, Y, and Z vector components of the cylinder axis.cylinder_inner_radius (
float) – Radius of the annulus inner surface.cylinder_outer_radius (
float) – Radius of the annulus outer surface.
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.YAlignedInfiniteAnnulus(material_name, cylinder_center, cylinder_inner_radius, cylinder_outer_radius, density=None)[source]
Bases:
InfiniteAnnulusAn annular shield of infinite length aligned with the Y axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.XAlignedInfiniteAnnulus(material_name, cylinder_center, cylinder_inner_radius, cylinder_outer_radius, density=None)[source]
Bases:
InfiniteAnnulusAn annular shield of infinite length aligned with the X axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.ZAlignedInfiniteAnnulus(material_name, cylinder_center, cylinder_inner_radius, cylinder_outer_radius, density=None)[source]
Bases:
InfiniteAnnulusAn annular shield of infinite length aligned with the Z axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.CappedCylinder(material_name, cylinder_start, cylinder_end, cylinder_radius, density=None)[source]
Bases:
ShieldA cylindrical shield of finite length
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.YAlignedCylinder(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
CappedCylinderA cylindrical shield of finite length aligned with the Y axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.XAlignedCylinder(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
CappedCylinderA cylindrical shield of finite length aligned with the X axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- class zapmenot.shield.ZAlignedCylinder(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
CappedCylinderA cylindrical shield of finite length aligned with the Z axis
- Parameters:
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
ZapMeNot Source
- class zapmenot.source.GroupOption(*values)[source]
Bases:
EnumSet of possible energy group options. The options include ‘group’, ‘discrete’, and ‘hybrid’.
- class zapmenot.source.Source[source]
Bases:
ABCAbtract class to model a radiation source.
- property grouping: GroupOption
State defining the photon energy group option.
- add_isotope_curies(new_isotope, curies)[source]
Adds an isotope and activity in curies to the isotope list
- add_isotope_bq(new_isotope, becquerels)[source]
Adds an isotope and activity in becquerels to the isotope list
- list_discrete_photons()[source]
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- class zapmenot.source.LineSource(start, end)[source]
-
Models a line radiation source
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the source
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
- class zapmenot.source.PointSource(x, y, z)[source]
-
Models a point radiation source
- Parameters:
- get_crossing_mfp(ray, photon_energy)[source]
Calculates the mfp equivalent if a ray intersects the source
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
- class zapmenot.source.SphereSource(material_name, sphere_center, sphere_radius, density=None)[source]
-
Models a Spherical source.
- Parameters:
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- class zapmenot.source.BoxSource(material_name, box_center, box_dimensions, density=None)[source]
-
Models a Axis-Aligned rectangular box source
- Parameters:
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
- class zapmenot.source.ZAlignedCylinderSource(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
ZAlignedCylinder,SourceModels a cylindrical source axis-aligned with the Z axis.
- Parameters:
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
- class zapmenot.source.YAlignedCylinderSource(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
YAlignedCylinder,SourceModels a cylindrical source axis-aligned with the Y axis.
- Parameters:
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
- class zapmenot.source.XAlignedCylinderSource(material_name, cylinder_center, cylinder_length, cylinder_radius, density=None)[source]
Bases:
XAlignedCylinder,SourceModels a cylindrical source axis-aligned with the X axis.
- Parameters:
- add_isotope_bq(new_isotope, becquerels)
Adds an isotope and activity in becquerels to the isotope list
- add_isotope_curies(new_isotope, curies)
Adds an isotope and activity in curies to the isotope list
- add_photon(energy, intensity)
Adds a photon and intensity to the photon list
- draw()
Creates a display object
- get_crossing_mfp(ray, photon_energy)
Calculates the mfp equivalent if a ray intersects the shield
- Parameters:
ray (
FiniteLengthRay) – The finite length ray that is checked for intersections with the shield.photon_energy (
float) – The photon energy in MeV
- Return type:
- Returns:
Mean free path in centimeters.
- get_photon_source_list()
Returns a list of photons in the source
This list of photons combines the Isotopes and the unique_photons specified in the Source definition. The photon intensities are scaled to an integral over the source volume.
- property grouping: GroupOption
State defining the photon energy group option.
- list_discrete_photons()
Returns a list of individual photons in the source.
The list includes only those photons that have been added individually to the source. It does not include the photons that result from the isotopes added to the source.
- list_isotopes()
Returns a list of isotopes in the source.
ZapMeNot Model
- class zapmenot.model.Model[source]
Bases:
objectPerforms point-kernel shielding analysis.
The Model class combines various shielding elements to perform the point-kernel photon shielding analysis. These elements include sources, shields, and detectors.
- set_filler_material(filler_material, density=None)[source]
Set the filler material used by the model
- add_source(new_source)[source]
Set the source used by the model. Only one source instance is allowed per model. Source can be replaced by calling this method.
- add_detector(new_detector)[source]
Set the detector used by the model. Only one detector instance is allowed per model. Detector can be replaced by calling this method.
- set_buildup_factor_material(new_material)[source]
Set the material used to calculation exposure buildup factors.
- calculate_exposure()[source]
Calculates the exposure at the detector location.
Note: Significant use of Numpy arrays to speed up evaluating the dose from each source point. A “for loop” is used to loop through photon energies, but many of the iterations through all source points is performed using matrix math.
- Return type:
- Returns:
The exposure in units of mR/hr.
- generate_summary()[source]
Calculates the energy flux and exposure at the detector location.
Note: Significant use of Numpy arrays to speed up evaluating the dose from each source point. A “for loop” is used to loop through photon energies, but many of the iterations through all source points is performed using matrix math.