Skip to content

Commit

Permalink
Add single-detector options into workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jun 1, 2023
1 parent 258e63c commit 78e1c46
Show file tree
Hide file tree
Showing 22 changed files with 162 additions and 1,650 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/sngls-search-workflow.yml

This file was deleted.

24 changes: 12 additions & 12 deletions bin/minifollowups/pycbc_page_coincinfo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
""" Make tables describing a coincident foreground event"""
""" Make tables describing a foreground event"""

import h5py, argparse, logging, sys
import matplotlib; matplotlib.use('Agg')
Expand All @@ -33,7 +33,7 @@ parser.add_argument('--bank-file',
help="HDF format template bank file")
parser.add_argument('--output-file')
parser.add_argument('--statmap-file', required=True,
help="HDF format clustered coincident statmap file containing the result "
help="HDF format clustered statmap file containing the result "
"triggers. Required")
parser.add_argument('--statmap-file-subspace-name', default='background_exc',
help="If given look in this 'sub-directory' of the HDF file for triggers, "
Expand Down Expand Up @@ -71,27 +71,27 @@ if args.n_loudest is not None:
if args.sort_order == 'descending':
sorting = sorting[::-1]
n = sorting[args.n_loudest]
title = 'Parameters of coincident event ranked %s' % (args.n_loudest + 1)
title = 'Parameters of event ranked %s' % (args.n_loudest + 1)
caption = ('Parameters of event ranked %s by %s %s in the search. The figures below'
' show the mini-followup data for this event.' %
(args.n_loudest + 1, args.sort_order, args.sort_variable))
elif args.trigger_id is not None:
n = args.trigger_id
title = 'Details of coincident trigger'
caption = ('Parameters of coincident event. The figures below show the '
title = 'Details of trigger'
caption = ('Parameters of event. The figures below show the '
'mini-followup data for this event.')
else:
# It shouldn't be possible to get here!
raise ValueError()

# Make a table for the coincident information #################################
# Make a table for the event information #################################

hdrs = ["Coincident ranking statistic",
"Inclusive IFAR (yr)",
"Inclusive FAP",
"Exclusive IFAR (yr)",
"Exclusive FAP"
]
hdrs = ["Ranking statistic",
"Inclusive IFAR (yr)",
"Inclusive FAP",
"Exclusive IFAR (yr)",
"Exclusive FAP"
]

dsets = ['stat', 'ifar', 'fap', 'ifar_exc', 'fap_exc']
formats = ['%5.2f', '%5.2f', '%5.2e', '%5.2f', '%5.2e']
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_page_ifar
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ fig = pylab.figure(1)

# get a unique list of timeslide_ids and loop over them
interval = fp.attrs['timeslide_interval']
pifo, fifo = fp.attrs['pivot'], fp.attrs['fixed']
ifo_joined = fp.attrs['ifos'].replace(' ','')
p_starts = fp['segments'][ifo_joined]['start'][:]
p_ends = fp['segments'][ifo_joined]['end'][:]
Expand Down
12 changes: 5 additions & 7 deletions bin/plotting/pycbc_plot_singles_vs_params
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,17 @@ if opts.log_x:
hexbin_style['xscale'] = 'log'
if opts.log_y:
hexbin_style['yscale'] = 'log'
if opts.min_z is not None:
hexbin_style['vmin'] = opts.min_z
if opts.max_z is not None:
hexbin_style['vmax'] = opts.max_z
minz = opts.min_z if opts.min_z else 1
maxz = opts.max_z
hexbin_style['norm'] = LogNorm(vmin=minz, vmax=maxz)

logging.info('Plotting')
fig = pl.figure()
ax = fig.gca()


if opts.z_var == 'density':
norm = LogNorm()
hb = ax.hexbin(x, y, norm=norm, vmin=1, **hexbin_style)
hb = ax.hexbin(x, y, **hexbin_style)
fig.colorbar(hb, ticks=LogLocator(subs=range(10)))
elif opts.z_var in ranking.sngls_ranking_function_dict:
cb_style = {}
Expand All @@ -137,7 +136,6 @@ elif opts.z_var in ranking.sngls_ranking_function_dict:
min_z = z.min() if opts.min_z is None else opts.min_z
max_z = z.max() if opts.max_z is None else opts.max_z
if max_z / min_z > 10:
hexbin_style['norm'] = LogNorm()
cb_style['ticks'] = LogLocator(subs=range(10))
hb = ax.hexbin(x, y, C=z, reduce_C_function=max, **hexbin_style)
fig.colorbar(hb, **cb_style)
Expand Down
Loading

0 comments on commit 78e1c46

Please sign in to comment.