.. _gallery_nb_gallery_example_voservices.ipynb: Using VO services ================= OpenKM3 uses the `pyvo interface `__ to access data provided through the `VO server `__ of KM3NeT. Currently implemented is a Simple Cone Search (SCS) service accessible through the TAP protocol. .. code:: ipython3 from openkm3.store import KM3Store store = KM3Store() .. parsed-literal:: INFO:root:Loaded catalog from cache. .. code:: ipython3 service = store.get("ana20_01_vo") .. parsed-literal:: INFO:root:Loaded entry ana20_01_vo as . .. code:: ipython3 service.show_paraminfo() .. parsed-literal:: Table: ant20_01.main Neutrino candidates from full-sky search from 2007-2017 name description unit ucd utype arraysize datatype ---- ------------------------------------------- ---- --------------- ----- --------- -------- _r Distance to cone center deg pos.distance None 1 None MJD Modified Julian Day None time.epoch None 1 None Beta angular error estimate on reconstruction None stat.error None 1 None Nhit number of light signals in photomultipliers None phys.energy None 1 None RA FK5 equatorial right ascension None POS_EQ_RA_MAIN None 1 None Decl FK5 equatorial declination None POS_EQ_DEC_MAIN None 1 None ID Event identifier None ID_MAIN None * None Getting TAP service or SCS -------------------------- You can get the services from the loaded KM3Object, which returns pyvo objects. From here onwards, you can use pyvo functions. .. code:: ipython3 tap = service.get_tap() highEevents = tap.search("SELECT * FROM ant20_01.main WHERE nhit>150") # get most high-energetic events highEevents.to_table() .. raw:: html Table length=10
mjdbetanhitradeclid
float64float64int32float64float64object
54789.22820.1263315.0-16.7ANT1157
55970.0950.316018.6-43.3ANT4737
56660.3290.920010.8-1.5ANT6138
56221.49190.315839.611.0ANT5198
56329.40150.2157156.73.6ANT5571
54725.88940.2152200.417.9ANT0886
56574.73030.3153105.2-44.3ANT5888
54731.24170.1155281.1-48.7ANT0907
56412.8890.2156283.4-57.1ANT5655
57998.95990.21621.8-64.0ANT8518
.. code:: ipython3 scs = service.get_scs() coneevents = scs.search((20,30), 2) # get events for a 2 degree cone around given sky coordinates coneevents.to_table() .. raw:: html Table length=2
_rMJDBetaNhitRADeclID
deg
float64float64float64int32float64float64object
0.32766393177068656195.59480.44520.330.2ANT5087
1.5694843062166955692.73030.36218.731.1ANT3659
Access full table ----------------- .. code:: ipython3 fulltable = service.get_dataframe() .. code:: ipython3 plot = fulltable.beta.plot(kind = "hist") .. image:: images/example_VOservices_0.png .. only:: html .. container:: sphx-glr-download **Download python script:** :download:`example_VOservices.py` **Download Jupyter notebook:** :download:`example_VOservices.ipynb`