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')¶
Converts the vertices to the correct output format for kin information.
This follows the convention defined by remage
- 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.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.core.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.core.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.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.utils module¶
- revertex.utils._get_position(pv_name, reg)¶
Get the global position of a physical volume from the GDML
- 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:
- 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