Skip to end of metadata
Go to start of metadata

You may want to automate the download of hydrophone files using Python or MATLAB. This How-to gives instructions for Python. A second How-to show how to do it with MATLAB.

The instructions require that you replace the words “YOUR TOKEN” with the token associated with your Oceans 2.0 account (how to get your API token). The default script and instructions will download audio data in wav format - other hydrophone data types and formats are listed at the end of this document.

Note: The Python method downloads files faster than the MATLAB method.

Step-by-step guide

  1. Create a .csv file containing a column of start times and a column of stop times in the format YYYY-mm-ddTHH:MM:ss.fffZ (T and Z are not symbols, but letters within the date format). Do not include column headers. If you are downloading one continuous range, enter one start and one stop time.
  2. Install the python client library (instructions on how to do this).
  3. Open the following script: DownloadONChydrophoneData.py
  4. Replace YOUR TOKEN with your token
  5. Replace OUTPATH with the path to your chosen output directory
  6. Replace PATH TO DOWNLOAD LIST with the path to where you have saved your .csv file containing the start and stop times.
  7. Replace LOCATION CODE (within orders = onc.orderDataProduct command) with the location code of the deployment of interest. (Location code list.)
  8. Run the downloadONCHydrophoneData script