Skip to content

Commit

Permalink
Make sensitivity and missed-founf plots with eccentricity
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhooshan Gadre committed Jul 10, 2023
1 parent be2bf07 commit 91ef06b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bin/plotting/pycbc_page_foundmissed
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ labels={'mchirp': 'Chirp Mass',
'redshift': 'Redshift',
'time': 'Time (s)',
'effective_spin': 'Effective Inspiral Spin',
'eccentricity': 'Eccentricity'
}

parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--injection-file',
help="The hdf injection file to plot", required=True)
parser.add_argument('--axis-type', default='mchirp', choices=['mchirp',
'effective_spin', 'time', 'mtotal', 'mass_ratio'])
'effective_spin', 'time', 'mtotal', 'mass_ratio', 'eccentricity'])
parser.add_argument('--log-x', action='store_true', default=False)
parser.add_argument('--distance-type', default='decisive_optimal_snr',
choices=list(labels),
Expand Down Expand Up @@ -82,6 +83,7 @@ s1z = f['injections/spin1z'][:]
s2z = f['injections/spin2z'][:]
dist = f['injections/distance'][:]
m1, m2 = f['injections/mass1'][:], f['injections/mass2'][:]
ecc = f['injections/eccentricity'][:]

vals = {}
vals['mchirp'], eta = pycbc.pnutils.mass1_mass2_to_mchirp_eta(m1, m2)
Expand All @@ -91,7 +93,7 @@ vals['time'] = time
vals['mtotal'] = m1 + m2
# use convention that q>1
vals['mass_ratio'] = numpy.maximum(m1/m2, m2/m1)

vals['eccentricity'] = ecc
dvals = {}

if 'ifos' in f.attrs:
Expand Down
8 changes: 6 additions & 2 deletions bin/plotting/pycbc_page_sensitivity
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parser.add_argument('--output-file', required=True,
help='Destination file for the plot')
parser.add_argument('--bin-type', choices=['spin', 'mchirp', 'total_mass',
'max_mass', 'eta',
'template_duration'],
'template_duration', 'eccentricity'],
default='mchirp',
help="Parameter used to bin injections. Default 'mchirp'")
# FIXME: Make bins options properly optional, if no bins are specified then
Expand Down Expand Up @@ -134,6 +134,7 @@ for fi in args.injection_file:
# y-components not used but read them in for symmetry
s1y, s2y = f['injections/spin1y'][:], f['injections/spin2y'][:]
inc = f['injections/inclination'][:]
ecc = f['injections/eccentricity'][:]

mchirp = pycbc.pnutils.mass1_mass2_to_mchirp_eta(m1, m2)[0]
if args.bin_type == 'mchirp':
Expand All @@ -152,6 +153,8 @@ for fi in args.injection_file:
# Only valid/useful for non-spin or aligned-spin signals
pvals = pycbc.pnutils.get_imr_duration(m1, m2, s1z, s2z,
f_low=args.f_lower)
elif args.bin_type == 'eccentricity':
pvals = ecc
else:
raise RuntimeError('Unrecognized --bin-type value!')

Expand Down Expand Up @@ -194,7 +197,8 @@ labels = {
'total_mass' : "$ M_{\\rm total} \in [%5.2f, %5.2f] M_\odot $",
'max_mass' : "$ {\\rm max}(m_1, m_2) \in [%5.2f, %5.2f] M_\odot $",
'spin' : "$ \\chi_{\\rm eff} \in [%5.2f, %5.2f] $",
'template_duration' : "$ \\tau \in [%5.2f, %5.2f] s $"
'template_duration' : "$ \\tau \in [%5.2f, %5.2f] s $",
'eccentricity' : "$ e_0 \in [%5.2f, %5.2f] $",
}

ylabel = xlabel = ""
Expand Down

0 comments on commit 91ef06b

Please sign in to comment.