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 3.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
- 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.
- Install the MATLAB client library. Instructions can be found by clicking “Installation instructions” on this page.
- Import the .csv file containing start and stop times as text-format column vectors. Name these vectors “start” and “stop”.
- Save the runGetOncArchivefileData_Barkley and getOncArchivefileData.m scripts to your working folder.
- Open the “runGetOncArchivefileData_Barkley” script and replace “YOUR TOKEN” with your token.
- Run “runGetOncArchivefileData_Barkley”
Note: The Python method downloads files faster than the MATLAB method.