Skip to content

Commit

Permalink
Updated the sources object to allow epoch selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
transientlunatic committed Aug 24, 2020
1 parent d4f0b3c commit efa9711
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions minke/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 :
Expand All @@ -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]

Expand Down

0 comments on commit efa9711

Please sign in to comment.