.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/timeseries/statevector.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_timeseries_statevector.py: .. sectionauthor:: Duncan Macleod .. currentmodule:: gwpy.timeseries Plotting segments for a `StateVector` ##################################### Confident detection of gravitational-wave signals is critically dependent on understanding the quality of the data searched. Alongside the strain *h(t)* data, |GWOSC|_ also releases a *Data Quality* :ref:`state vector `. We can use this to check on the quality of the data from the LIGO Livingston detector around |GW170817|_. .. GENERATED FROM PYTHON SOURCE LINES 35-36 First, we can import the `StateVector` class: .. GENERATED FROM PYTHON SOURCE LINES 36-38 .. code-block:: Python from gwpy.timeseries import StateVector .. GENERATED FROM PYTHON SOURCE LINES 39-40 and download the state information surrounding GW170817: .. GENERATED FROM PYTHON SOURCE LINES 40-47 .. code-block:: Python data = StateVector.fetch_open_data( "L1", 1187008882 - 100, 1187008882 + 100, verbose=True, ) .. rst-class:: sphx-glr-script-out .. code-block:: none Fetched 1 URLs from gwosc.org for [1187008782 .. 1187008982)) Reading data... [Done] .. GENERATED FROM PYTHON SOURCE LINES 48-50 Finally, we make a :meth:`~StateVector.plot`, passing `insetlabels=True` to display the bit names inside the axes: .. GENERATED FROM PYTHON SOURCE LINES 50-57 .. code-block:: Python plot = data.plot(insetlabels=True) ax = plot.gca() ax.set_xscale("seconds", epoch=1187008882) ax.axvline(1187008882, color="orange", linestyle="--") ax.set_title("LIGO-Livingston data quality around GW170817") plot.show() .. image-sg:: /examples/timeseries/images/sphx_glr_statevector_001.png :alt: LIGO-Livingston data quality around GW170817 :srcset: /examples/timeseries/images/sphx_glr_statevector_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 58-63 This plot shows that for a short time exactly overlapping with GW170817 there was a data quality issue recorded that would negatively impact a search for generic gravitational-wave transients (bursts). For more details on this *glitch*, and on how it was excised, please see the science summary for |GW170817|_. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.146 seconds) .. _sphx_glr_download_examples_timeseries_statevector.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: statevector.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: statevector.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: statevector.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_