Commit fc29809b authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Resolve "Injecting into Gaussian noise at specific GPS times not working"

parent 153b0473
......@@ -16,8 +16,10 @@ from .overview import create_overview
def get_trigger_time_list(inputs):
""" Returns a list of GPS trigger times for each data segment """
if inputs.gaussian_noise:
if inputs.gaussian_noise and inputs.trigger_time is None:
trigger_times = [0] * inputs.n_simulation
elif inputs.gaussian_noise and isinstance(inputs.trigger_time, float):
trigger_times = [inputs.trigger_time] * inputs.n_simulation
elif inputs.trigger_time is not None:
trigger_times = [inputs.trigger_time]
elif inputs.gps_tuple is not None:
......
......@@ -176,6 +176,19 @@ class TestMainInput(unittest.TestCase):
B = start_times + inputs.duration - inputs.post_trigger_duration
self.assertTrue(np.all(A == B))
def test_get_trigger_time_list_with_gaussian_noise_and_trigger_time(self):
args = self.args
args.trigger_time = 10
args.gaussian_noise = True
inputs = bilby_pipe.main.MainInput(self.args, self.unknown_args_list)
self.assertEqual(
bilby_pipe.job_creation.bilby_pipe_dag_creator.get_trigger_time_list(
inputs
),
[args.trigger_time],
)
def test_get_trigger_time_list_gaussian_noise(self):
inputs = bilby_pipe.main.MainInput(self.args, self.unknown_args_list)
......
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