Creating an injection set
This a command line tool for the generation of injection files for consumption by bilby_pipe. Injection files can be generated in a variety of formats, see below, and are generated from a bilby-style prior_file.
Available formats: A dat file consists of a space-separated list of parameters with a header; A json formatted file.
If a geocent_time prior is given in the file, this will be used to create the time prior. Otherwise, the trigger-time & deltaT or gps-time and deltaT options are used (see below).
As an example, this file specifies a prior for precessing black hole binary systems
mass_1 = Uniform(name='mass_1', minimum=10, maximum=80)
mass_2 = Uniform(name='mass_2', minimum=10, maximum=80)
mass_ratio = Constraint(name='mass_ratio', minimum=0.125, maximum=1)
a_1 = Uniform(name='a_1', minimum=0, maximum=0.99)
a_2 = Uniform(name='a_2', minimum=0, maximum=0.99)
tilt_1 = Sine(name='tilt_1')
tilt_2 = Sine(name='tilt_2')
phi_12 = Uniform(name='phi_12', minimum=0, maximum=2 * np.pi)
phi_jl = Uniform(name='phi_jl', minimum=0, maximum=2 * np.pi)
luminosity_distance = PowerLaw(alpha=2, name='luminosity_distance', minimum=50, maximum=2000)
dec = Cosine(name='dec')
ra = Uniform(name='ra', minimum=0, maximum=2 * np.pi)
theta_jn = Sine(name='theta_jn')
psi = Uniform(name='psi', minimum=0, maximum=np.pi)
phase = Uniform(name='phase', minimum=0, maximum=2 * np.pi)
Naming this file bbh.prior
and running
$ bilby_pipe_create_injection_file bbh.prior --n-injection 100 --generation-seed 1234 -f injections.json
Will produce a file injections.json
containing 100 random draws from the prior.
Command line interface for creating an injection set
This a command line tool for the generation of injection files for consumption by bilby_pipe. Injection files can be generated in a variety of formats, see below, and are generated from a bilby-style prior_file.
Available formats: A dat file consists of a space-separated list of parameters with a header; A json formatted file.
If a geocent_time prior is given in the file, this will be used to create the time prior. Otherwise, the trigger-time & deltaT or gps-time and deltaT options are used (see below).
As an example, this file specifies a prior for precessing black hole binary systems
mass_1 = Uniform(name='mass_1', minimum=10, maximum=80)
mass_2 = Uniform(name='mass_2', minimum=10, maximum=80)
mass_ratio = Constraint(name='mass_ratio', minimum=0.125, maximum=1)
a_1 = Uniform(name='a_1', minimum=0, maximum=0.99)
a_2 = Uniform(name='a_2', minimum=0, maximum=0.99)
tilt_1 = Sine(name='tilt_1')
tilt_2 = Sine(name='tilt_2')
phi_12 = Uniform(name='phi_12', minimum=0, maximum=2 * np.pi)
phi_jl = Uniform(name='phi_jl', minimum=0, maximum=2 * np.pi)
luminosity_distance = PowerLaw(alpha=2, name='luminosity_distance', minimum=50, maximum=2000)
dec = Cosine(name='dec')
ra = Uniform(name='ra', minimum=0, maximum=2 * np.pi)
theta_jn = Sine(name='theta_jn')
psi = Uniform(name='psi', minimum=0, maximum=np.pi)
phase = Uniform(name='phase', minimum=0, maximum=2 * np.pi)
Naming this file bbh.prior
and running
$ bilby_pipe_create_injection_file bbh.prior --n-injection 100 --generation-seed 1234 -f injections.json
Will produce a file injections.json
containing 100 random draws from the prior.
usage: fancytool [-h] [-f FILENAME] [-e {json,dat}] [-n N_INJECTION]
[-t TRIGGER_TIME] [-g GPS_FILE | --gps-tuple GPS_TUPLE]
[--deltaT DELTAT]
[--post-trigger-duration POST_TRIGGER_DURATION]
[--duration DURATION] [--minimum-frequency MINIMUM_FREQUENCY]
[-s GENERATION_SEED] [--default-prior DEFAULT_PRIOR]
[--enforce-signal-duration ENFORCE_SIGNAL_DURATION]
prior_file
Positional Arguments
- prior_file
The prior file from which to generate injections
Named Arguments
- -f, --filename
Default:
'injection'
- -e, --extension
Possible choices: json, dat
Prior file format
Default:
'dat'
- -n, --n-injection
The number of injections to generate: not required if –gps-file is also given
- -t, --trigger-time
The trigger time to use for setting a geocent_time prior (default=0). Ignored if a geocent_time prior exists in the prior_file or –gps-file is given.
Default:
0
- -g, --gps-file
File containing segment GPS start times. This can be a multi-column file if (a) it is comma-separated and (b) the zeroth column contains the gps-times to use
- --gps-tuple
Tuple of the (start, step, number) of GPS start times. For example, (10, 1, 3) produces the gps start times [10, 11, 12]. If given, gps-file is ignored.
- --deltaT
The symmetric width (in s) around the trigger time to search over the coalescence time. Ignored if a geocent_time prior exists in the prior_file
Default:
0.2
- --post-trigger-duration
The post trigger duration (default=2s), used only in conjunction with –gps-file
Default:
2
- --duration
The segment duration (default=4s), used only in conjunction with –gps-file
Default:
4
- --minimum-frequency
The minimum frequency, this is needed when enforce-signal-duration is true.
- -s, --generation-seed
Random seed used during data generation
- --default-prior
The name of the prior set to base the prior on. Can be one of[PriorDict, BBHPriorDict, BNSPriorDict, CalibrationPriorDict]
Default:
'BBHPriorDict'
- --enforce-signal-duration
Whether to require that all signals fit within the segment duration. The signal duration is calculated using a post-Newtonian approximation.
Default:
False