.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/timeseries/public.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_public.py: .. sectionauthor:: Duncan Macleod .. currentmodule:: gwpy.timeseries Accessing and visualising public GW detector data ################################################# Data from the current generation gravitational wave detectors are published by |GWOSCl| and freely available to the public. In this example we demonstrate how to identify times of a published GW detection event, and to download and visualise detector data. .. GENERATED FROM PYTHON SOURCE LINES 33-35 Firstly, we can use the |gwosc-mod| Python package to query for the time of the first gravitational-wave detection |GW150914|: .. GENERATED FROM PYTHON SOURCE LINES 35-39 .. code-block:: Python from gwosc.datasets import event_gps gps = event_gps("GW150914") .. GENERATED FROM PYTHON SOURCE LINES 40-43 GWpy's `TimeSeries` class provides an interface to the public |GWOSC| data in the :meth:`~TimeSeries.fetch_open_data` method; to use it we need to first import the `TimeSeries` object: .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: Python from gwpy.timeseries import TimeSeries .. GENERATED FROM PYTHON SOURCE LINES 47-51 then call the :meth:`~TimeSeries.fetch_open_data` method, passing it the prefix for the interferometer we want (`'L1'` here for LIGO-Livingston), and the GPS start and stop times of our query (based around the GPS time for GW150914): .. GENERATED FROM PYTHON SOURCE LINES 51-54 .. code-block:: Python data = TimeSeries.fetch_open_data("L1", gps-5, gps+5) .. GENERATED FROM PYTHON SOURCE LINES 55-56 and then we can make a plot: .. GENERATED FROM PYTHON SOURCE LINES 56-65 .. code-block:: Python plot = data.plot( title="LIGO Livingston Observatory data for GW150914", ylabel="Strain amplitude", color="gwpy:ligo-livingston", epoch=gps, ) plot.show() .. image-sg:: /examples/timeseries/images/sphx_glr_public_001.png :alt: LIGO Livingston Observatory data for GW150914 :srcset: /examples/timeseries/images/sphx_glr_public_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 66-71 We can't see anything that looks like a gravitational wave signal in these data, the amplitude is dominated by low-frequency detector noise. Further filtering is required to be able to identify the GW150914 event here, see :ref:`sphx_glr_examples_signal_gw150914.py` for a more in-depth example of extracting signals from noise. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.160 seconds) .. _sphx_glr_download_examples_timeseries_public.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: public.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: public.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: public.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_