Skip to content

Commit

Permalink
Fix bug where single detector event fit_threshold was being read from…
Browse files Browse the repository at this point in the history
… wrong location (#4971)
  • Loading branch information
maxtrevor authored Dec 5, 2024
1 parent 59864d3 commit 10e7e09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/live/make_singles_significance_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# Set attributes to be something appropriate
f.attrs['start_date'] = 0
f.attrs['end_date'] = n_days
f.attrs['fit_threshold'] = 6.5

f['bins_edges'] = np.logspace(np.log10(min_duration),
np.log10(max_duration),
Expand All @@ -35,6 +34,7 @@
ifo_group.attrs['live_time'] = np.round(n_days * 0.7 * 86400.)
ifo_group.attrs['mean_alpha'] = alpha
ifo_group.attrs['total_counts'] = daily_counts_per_bin * n_days * n_bins
ifo_group.attrs['fit_threshold'] = 6.5

# Make daily fits datasets, this doesn't atually matter for the test, but
# means that the file format matches in case of future requirements
Expand Down
2 changes: 1 addition & 1 deletion pycbc/events/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def calculate_ifar(self, sngl_ranking, duration):
with HFile(self.fit_file, 'r') as fit_file:
bin_edges = fit_file['bins_edges'][:]
live_time = fit_file[self.ifo].attrs['live_time']
thresh = fit_file.attrs['fit_threshold']
thresh = fit_file[self.ifo].attrs['fit_threshold']
dist_grp = fit_file[self.ifo][self.sngl_ifar_est_dist]
rates = dist_grp['counts'][:] / live_time
coeffs = dist_grp['fit_coeff'][:]
Expand Down

0 comments on commit 10e7e09

Please sign in to comment.