From efa97115de25141c9fa550435f73062354e2f673 Mon Sep 17 00:00:00 2001 From: Daniel Williams Date: Mon, 24 Aug 2020 13:48:56 +0100 Subject: [PATCH] Updated the sources object to allow epoch selection. --- minke/sources.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/minke/sources.py b/minke/sources.py index c10de1b..4872018 100644 --- a/minke/sources.py +++ b/minke/sources.py @@ -546,7 +546,7 @@ def _make_strain(self, sample_rate=16384): return output - def _generate(self, rate=16384.0, half=False, tail = True): + def _generate(self, epoch="0.0", rate=16384.0, half=False, tail = True): """ Generate the burst described in a given row, so that it can be measured. @@ -562,6 +562,11 @@ def _generate(self, rate=16384.0, half=False, tail = True): these are only required if you need to compute the cross products. Defaults to False. + epoch : str + The signal injection epoch. + This should be given as a string, which will then be + split at the decimal to preserve precision. + Returns ------- hp : @@ -574,10 +579,13 @@ def _generate(self, rate=16384.0, half=False, tail = True): A copy of the strain in the x polarisation """ + epoch_sec, epoch_ms = list(map(int, epoch.split("."))) + + data = self._make_strain(rate) nsamp = len(data) - hp = lal.CreateREAL8TimeSeries("inj time series", lal.LIGOTimeGPS(0,0), 0, 1.0/rate, lal.StrainUnit, nsamp) - hx = lal.CreateREAL8TimeSeries("inj time series", lal.LIGOTimeGPS(0,0), 0, 1.0/rate, lal.StrainUnit, nsamp) + hp = lal.CreateREAL8TimeSeries("inj time series", lal.LIGOTimeGPS(epoch_sec,epoch_ms), 0, 1.0/rate, lal.StrainUnit, nsamp) + hx = lal.CreateREAL8TimeSeries("inj time series", lal.LIGOTimeGPS(epoch_sec,epoch_ms), 0, 1.0/rate, lal.StrainUnit, nsamp) hp.data.data = data[:,1] hx.data.data = data[:,2]