{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Access GW data with ODA_API" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# oda_api should be installed with GW support\n", "%pip install oda_api[gw]" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from oda_api.api import DispatcherAPI\n", "from matplotlib import pyplot as plt\n", "plt.rcParams['figure.figsize'] = (10, 7)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "dispatcher_url = 'https://www.astro.unige.ch/mmoda/dispatch-data'\n", "disp=DispatcherAPI(url=dispatcher_url, instrument='mock')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Query events in the time range (catalog and skymap)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "please beware that by default, in a typical setup, oda_api will not output much. To learn how to increase the verbosity, please refer to the documentation: https://oda-api.readthedocs.io/en/latest/user_guide/ScienceWindowList.html?highlight=logging#Let's-get-some-logging . \n", "To disable this message you can pass `.get_product(..., silent=True)`\n" ] } ], "source": [ "par_dict={\n", " \"T1\": \"2019-07-27T06:03:29.000\",\n", " \"T2\": \"2019-08-27T06:03:44.000\",\n", " \"contour_levels\": \"50,90\",\n", " \"do_cone_search\": \"false\",\n", " \"instrument\": \"gw\",\n", " \"product\": \"gw_skymap_image\",\n", " \"product_type\": \"Real\",\n", "}\n", "\n", "data_collection = disp.get_product(**par_dict)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ID=0 prod_name=dispatcher_catalog_0 meta_data: \n", "\n", "ID=1 prod_name=skymap_GW190727_060333_1 meta_data: {}\n", "\n", "ID=2 prod_name=skymap_GW190728_064510_2 meta_data: {}\n", "\n", "ID=3 prod_name=skymap_GW190731_140936_3 meta_data: {}\n", "\n", "ID=4 prod_name=skymap_GW190803_022701_4 meta_data: {}\n", "\n", "ID=5 prod_name=skymap_GW190814_5 meta_data: {}\n", "\n", "ID=6 prod_name=gw_skymap_image_6 meta_data: \n", "\n" ] } ], "source": [ "data_collection.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Event catalog" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| index | commonName | GPS | luminosity_distance | luminosity_distance_lower | luminosity_distance_upper | mass_1_source | mass_1_source_lower | mass_1_source_upper | mass_2_source | mass_2_source_lower | mass_2_source_upper |
|---|---|---|---|---|---|---|---|---|---|---|---|
| int64 | str15 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
| 0 | GW190727_060333 | 1248242632.0 | 3300.0 | -1500.0 | 1540.0 | 38.0 | -6.2 | 9.5 | 29.4 | -8.4 | 7.1 |
| 1 | GW190728_064510 | 1248331528.5 | 870.0 | -370.0 | 260.0 | 12.3 | -2.2 | 7.2 | 8.1 | -2.6 | 1.7 |
| 2 | GW190731_140936 | 1248617394.6 | 3300.0 | -1720.0 | 2390.0 | 41.5 | -9.0 | 12.2 | 28.8 | -9.5 | 9.7 |
| 3 | GW190803_022701 | 1248834439.9 | 3270.0 | -1580.0 | 1950.0 | 37.3 | -7.0 | 10.6 | 27.3 | -8.2 | 7.8 |
| 4 | GW190814 | 1249852257.0 | 240.0 | -50.0 | 40.0 | 23.2 | -1.0 | 1.1 | 2.59 | -0.09 | 0.08 |