Simulated signal from xml file

BayesWave can inject simulated signals from an XML file in the LIGO-specific LIGO_LW format.

Example 1: Making an XML file and injecting into simulated noise

This example shows how to make an XML file using LALApps tools, and how run BayesWave on the simulated signals in the XML file using simulated detector noise.

Making an XML file

Here we show one example of how to make an XML file that contains parameters for simulated binary black hole signals. This example uses the inspinj tool from LALApps. For more information, see LALApps documentation here.

The following example bash script will produce a file called equalMass35Msun-injections.xml, which contains paramters for 10 injections of binary black holes with equal component masses of 35M. There is no spin, and the waveform approximant used is IMRPhenomDtwoPointFivePN. The exact SNRs of the injections depends on the noise realisation used, but it should be somewhere in the neighborhood of 10-35.

#!/bin/bash


############################################################
# Example script to make CBC xml injections.
# This script produces injections for a 35-35Msun system.
############################################################

seed=1234
gpsstart=1254458039
gpsend=1254458139
fixmass=35
outfile=equalMass35Msun-injections.xml

lalapps_inspinj \
    --seed ${seed} --f-lower 20 --gps-start-time ${gpsstart} \
    --gps-end-time ${gpsend} \
    --amp-order 0 --waveform IMRPhenomDtwoPointFivePN \
    --time-step 10 --l-distr random \
    --i-distr uniform --disable-spin \
    --m-distr fixMasses --fixed-mass1 ${fixmass} \
    --fixed-mass2 ${fixmass} \
    --output ${outfile} \
    --snr-distr volume \
    --min-snr 10 --max-snr 35 \
    --ligo-fake-psd LALAdLIGO \
    --virgo-fake-psd LALAdVirgo \
    --ligo-start-freq 16 \
    --virgo-start-freq 16 \
    --ifos H1,L1 --verbose

Download bash script

Config file

This .ini file is for a run into gaussian detector noise using a simulated Advanced LIGO PSD. This example analyses data from the H1 and L1 detectors, will run in the signal, glitch, and noise models, and does not used BayesLine PSD estimation (assumes the PSD is known).

[input]
dataseed=1234
seglen=4.0
window=1.0
flow=20
srate=2048
ifo-list=['H1','L1']

[engine]
;Paths to bayeswave executables at run time.  These should generally be
; prefixed with e.g., /home/jclark/opt/bayewave for personal
; installations or  /opt/bayeswave/bin for containerized applications
; On CIT, you can use an igwn evironment (igwn-py39-testing recommended), and set this to /cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/bin
install=/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39/
bayeswave=%(install)s/bin/BayesWave
bayeswave_post=%(install)s/bin/BayesWavePost
megaplot=%(install)s/bin/megaplot.py



[datafind]
; Use simulated Gaussian noise
frtype-list={'H1':'LALSimAdLIGO','L1':'LALSimAdLIGO'}
channel-list={'H1':'H1:LALSimAdLIGO','L1':'L1:LALSimAdLIGO'}
url-type=file


[bayeswave_options]
; command line options for BayesWave.  See BayesWave --help
updateGeocenterPSD=
waveletPrior=
Dmax=100
noClean=
; Note this is a short number of iterations for testing purposes only
Niter=5000
; To use multithreading, un-comment the lines below
; Nchain=20
; Nthreads=4

[bayeswave_post_options]
; command line options for BayesWavePost.  See BayesWavePost --help
0noise=


[injections]
; This section only used when doing XML injections.
; the events specifies which events from the xml file you want to run on.
; Can specify events like: events=all or events=5-10 or events=1,3,5 
events=0-9 
inj-fref=20

[condor]
universe=vanilla
checkpoint=
bayeswave-request-memory=4000MB
bayeswave_post-request-memory=4000MB
bayeswave-request-disk=100MB
bayeswave_post-request-disk=100MB
datafind=/usr/bin/gw_data_find
ligolw_print=/usr/bin/ligolw_print
segfind=/usr/bin/ligolw_segment_query_dqsegdb
; see e.g., https://ldas-gridmon.ligo.caltech.edu/ldg_accounting/user
accounting-group = ligo.dev.o4.burst.paramest.bayeswave

