-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got all documentation read for readthedocs
- Loading branch information
1 parent
90fcfa2
commit 6b463a5
Showing
24 changed files
with
783 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
pyhydrophone |version| | ||
====================== | ||
|
||
Description | ||
----------- | ||
pyhydrophone helps keeping together all the information of the recorder. | ||
It makes it easier to read different hydrophones' output files and extract the information. | ||
|
||
Each class represents a different hydrophone. The available ones now are (others will be added): | ||
|
||
* SoundTrap (OceanInstruments) | ||
* Seiche (Seiche) | ||
* AMAR (JASCO) | ||
* RESEA (RTSys) | ||
* uPAM (Seiche) | ||
* EARS | ||
* MTE AURAL (MTE) | ||
|
||
|
||
They all inherit from the main class Hydrophone. | ||
If a certain recorder provides an output different than a regular wav file, functions to read and understand the output | ||
are provided. | ||
Functions to read the metadata are also provided (which is often encoded in the file name). | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Getting Started | ||
|
||
install | ||
quickstart | ||
|
||
.. toctree:: | ||
:caption: Hydrophone objects | ||
:maxdepth: 1 | ||
|
||
data_structures | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Example Gallery | ||
|
||
_auto_examples/index | ||
|
||
|
||
Citing pyhydrophone | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. note:: | ||
If you find this package useful in your research, we would appreciate citations to: | ||
|
||
Parcerisas (2023). lifewatch/pyhydrophone: A package to deal with hydrophone data. Zenodo. | ||
[](https://doi.org/10.5281/zenodo.7588428) | ||
|
||
|
||
|
||
|
||
About the project | ||
~~~~~~~~~~~~~~~~~ | ||
This project has been funded by `LifeWatch Belgium <https://www.lifewatch.be/>`_. | ||
|
||
.. image:: _static/lw_logo.png | ||
|
||
|
||
For any questions please relate to [email protected] | ||
|
||
|
||
Indices and tables | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. currentmodule:: pyhydrophone | ||
|
||
Install | ||
======= | ||
|
||
Using pip distribution | ||
---------------------- | ||
.. code-block:: | ||
pip install pyhydrophone | ||
Using git clone | ||
--------------- | ||
|
||
1. Clone the package | ||
|
||
.. code-block:: | ||
git clone https://github.com/lifewatch/pyhydrophone.git | ||
2. Use poetry to install the project dependencies | ||
|
||
.. code-block:: | ||
poetry install | ||
3. Build the project | ||
|
||
.. code-block:: | ||
poetry build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. currentmodule:: pyhydrophone | ||
|
||
Introduction to pyhydrophone | ||
============================ | ||
|
||
Passive acoustics monitoring is becoming more and more popular in marine environments. | ||
Therefore, more and more underwater acoustic recorders can be found in the market. However, the output they give is not | ||
standardized and each of them usually needs an if statement. | ||
pyhydrophone is thus thought as a package which can be used in data analysis pipelines or scripts without having to | ||
change the way the metadata is read for a different recorder. | ||
|
||
First, an object is created to represent a hydrophone with all its metadata:: | ||
|
||
import pyhydrophone as pyhy | ||
|
||
# SoundTrap | ||
model = 'SoundTrap 300 STD' | ||
name = 'SoundTrap' | ||
serial_number = 67416073 | ||
soundtrap = pyhy.soundtrap.SoundTrap(name=name, model=model, serial_number=serial_number) | ||
|
||
|
||
Then this object can be used in a pipeline in a way such as:: | ||
|
||
wav_path = 'tests/test_data/soundtrap/67416073.210610033655.wav' | ||
start_datetime_of_wav = soundtrap.get_name_datetime(wav_path) | ||
|
||
|
||
It can also be used to for calibration:: | ||
|
||
import soundfile as sf | ||
import numpy as np | ||
|
||
wav = sf.read(wav_path) | ||
rms_db = 10 * np.log10(np.mean(wav**2)) | ||
rms_db_upa = rms_db + soundtrap.end_to_end_calibration() | ||
|
||
|
||
If you have a frequency dependent calibration file, it can also be used:: | ||
|
||
import scipy.signal as sig | ||
|
||
rtsys_name = 'RTSys' | ||
rtsys_model = 'RESEA320' | ||
rtsys_serial_number = 2003001 | ||
rtsys_sens = -180 | ||
rtsys_preamp = 0 | ||
rtsys_vpp = 5 | ||
mode = 'lowpower' | ||
calibration_file = pathlib.Path("tests/test_data/rtsys/SN130.csv") | ||
rtsys = pyhy.RTSys(name=rtsys_name, model=rtsys_model, serial_number=rtsys_serial_number, sensitivity=rtsys_sens,preamp_gain=rtsys_preamp, Vpp=rtsys_vpp, mode=mode, calibration_file=calibration_file) | ||
|
||
wav_path = 'tests/test_data/rtsys/channelA_2021-10-11_13-11-09.wav' | ||
wav, fs = sf.read(wav_path) | ||
frequencies, spectrum = sig.welch(wav) | ||
frequency_increment = rtsys.freq_cal_inc(frequencies) | ||
print(df) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Example gallery | ||
=============== | ||
|
||
This gallery is intended to present examples on how to use pyhydrophone. |
Oops, something went wrong.