Skip to content

Commit

Permalink
Fix sum in total rate calc
Browse files Browse the repository at this point in the history
  • Loading branch information
oashour committed May 6, 2024
1 parent 0bd2f08 commit 464d876
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions darkmagic/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ def compute_daily_modulation(
self.numerics._threshold / energy_bin_width
)

day_averaged_rate = np.mean(self.diff_rate[:t_idx, ...], axis=0)
# Sum the rate over the energy bins -> (time, mass) array
total_rate = np.sum(self.diff_rate[..., bin_cutoff:], axis=2)
# Average the rate over a full day -> (mass,) array
day_averaged_rate = np.mean(total_rate[:t_idx, ...], axis=0)
# Return normalized rate as a (time, mass) array
return np.sum(self.diff_rate[..., bin_cutoff], axis=1) / day_averaged_rate
return total_rate / day_averaged_rate

def compute_reach(
self,
Expand Down

0 comments on commit 464d876

Please sign in to comment.