From e7d948345fd50495ade2371fd1872575a63250f8 Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Thu, 13 Apr 2017 21:33:35 +0200 Subject: [PATCH] Adds individual detector contributions to the cumulative Fstat --- pyfstat/core.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyfstat/core.py b/pyfstat/core.py index e4f3a1a..2c087ae 100755 --- a/pyfstat/core.py +++ b/pyfstat/core.py @@ -484,11 +484,18 @@ class ComputeFstat(object): def plot_twoF_cumulative(self, label, outdir, ax=None, c='k', savefig=True, title=None, **kwargs): - - taus, twoFs = self.calculate_twoF_cumulative(**kwargs) if ax is None: fig, ax = plt.subplots() - ax.plot(taus/86400., twoFs, label=label, color=c) + + taus, twoFs = self.calculate_twoF_cumulative(**kwargs) + ax.plot(taus/86400., twoFs, label='All detectors', color=c) + if len(self.detector_names) > 1: + for d in self.detector_names: + self.detectors = d + self.init_computefstatistic_single_point() + taus, twoFs = self.calculate_twoF_cumulative(**kwargs) + ax.plot(taus/86400., twoFs, label='{}'.format(d)) + ax.set_xlabel(r'Days from $t_{{\rm start}}={:.0f}$'.format( kwargs['tstart'])) if self.BSGL: @@ -496,6 +503,7 @@ class ComputeFstat(object): else: ax.set_ylabel(r'$\widetilde{2\mathcal{F}}_{\rm cumulative}$') ax.set_xlim(0, taus[-1]/86400) + ax.legend(frameon=False) if title: ax.set_title(title) if savefig: -- GitLab