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 MATLAB. A second How-to show how to do it with Python.

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.

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.SSS. If you are downloading one continuous range, enter one start and one stop time.
  2. Install the MATLAB client library. Instructions can be found by clicking “Installation instructions” on this page.
  3. Import the .csv file containing start and stop times as text-format column vectors. Name these vectors “start” and “stop”.
  4. Save the runGetOncArchivefileData_Barkley and getOncArchivefileData.m scripts to your working folder.
  5. Open the “runGetOncArchivefileData_Barkley” script and replace “YOUR TOKEN” with your token.
  6. Run “runGetOncArchivefileData_Barkley


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