Commit c8d901d5 authored by Colm Talbot's avatar Colm Talbot

Merge branch 'add-event-trigger-times' into 'master'

Add a trigger-time method based on event names

See merge request lscsoft/bilby_pipe!333
parents 22dfaea2 c743ee3e
......@@ -428,14 +428,6 @@ class DataGenerationInput(Input):
self._sampling_frequency = sampling_frequency
def trigger_time(self):
return self._trigger_time
def trigger_time(self, trigger_time):
self._trigger_time = trigger_time
def _set_interferometers_from_gaussian_noise(self):
""" Method to generate the interferometers data from Gaussian noise """
......@@ -10,6 +10,7 @@ from importlib import import_module
import numpy as np
import pandas as pd
from gwosc.datasets import event_gps
import bilby
......@@ -393,6 +394,18 @@ class Input(object):
def trigger_time(self, trigger_time):
# Convert trigger time
if trigger_time is None:
logger.debug("No trigger time given")
elif isinstance(trigger_time, str) and "GW" in trigger_time:
"Using gwosc to find trigger time for event {}".format(trigger_time)
trigger_time = event_gps(trigger_time)
trigger_time = float(trigger_time)
self._trigger_time = trigger_time
if trigger_time is not None:"Setting trigger time {}".format(trigger_time))
......@@ -185,7 +185,14 @@ def create_parser(top_level=True):
"--trigger-time", default=None, type=nonefloat, help="The trigger time"
"Either a GPS trigger time, or the event name (e.g. GW150914). "
"For event names, the gwosc package is used to identify the "
"trigger time"
accounting =
trigger-time = 1126259462.4
trigger-time = GW150914
label = GW150914
outdir = outdir_GW150914
detectors = [H1, L1]
......@@ -93,6 +93,7 @@ setup(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment