`trigger_time +/- deltaT/2` done in multiple locations
Summary
trigger_time +/- deltaT/2
is needed for
- Making sure trigger timed not the same for injections (see create_injections.py and data_generation.py)
- Making a prior for geocent time with some uncertainty in input.py
The same code is repeated in 3 places.
Additionally, it seems like trigger_time +/- deltaT/2
is being done multiple times for an injection (during the creation of the injection file, and during the data generation step). I think that this should only be done once, in the step when the injection file is being created.
What is the current bug behavior?
If user manually creates an injection file
with a geocenter time = 1241742478.5943394
, and passes a gps_start_time file
with a gps start time = 1241742476.607178
, the injection ends up having a geocent time = 1241742478.6802506
. I suspect that this was adjusted in data_generation.py.
`
What is the expected correct behavior?
If user manually creates an injection file
with a geocenter time = 1241742478.5943394
, and passes a gps_start_time file
with a gps start time = 1241742476.607178
, the injection should end up having a geocent time = 1241742478.5943394
. Ie the geocent time for the injection should match the geocent time in the injection file.
Possible fixes
I think that refactoring the repeated code into one location will help. Additionally, I think that the trigger time should not be adjusted in thedata_generation.py but only in the create_injections.py. This way, the injections will still have a geocenter_time with some uncertainty, and users can make their own injection.json
s where they specify exact geocenter_time
s. This also makes the logic easy to follow (there are no side-effects on the geocenter_time
once it is in bilby_pipe
).
Relevant logs
18:21 bilby_pipe WARNING : You do not have LDAStools.frameCPP (python-ldas-tools-framecpp) installed. You may experience problems accessing interferometer data.
18:21 bilby_pipe INFO : Running bilby_pipe version: 0.3.2: (CLEAN) af95e97 2019-11-12 14:18:03 -0800
18:21 bilby_pipe INFO : Running bilby: 0.5.9:
18:21 bilby_pipe INFO : Command line arguments: Namespace(accounting='ligo.dev.o3.cbc.pe.lalinference', calibration_model=None, channel_dict="{'H1':'GDS-CALIB_STRAIN_CLEAN', 'L1':'GDS-CALIB_STRAIN_CLEAN'}", cluster=None, coherence_test=True, create_plots=True, create_summary=False, data_dict=None, data_dump_file=None, data_format=None, default_prior='BBHPriorDict', deltaT=0.2, detectors=["'H1'", "'L1'"], distance_marginalization=True, distance_marginalization_lookup_table=None, duration=4.0, email='avi.vajpeyi@ligo.org', existing_dir=None, frequency_domain_source_model='lal_binary_black_hole', gaussian_noise=False, generation_seed=None, gps_file='gps_start_time.txt', idx=113, ignore_gwpy_data_quality_check=True, ini='bcr_injections.ini', injection=True, injection_file='injection_parameters.json', injection_waveform_approximant='SEOBNRv4', jitter_time=True, label='injection_data113_1242253970-960449_generation', likelihood_type='GravitationalWaveTransient', local=False, local_generation=False, local_plot=False, maximum_frequency='1024.0', minimum_frequency='12.0', n_parallel=1, n_simulation=0, online_pe=False, osg=False, outdir='outdir_injection', periodic_restart_time=43200, phase_marginalization=True, post_trigger_duration=2.0, postprocessing_arguments=None, postprocessing_executable=None, prior_file='454ms.prior', process=None, psd_dict=None, psd_fractional_overlap=0.5, psd_length=32, psd_maximum_duration=1024, psd_method='median', psd_start_time=None, reference_frequency=20.0, request_cpus=1, request_memory=4, request_memory_generation=None, roq_folder=None, roq_scale_factor=1, sampler='dynesty', sampler_kwargs='Default', sampling_frequency=4096, sampling_seed=None, scheduler='condor', scheduler_args=None, scheduler_env=None, scheduler_module=None, singularity_image=None, spline_calibration_amplitude_uncertainty_dict=None, spline_calibration_envelope_dict=None, spline_calibration_nodes=5, spline_calibration_phase_uncertainty_dict=None, submit=True, time_marginalization=True, timeslide_file=None, transfer_files=True, trigger_time=1242253970.960449, tukey_roll_off=0.4, verbose=False, waveform_approximant='IMRPhenomPv2', webdir=None, zero_noise=False)
18:21 bilby_pipe INFO : Unknown command line arguments: []
18:21 bilby_pipe INFO : Setting prior-file to 454ms.prior
18:21 bilby_pipe INFO : Setting segment duration 4.0s
18:21 bilby_pipe INFO : PSD duration set to 128.0s, 32x the duration 4.0s
18:21 bilby_pipe INFO : No calibration_model model provided, calibration marginalization will not be used
18:21 bilby_pipe INFO : Getting analysis-segment data for H1
18:21 bilby_pipe INFO : Calling TimeSeries.get('H1:GDS-CALIB_STRAIN_CLEAN', start=1242253968.960449, end=1242253972.960449, dtype='float64')
18:21 bilby_pipe INFO : Resampling data to sampling_frequency 4096
18:21 bilby_pipe INFO : Using the lal_binary_black_hole source model
18:21 bilby_pipe INFO : Injecting with SEOBNRv4
18:21 bilby INFO : Generating frequency domain strain from given time domain strain.
18:21 bilby INFO : Applying a tukey window with alpha=0.1, roll off=0.2
18:21 bilby INFO : Injected signal in H1:
18:21 bilby INFO : optimal SNR = 21.10
18:21 bilby INFO : matched filter SNR = -0.68-4.86j
18:21 bilby INFO : mass_1 = 35.999610900878906
18:21 bilby INFO : mass_2 = 97.15486907958984
18:21 bilby INFO : geocent_time = 1242253971.0524628
18:21 bilby INFO : chi_1 = 0.46374988555908203
18:21 bilby INFO : chi_2 = 0.18003660440444946
18:21 bilby INFO : luminosity_distance = 864.848876953125
18:21 bilby INFO : theta_jn = 0.5491207838058472
18:21 bilby INFO : psi = 2.5638349056243896
18:21 bilby INFO : phase = 5.063776969909668
18:21 bilby INFO : ra = 5.8984131813049325
18:21 bilby INFO : dec = 0.3126296103000641
18:21 bilby_pipe INFO : Setting PSD for H1 from data
18:21 bilby_pipe INFO : Using default PSD start time -128.0 relative to start time
18:21 bilby_pipe INFO : Getting psd-segment data for H1
18:21 bilby_pipe INFO : Calling TimeSeries.get('H1:GDS-CALIB_STRAIN_CLEAN', start=1242253840.960449, end=1242253968.960449, dtype='float64')
18:21 bilby_pipe INFO : Resampling data to sampling_frequency 4096
18:21 bilby_pipe INFO : PSD settings: window=Tukey, Tukey-alpha=0.2 roll-off=0.4, overlap=2.0, method=median
18:22 bilby_pipe INFO : Getting analysis-segment data for L1
18:22 bilby_pipe INFO : Calling TimeSeries.get('L1:GDS-CALIB_STRAIN_CLEAN', start=1242253968.960449, end=1242253972.960449, dtype='float64')
18:22 bilby_pipe INFO : Resampling data to sampling_frequency 4096
18:22 bilby_pipe INFO : Using the lal_binary_black_hole source model
18:22 bilby_pipe INFO : Injecting with SEOBNRv4
18:22 bilby INFO : Generating frequency domain strain from given time domain strain.
18:22 bilby INFO : Applying a tukey window with alpha=0.1, roll off=0.2
18:22 bilby INFO : Injected signal in L1:
18:22 bilby INFO : optimal SNR = 33.83
18:22 bilby INFO : matched filter SNR = -2.32-0.06j
18:22 bilby INFO : mass_1 = 35.999610900878906
18:22 bilby INFO : mass_2 = 97.15486907958984
18:22 bilby INFO : geocent_time = 1242253971.0524628
18:22 bilby INFO : chi_1 = 0.46374988555908203
18:22 bilby INFO : chi_2 = 0.18003660440444946
18:22 bilby INFO : luminosity_distance = 864.848876953125
18:22 bilby INFO : theta_jn = 0.5491207838058472
18:22 bilby INFO : psi = 2.5638349056243896
18:22 bilby INFO : phase = 5.063776969909668
18:22 bilby INFO : ra = 5.8984131813049325
18:22 bilby INFO : dec = 0.3126296103000641
18:22 bilby_pipe INFO : Setting PSD for L1 from data
18:22 bilby_pipe INFO : Using default PSD start time -128.0 relative to start time
18:22 bilby_pipe INFO : Getting psd-segment data for L1
18:22 bilby_pipe INFO : Calling TimeSeries.get('L1:GDS-CALIB_STRAIN_CLEAN', start=1242253840.960449, end=1242253968.960449, dtype='float64')
18:22 bilby_pipe INFO : Resampling data to sampling_frequency 4096
18:22 bilby_pipe INFO : PSD settings: window=Tukey, Tukey-alpha=0.2 roll-off=0.4, overlap=2.0, method=median
18:22 bilby INFO : Generating frequency domain strain from given time domain strain.
18:22 bilby INFO : Applying a tukey window with alpha=0.2, roll off=0.4
18:22 bilby INFO : Generating frequency domain strain from given time domain strain.
18:22 bilby INFO : Applying a tukey window with alpha=0.2, roll off=0.4
/home/avi.vajpeyi/.local/lib/python3.7/site-packages/bilby/gw/prior.py:234: RuntimeWarning: divide by zero encountered in true_divide
z_prior.prob(x / aas)), aas) for x in xx]
/home/avi.vajpeyi/.local/lib/python3.7/site-packages/bilby/gw/prior.py:234: RuntimeWarning: invalid value encountered in multiply
z_prior.prob(x / aas)), aas) for x in xx]
18:22 bilby_pipe INFO : Setting geocent time prior using trigger-time=1242253970.960449 and deltaT=0.2
18:22 bilby_pipe INFO : Using the lal_binary_black_hole source model
18:22 bilby INFO : Loaded distance marginalisation lookup table from .distance_marginalization_lookup.npz.
18:22 bilby_pipe INFO : Completed data generation