Skip to content

Commit

Permalink
Merge pull request #51 from LIBRA-project/patch-window-avg
Browse files Browse the repository at this point in the history
Bugfix wrong array for avg count rate calculation
  • Loading branch information
RemDelaporteMathurin authored Feb 5, 2025
2 parents 981e592 + 0462645 commit ae43b7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libra_toolbox/neutron_detection/diamond/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def get_avg_rate(self, t_min: float, t_max: float, energy_window: tuple = None):
time_values = time_values[peak_mask]

# Create mask to only count pulses of any energy in section time window
idx = np.logical_and(self.time_values > t_min, self.time_values < t_max)
idx = np.logical_and(time_values > t_min, time_values < t_max)

counts = len(self.time_values[idx])
error = np.sqrt(len(self.time_values[idx]))
counts = len(time_values[idx])
error = np.sqrt(len(time_values[idx]))
delta_t = t_max - t_min
count_rate = counts / delta_t
count_rate_err = error / delta_t
Expand Down

0 comments on commit ae43b7e

Please sign in to comment.