Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to supervise template fitting in pycbc live #4813

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
68d4445
Move code which will be shared into a module
GarethCabournDavies Apr 12, 2024
eda06a4
getting more things ready for the trigger fits / dq supervision
GarethCabournDavies May 1, 2024
7acabd5
start work on fit_by, fit_over and DQ trigger supervision
GarethCabournDavies May 3, 2024
28d06f9
some work - bring in latest trigger file finding
GarethCabournDavies May 21, 2024
fb67a75
updates to use latest trigger file finding
GarethCabournDavies May 21, 2024
0aa5005
pass cuts through to the collation script
GarethCabournDavies May 21, 2024
e7460ac
symlink fit_over_multiparam output to variable file
GarethCabournDavies May 22, 2024
c7a8ed2
remove unused imports, argument ordering, plot titles
GarethCabournDavies Jul 12, 2024
de7980a
CC
GarethCabournDavies Jul 12, 2024
3ab0038
Fix docstring, formatting
GarethCabournDavies Jul 12, 2024
1478465
Move the trigger collatiojn/fitting superviosor to use configparsert
GarethCabournDavies Jul 15, 2024
8b147b3
start moving significance fit supervision to configparser
GarethCabournDavies Jul 15, 2024
91be603
Start puttinf template fits into supervision code shared with signifi…
GarethCabournDavies Jul 16, 2024
4805ef1
Deal properly with whene there are no trigers, so we can't calculate …
GarethCabournDavies Jul 19, 2024
7e272cf
Remove no-longer-valid efficiency savings
GarethCabournDavies Jul 19, 2024
3257b0f
Some minor fixes for when sending mail from supervision
GarethCabournDavies Jul 19, 2024
9e55544
Mve to a single supervision file for both trigger and significance fits
GarethCabournDavies Jul 19, 2024
74d3692
Remove FIXMEs
GarethCabournDavies Jul 19, 2024
e79e401
Use check=True with subprocess.run
GarethCabournDavies Jul 19, 2024
2057ac8
Remove function checking fit coefficients - it is now unclear what th…
GarethCabournDavies Jul 19, 2024
575a4ae
Fix minor bug
GarethCabournDavies Jul 19, 2024
085996e
typo
GarethCabournDavies Jul 19, 2024
6b55789
Some minor fixes and TDC comments
GarethCabournDavies Jul 23, 2024
46b7096
CC
GarethCabournDavies Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/all_sky_search/pycbc_fit_sngls_by_template
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ sigma_regions = trigf[args.ifo + '/sigmasq_template'][:]
median_sigma = []
for reg in sigma_regions:
strigs = trigf[args.ifo + '/sigmasq'][reg]
if len(strigs) == 0:
median_sigma.append(np.nan)
continue
median_sigma.append(np.median(strigs) ** 0.5)

outfile = HFile(args.output, 'w')
Expand Down
10 changes: 8 additions & 2 deletions bin/all_sky_search/pycbc_fit_sngls_over_multiparam
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,20 @@ if len(args.template_fit_file) > 1:
nasum = nabove[tidsort].cumsum()
invsum = invalphan[tidsort].cumsum()
ntsum = ntotal[tidsort].cumsum()
mssum = median_sigma[tidsort].cumsum()
num = right - left

tid = tid_unique
nabove = (nasum[right] - nasum[left]) / num
invalphan = (invsum[right] - invsum[left]) / num
ntotal = (ntsum[right] - ntsum[left]) / num
median_sigma = (mssum[right] - mssum[left]) / num
if median_sigma is not None:
# Median sigma is a special one - we need to make sure that
# we do not mess things up when nan values are given, so we
# can't use the special cumsum fast option
median_sigma = [
numpy.nanmean(median_sigma[tidsort[l:r]])
for l, r in zip(left, right)
]

if args.output_fits_by_template:
# Store fit_by_template values for output file
Expand Down
4 changes: 2 additions & 2 deletions bin/live/pycbc_live_plot_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ for ifo in all_ifos:
continue

# Keep track of some maxima for use in setting the plot limits
maxstat = stats[ifo].max()
maxstat = np.nanmax(stats[ifo])
max_rate = 0

statrange = maxstat - max(stats[ifo].min(), fit_threshold[ifo])
statrange = maxstat - max(np.nanmin(stats[ifo]), fit_threshold[ifo])
plotmax = maxstat + statrange * 0.05

plotbins = np.linspace(fit_threshold[ifo], plotmax, 400)
Expand Down
7 changes: 0 additions & 7 deletions bin/live/pycbc_live_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ args.trigger_cuts = args.trigger_cuts or []
args.trigger_cuts.append(f"end_time:{args.gps_start_time}:lower_inc")
args.trigger_cuts.append(f"end_time:{args.gps_end_time}:upper_inc")

# Efficiency saving: add SNR cut before any others as sngl_ranking can
# only be less than SNR.
args.trigger_cuts.insert(0, f"snr:{args.fit_threshold}:lower_inc")

# Cut triggers with sngl-ranking below threshold
args.trigger_cuts.append(f"{args.sngl_ranking}:{args.fit_threshold}:lower_inc")

trigger_cut_dict, template_cut_dict = cuts.ingest_cuts_option_group(args)

logging.info("Setting up duration bins")
Expand Down
Loading
Loading