.. _gallery_nb_gallery_example_acoustic.ipynb: Handling acoustic data ====================== Snippets of acoustic data are made available as statistical summaries, wave files, mp3 files and raw data. The snippets of the same type are offered as stream. .. code:: ipython3 from openkm3.store import KM3Store store = KM3Store() store.list("acoustic20_01") .. parsed-literal:: INFO:root:Loaded catalog from cache. Acoustic data ------------- +-----------------------+----------------------------------------+---------------------------------------------------------+ | Identifier | Title | Description | +=======================+========================================+=========================================================+ | acoustic20\_01\_wav | Acoustic data stream wave | Samples of acoustic data from ARCA DOM as wav file | +-----------------------+----------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_mp3 | Acoustic data stream mp3 | Samples of acoustic data from ORCA DOM as mp3 file | +-----------------------+----------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_raw | Acoustic data stream raw | Samples of acoustic data from ORCA DOM as raw files | +-----------------------+----------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd | Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +-----------------------+----------------------------------------+---------------------------------------------------------+ .. code:: ipython3 store.list("acoustic20_01_psd") Acoustic data stream psd information ------------------------------------ +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | Identifier | Title | Description | +========================================================+===================================================+=========================================================+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1601366233 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1599150167 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1601455406 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1599152165 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1601364561 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1600355223 | Element of Acoustic data stream psd information | Statistical quantities of acoustic data from ORCA DOM | +--------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------+ Accessing statistical information --------------------------------- As example, one sample of a channel from a hydrophone on one Digital Optical Module (DOM) is accessed .. code:: ipython3 psd = store.get("acoustic20_01_psd_DOM_808974724_CH1_1601366233") psd.show_metadata() .. parsed-literal:: INFO:root:Loaded entry acoustic20_01_psd_DOM_808974724_CH1_1601366233 as . +-------------------+-------------------------------------------------------------------------+ | Entry | Value | +===================+=========================================================================+ | accessInfo | {} | +-------------------+-------------------------------------------------------------------------+ | accessURL | http://192.84.151.120:8080/api/v1/psd/DOM\_808974724\_CH1\_1601366233 | +-------------------+-------------------------------------------------------------------------+ | author | The KM3NeT collaboration | +-------------------+-------------------------------------------------------------------------+ | dateCreation | 2020-11-11 | +-------------------+-------------------------------------------------------------------------+ | datePublication | 2020-11-11 | +-------------------+-------------------------------------------------------------------------+ | description | Statistical quantities of acoustic data from ORCA DOM | +-------------------+-------------------------------------------------------------------------+ | instrument | DOM\_808974724\_CH1 | +-------------------+-------------------------------------------------------------------------+ | keywords | [] | +-------------------+-------------------------------------------------------------------------+ | kid | 3e74baaf-8aa4-4352-a88d-64cafb847c82 | +-------------------+-------------------------------------------------------------------------+ | ktype | km3.data.d3.acoustic.psd | +-------------------+-------------------------------------------------------------------------+ | license | CC-BY4.0 | +-------------------+-------------------------------------------------------------------------+ | odcid | acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1601366233 | +-------------------+-------------------------------------------------------------------------+ | parentResource | fa347840-1f13-4720-adab-3607efe08a90 | +-------------------+-------------------------------------------------------------------------+ | publisher | The KM3NeT collaboration | +-------------------+-------------------------------------------------------------------------+ | resource\_uri | /data/resources/acoustic20\_01\_psd\_DOM\_808974724\_CH1\_1601366233/ | +-------------------+-------------------------------------------------------------------------+ | returnFormat | application/json | +-------------------+-------------------------------------------------------------------------+ | startTime | 2020-09-29T07:57:13 | +-------------------+-------------------------------------------------------------------------+ | title | Element of Acoustic data stream psd information | +-------------------+-------------------------------------------------------------------------+ | version | 1.0 | +-------------------+-------------------------------------------------------------------------+ .. code:: ipython3 df = psd.get_dataframe() df["mean"].plot() .. parsed-literal:: .. image:: images/example_acoustic_0.png Accessing the wave file ----------------------- .. code:: ipython3 wave = store.get("acoustic20_01_wav_DOM_808974724_CH1_1601366233") .. parsed-literal:: INFO:root:Loaded entry acoustic20_01_wav_DOM_808974724_CH1_1601366233 as . .. code:: ipython3 wave.show_paraminfo() +-------------+------------------+ | Parameter | Value | +=============+==================+ | nchannels | 1 | +-------------+------------------+ | sampwidth | 3 | +-------------+------------------+ | framerate | 193500 | +-------------+------------------+ | nframes | 13476645 | +-------------+------------------+ | comptype | NONE | +-------------+------------------+ | compname | not compressed | +-------------+------------------+ .. code:: ipython3 df = wave.get_dataframe(endframe = 13476645, startframe = 10000000) df .. raw:: html
0 1 2
0 88 -73 -104
1 -51 96 -1
2 71 77 64
3 -79 17 76
4 -88 -91 -104
... ... ... ...
3476640 -65 -32 -94
3476641 -112 62 96
3476642 73 -56 61
3476643 32 70 -34
3476644 0 0 -128

3476645 rows × 3 columns

.. only:: html .. container:: sphx-glr-download **Download python script:** :download:`example_acoustic.py` **Download Jupyter notebook:** :download:`example_acoustic.ipynb`