Skip to content

Commit

Permalink
Added a patch to ensure that the same seed is used to generate the wa…
Browse files Browse the repository at this point in the history
…veform for each detector (hence ensuring that the same waveform is used)
  • Loading branch information
transientlunatic committed Sep 18, 2018
1 parent f46a848 commit ae4b5e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion minke/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import os.path

from scipy import random

import lal
import lalburst
Expand Down Expand Up @@ -530,7 +531,10 @@ def _generate(self, rate=16384.0, half=False, distance=None, tail = True):
hp0, hx0 = lalburst.GenerateSimBurst(burstobj, 1.0/rate)
else:
hp0, hx0 = hp, hx



random.seed(0)

# detrend supernova waveforms
if hasattr(self, "supernova"):
hp.data.data, hx.data.data, hp0.data.data, hx0.data.data = scipy.signal.detrend(hp.data.data), scipy.signal.detrend(hx.data.data), scipy.signal.detrend(hp0.data.data), scipy.signal.detrend(hx0.data.data)
Expand Down

0 comments on commit ae4b5e4

Please sign in to comment.