Skip to content
Snippets Groups Projects
Commit 9aa3a7c3 authored by Patrick Godwin's avatar Patrick Godwin
Browse files

bank.py, sensitivity.py, summary.py: fix syntax errors from refactor

parent dc522c7e
No related branches found
No related tags found
1 merge request!26Refactor plotting routines + remove unused functionality
......@@ -93,7 +93,7 @@ def create_plot(x_label = None, y_label = None, width = 165.0, aspect = golden_r
def set_logx_ticks(axis,ax_min,ax_max):
n = int(numpy.floor(math.log10(ax_max - ax_min)))
x_minor = MultipleLocator(10**n)
x_minor = MultipleLocator(10**n)
axis.xaxis.set_minor_locator(x_minor)
while len(axis.get_xticks(minor=True))<5:
n-=1
......@@ -107,7 +107,7 @@ def set_logx_ticks(axis,ax_min,ax_max):
def set_logy_ticks(axis,ax_min,ax_max):
n = int(numpy.floor(math.log10(ax_max - ax_min)))
x_minor = MultipleLocator(10**n)
x_minor = MultipleLocator(10**n)
axis.yaxis.set_minor_locator(x_minor)
while len(axis.get_yticks(minor=True))<5:
n-=1
......
......@@ -127,7 +127,7 @@ def plot_sensitivity_vs_far(volumes, fars, livetime, ifos, bins, bin_type):
tx.set_yticks(vol_tix)
tx.set_yscale("log")
tx.set_ylim(ax_far.get_ylim())
tx.set_yticklabels(["%.3g" % (vt_to_range(float(k), livetime[ifos]) for k in vol_tix])
tx.set_yticklabels(["%.3g" % (vt_to_range(float(k), livetime[ifos])) for k in vol_tix])
tx.set_ylabel("Range (Mpc)")
ax_far.set_title("%s Observing (%.2f days)" % ("".join(sorted(list(ifos))), livetime[ifos]*365.25))
......@@ -196,7 +196,7 @@ def plot_sensitivity_vs_snr(volumes, snrs, livetime, ifos, bins, bin_type):
tx.set_yticks(vol_tix)
tx.set_yscale("log")
tx.set_ylim(ax_snr.get_ylim())
tx.set_yticklabels(["%.3g" % (vt_to_range(float(k), livetime[ifos]) for k in vol_tix])
tx.set_yticklabels(["%.3g" % (vt_to_range(float(k), livetime[ifos])) for k in vol_tix])
tx.set_ylabel("Range (Mpc)")
ax_snr.set_title("%s Observing (%.2f days)" % ("".join(sorted(list(ifos))), livetime[ifos]*365.25))
......
......@@ -106,7 +106,7 @@ def sigma_region(mean, nsigma):
def plot_injection_param_dist(x, y, x_label, y_label, waveform, aspect=None):
fig, axes = create_plot(x_label, y_label)
waveform_name = waveform.replace("_", "\_")
axes.set_title(fr"$\textrm{Injection Parameter Distribution ({waveform_name} Injections)}$")
axes.set_title(fr"$\textrm{{Injection Parameter Distribution ({waveform_name} Injections)}}$")
mrkr, markersize = marker_and_size(len(x))
if markersize is not None:
axes.plot(x, y, mrkr, markersize=markersize)
......@@ -182,7 +182,7 @@ def plot_snr_chi2_background(ifo, min_snr, injections, background, zerolag=None)
return fig
def plot_param_background_multiifo(ifo1, ifo2, min_snr, name, symbol, injections, background, zerolag=None)
def plot_param_background_multiifo(ifo1, ifo2, min_snr, name, symbol, injections, background, zerolag=None):
fig, axes = create_plot(fr"{symbol} in {ifo1}", fr"{symbol} in {ifo2}", aspect = 1.0)
axes.grid(True, which = "both")
axes.loglog([x for x, y in injections], [y for x, y in injections], "rx", label = "Injections")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment