Skip to content

Commit

Permalink
V271 bugfixes (#4972)
Browse files Browse the repository at this point in the history
* Fix a couple of output/upload value issues in pycbc live (#4953)

* get singles back to being reduced chisquared in uploads

* Save ranking statistic information in the "likelihood" part of the coinc table

* Not all CandidateForGraceDB will have stat in the coinc_results

* Fix bug where single detector event fit_threshold was being read from wrong location (#4971)

* Minor increment to version number

---------

Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
  • Loading branch information
maxtrevor and GarethCabournDavies authored Dec 5, 2024
1 parent 3be4869 commit e2ad984
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 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
5 changes: 3 additions & 2 deletions pycbc/events/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def check(self, trigs, data_reader):

# fill in a new candidate event
candidate = {
f'foreground/{self.ifo}/{k}': cutall_trigs[k][i] for k in trigs
f'foreground/{self.ifo}/{k}': cut_trigs[k][sngl_idx][i]
for k in trigs
}
candidate['foreground/stat'] = rank[i]
candidate['foreground/ifar'] = ifar
Expand All @@ -319,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
5 changes: 4 additions & 1 deletion pycbc/io/gracedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def __init__(self, coinc_ifos, ifos, coinc_results, **kwargs):
coinc_event_row.time_slide_id = lsctables.TimeSlideID(0)
coinc_event_row.process_id = proc_id
coinc_event_row.coinc_event_id = coinc_id
coinc_event_row.likelihood = 0.
if 'foreground/stat' in coinc_results:
coinc_event_row.likelihood = coinc_results['foreground/stat']
else:
coinc_event_row.likelihood = 0.
coinc_event_table.append(coinc_event_row)
outdoc.childNodes[0].appendChild(coinc_event_table)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __getattr__(self, attr):
vinfo = _version_helper.generate_git_version_info()
except:
vinfo = vdummy()
vinfo.version = '2.7.0'
vinfo.version = '2.7.1'
vinfo.release = 'True'

version_script = f"""# coding: utf-8
Expand Down

0 comments on commit e2ad984

Please sign in to comment.