revertex package¶
Subpackages¶
Submodules¶
revertex.cli module¶
- revertex.cli.cli(args=None)¶
- Return type:
None
revertex.core module¶
- revertex.core.convert_output_kin(arr, *, eunit='keV', tunit='ns', lunit='mm', include_positions=False)¶
Converts the vertices to the correct output format for kin information.
This follows the convention defined by remage and optionally can also include positions into a combined table.
- revertex.core.convert_output_pos(arr, *, lunit='mm')¶
Converts the vertices to the correct output format for pos information.
- Parameters:
arr (Array) – The input data to convert.
lunit (str) – Unit for distances, by default mm.
- Returns:
The output table.
- Return type:
Table
- revertex.core.write_remage_vtx(n, out_file, seed, generator, lunit='mm', **kwargs)¶
Save the vertices generatored by a particular vertex generator function.
This follows the convention defined by remage.
- Parameters:
n (int) – The number of vertices to generate
out_file (str) – The path to the file to save the results.
seed (int | None) – The seed to the random number generator
generator (Callable) – A function generating the vertices (following the revertex specifications)
kwargs – The keyword arguments to the function
lunit (str)
- Return type:
None
revertex.plot module¶
revertex.sampling module¶
- revertex.sampling.sample_cylinder(r_range, z_range, size, seed, phi_range=(0, 6.283185307179586))¶
Generate points in a cylinder, returns the points as a 2D array
- revertex.sampling.sample_histogram(histo, size, *, seed=None)¶
Generate samples from a 1D or 2D histogram.
Based on approximating the histogram as a piecewise uniform, probability distribution.
- revertex.sampling.sample_proportional_radius(r0, r1, size=10000, seed=None)¶
Sample from a distribution weighted by the radius. This is used for the surface sampling og shapes.
Based on sampling from a distribution:
\[P(r) \propto r\]restricted to the range min(r0,r1) to max(r0,r1).
revertex.utils module¶
- revertex.utils._get_position(pv_name, reg)¶
Get the global position of a physical volume from the GDML
- revertex.utils.collect_isotopes(component, scale, isotopes, nist_registry, nist_element_z_to_name, pyg4, *, normalize_output=True, _is_recursive_call=False)¶
Recursively collect isotopes and their atomic fractions for a given material component.
This function handles components defined as isotopes, elements, or compounds in pyg4ometry. For isotopes, it directly adds the ZAID and atomic fraction to the isotopes dictionary (used as pid in SaG4n). For elements, it looks up the natural isotope abundances using the NIST registry. For compounds, it recursively processes the sub-components.
- revertex.utils.expand_regex(inputs, patterns)¶
Get a list of detectors from regex
This matches any wildcars with * or ? in the patterns.
- revertex.utils.find_mother_physical_volumes(pv, registry)¶
Find the mother physical volumes.
- Parameters:
pv (PhysicalVolume)
registry (Registry)
- Return type:
list[PhysicalVolume]
- revertex.utils.get_borehole_volume(hpge, size=1000000)¶
Estimate the borehole volume (with MC)
- Parameters:
hpge (pygeomhpges.HPGe)
- revertex.utils.get_borehole_weights(hpges)¶
Get a weighting for each hpge in the hpges based on borehole volume
- revertex.utils.get_hpges(reg, detectors)¶
Extract the objects for each HPGe detector in reg and in the list of detectors
- revertex.utils.get_surface_indices(hpge, surface_type)¶
Get which surface index corresponds to the desired surface type
- revertex.utils.get_surface_weights(hpges, surface_type)¶
Get a weighting for each hpge in the hpges based on surface area for a given surface_type
- revertex.utils.read_input_beta_csv(path, **kwargs)¶
Reads a CSV file into numpy arrays.
The file should have the following format:
energy_1, phase_space_1 energy_2, phase_space_2 energy_3, phase_space_3