mirror of
https://github.com/pim-n/pg-rad
synced 2026-06-17 15:59:35 +02:00
add bkg count option in input
This commit is contained in:
@ -109,6 +109,7 @@ def calculate_counts_along_path(
|
||||
detector: "Detector",
|
||||
velocity: float,
|
||||
points_per_segment: int = 10,
|
||||
bkg_cps_input: int | None = None
|
||||
) -> Tuple[np.ndarray, np.ndarray]:
|
||||
"""Compute the counts recorded in each acquisition period in the landscape.
|
||||
|
||||
@ -116,6 +117,7 @@ def calculate_counts_along_path(
|
||||
landscape (Landscape): _description_
|
||||
detector (Detector): _description_
|
||||
points_per_segment (int, optional): _description_. Defaults to 100.
|
||||
bkg_cps_input (int | None, optional): Optional background CPS.
|
||||
|
||||
Returns:
|
||||
Tuple[np.ndarray, np.ndarray]: Array of acquisition points and
|
||||
@ -148,9 +150,17 @@ def calculate_counts_along_path(
|
||||
landscape, full_positions, detector
|
||||
)
|
||||
|
||||
bkg = generate_background(
|
||||
cps, detector, landscape.point_sources[0].isotope.E
|
||||
)
|
||||
if bkg_cps_input is None:
|
||||
bkg = generate_background(
|
||||
cps, detector, landscape.point_sources[0].isotope.E
|
||||
)
|
||||
elif bkg_cps_input == 0:
|
||||
bkg = bkg_cps_input
|
||||
else:
|
||||
bkg = generate_background(
|
||||
cps, detector, landscape.point_sources[0].isotope.E,
|
||||
lam_inp=bkg_cps_input
|
||||
)
|
||||
|
||||
cps_with_bg = cps + bkg
|
||||
# reshape so each segment is on a row
|
||||
|
||||
Reference in New Issue
Block a user