Note
Go to the end to download the full example code.
Calculate the coherence between two channels¶
The coherence between two channels is a measure of the frequency-domain correlation between their time-series data.
In LIGO, the coherence is a crucial indicator of how noise sources couple into
the main differential arm-length readout.
Here we use use the TimeSeries.coherence()
method to highlight coupling
of motion of a beam periscope attached to the main laser table into the
strain output of the LIGO-Hanford interferometer.
These data are available as part of the Auxiliary Channel Three Hour Release.
Data access¶
First, we import the TimeSeriesDict
from gwpy.timeseries import TimeSeriesDict
and then get()
the data for the differential-arm
length servo control loop error signal (H1:LSC-DARM_IN1_DQ
) and the
PSL periscope accelerometer (H1:PEM-CS_ACC_PSL_PERISCOPE_X_DQ
):
data = TimeSeriesDict.get(
["H1:LSC-DARM_IN1_DQ", "H1:PEM-CS_ACC_PSL_PERISCOPE_X_DQ"],
1186741560,
1186742160,
host="nds.gwosc.org",
)
darm = data["H1:LSC-DARM_IN1_DQ"]
acc = data["H1:PEM-CS_ACC_PSL_PERISCOPE_X_DQ"]
/home/duncan.macleod/gwpy-nightly-build/conda/envs/gwpy-nightly-3.11/lib/python3.11/site-packages/igwn_auth_utils/requests.py:46: DeprecationWarning: Support for identity-based X.509 credentials for LIGO.ORG is being dropped.
Calls to this utility will stop working on/around 20 May 2025.
For details on this change please see
https://computing.docs.ligo.org/guide/compsoft/roadmap/LVK/x509_retirement/
If you have questions about this message, or its implications, please
consider opening an IGWN Computing Help Desk ticket:
https://git.ligo.org/computing/helpdesk/-/issues/new
return func(*args, **kwargs)
Calculating coherence¶
We can then calculate the coherence()
of one
TimeSeries
with respect to the other, using an 2-second Fourier
transform length, with a 1-second (50%) overlap:
coh = darm.coherence(acc, fftlength=2, overlap=1)
Visualisation¶
Finally, we can plot()
the
resulting data:
plot = coh.plot(
xlabel="Frequency [Hz]",
xscale="log",
ylabel="Coherence",
yscale="linear",
ylim=(0, 1),
)
plot.show()

We can clearly see the correlation between the periscope motion and the differential-arm length servo control loop error signal between 100 Hz and 1000 Hz. Such physical couplings can interfere, mask, or even mimic a gravitational wave signal inferred from the differential arm length motion.
Total running time of the script: (0 minutes 4.332 seconds)