Download .ini file

Call to bayeswave_pipe

This bash script contains the call to bayeswave_pipe to setup the injection runs. For xml injections into simulated data, you will need to include the path to the xml file, and the --sim-data flag.

#!/bin/bash

# Change this to point to your specific injection file if needed
injfile=equalMass35Msun-injections.xml

# You can also change the name of the working directory
workdir=xml_injections_simData

bayeswave_pipe \
        --workdir ${workdir} \
        -I ${injfile} \
        --sim-data \
        xml_simNoise.ini

# The --sim-data flag tells the pipeline you're running on simulated data

Download bash script

Option 2: Injecting into real data

In this example, we will look at running the off-source injections for the event GW200311_115853 from the third Gravitational-Wave Transient Catalog (Abbott et al. 2023).

The XML contains 200 injections, and can be downloaded at the link here: Download xml file

Config file

This example will use data from Hanford, Livingston, and Virgo. This example will also use the BayesLine option to do on-source PSD estimation, and will only run the signal model (skipping the glitch and Gaussian noise only models).

[input]
dataseed=1234
seglen=4.0
window=1.0
flow=20
srate=2048
ifo-list = ['H1', 'L1', 'V1']

[engine]
;Paths to bayeswave executables at run time.  These should generally be
; prefixed with e.g., /home/jclark/opt/bayewave for personal
; installations or  /opt/bayeswave/bin for containerized applications
; On CIT, you can use an igwn evironment (igwn-py39-testing recommended), and set this to /cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-testing/bin
install=/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39/
bayeswave=%(install)s/bin/BayesWave
bayeswave_post=%(install)s/bin/BayesWavePost
megaplot=%(install)s/bin/megaplot.py



[datafind]
; Use real data
frtype-list = {'H1': 'H1_HOFT_CLEAN_SUB60HZ_C01', 'L1': 'L1_HOFT_CLEAN_SUB60HZ_C01', 'V1': 'V1Online'}
channel-list = {'H1': 'H1:DCS-CALIB_STRAIN_CLEAN_SUB60HZ_C01', 'L1': 'L1:DCS-CALIB_STRAIN_CLEAN_SUB60HZ_C01', 'V1': 'V1:Hrec_hoft_16384Hz'}
url-type=file


[bayeswave_options]
; command line options for BayesWave.  See BayesWave --help
updateGeocenterPSD=
waveletPrior=
Dmax=100
signalOnly=
bayesLine=
; Note: for real runs, set Niter to at least 1000000, or delete entirely to use BW defaults
Niter=10000

[bayeswave_post_options]
; command line options for BayesWavePost.  See BayesWavePost --help
0noise=


[injections]
; This section only used when doing XML injections.
; the events specifies which events from the xml file you want to run on.
; Can specify events like: events=all or events=5-10 or events=1,3,5 
events=all
inj-fref=20

[condor]
universe=vanilla
checkpoint=
bayeswave-request-memory=4000MB
bayeswave_post-request-memory=4000MB
bayeswave-request-disk=100MB
bayeswave_post-request-disk=100MB
datafind=/usr/bin/gw_data_find
ligolw_print=/usr/bin/ligolw_print
segfind=/usr/bin/ligolw_segment_query_dqsegdb
; see e.g., https://ldas-gridmon.ligo.caltech.edu/ldg_accounting/user
accounting-group = ligo.dev.o4.burst.paramest.bayeswave

Download .ini file

Call to bayeswave_pipe

This bash script contains the call to bayeswave_pipe to setup the injection runs. Because this is a large batch of injections, we will use the --skip-megapy flag which will skip the call to the plotting script megaplot since we probably don’t need to look at every single output page.

#!/bin/bash

# Change this to point to your specific injection file if needed
injfile=GW200311_115853_offsource.xml

# You can also change the name of the working directory
workdir=xml_injections_GW200311_115853

bayeswave_pipe \
        --workdir ${workdir} \
        -I ${injfile} \
        --skip-megapy \
        xml_realNoise.ini

# The --sim-data flag tells the pipeline you're running on simulated data

Download bash script