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.
- 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.
- Install the python client library (instructions on how to do this).
- Open the following script: DownloadONChydrophoneData.py
- Replace YOUR TOKEN with your token
- Replace OUTPATH with the path to your chosen output directory
- Replace PATH TO DOWNLOAD LIST with the path to where you have saved your .csv file containing the start and stop times.
- Replace LOCATION CODE (within orders = onc.orderDataProduct command) with the location code of the deployment of interest. (Location code list.)
- Run the downloadONCHydrophoneData script