Download Archived Files
# Get the token from your Oceans 3.0 profile page
from onc import ONC
onc = ONC("YOUR_TOKEN")
/archivefile/device
Get a list of all archived files available from a specific device for a specific time-range
Return the archived files for a device with deviceCode “RDIADCP600WH25471”
params = {
"deviceCode": "RDIADCP600WH25471",
"dateFrom": "2019-06-07T00:00:00.000Z",
"dateTo": "2019-06-08T00:00:00.000Z",
}
onc.getArchivefile(params)
# Longer method name
# onc.getArchivefileByDevice(params)
# Alias method name
# onc.getListByDevice(params)
Get a list of all archived files available from a specific device for a specific time-range with a specific extension
Return the archived files for an ADCP instrument with deviceCode “RDIADCP600WH25471” that have rdi as the extension name.
params = {
"deviceCode": "RDIADCP600WH25471",
"extension": "rdi",
"dateFrom": "2019-06-07T00:00:00.000Z",
"dateTo": "2019-06-08T00:00:00.000Z",
}
onc.getArchivefile(params)
# Longer method name
# onc.getArchivefileByDevice(params)
# Alias method name
# onc.getListByDevice(params)
Download a file by its filename
onc.downloadArchivefile("ICLISTENHF1560_20181005T000403.000Z-spect.mat", overwrite=True)
# Alias method name
# onc.getFile("ICLISTENHF1560_20181005T000403.000Z-spect.mat", overwrite=True)
/archivefile/location
Get a list of all archived files available from a specific location and a device category for a specific time-range
Return the archived files for a device with deviceCategoryCode “HYDROPHONE” at location Straight of Georgia East ( locationCode:”SEVIP”)
params = {
"deviceCategoryCode": "HYDROPHONE",
"locationCode": "SEVIP",
"dateFrom": "2018-10-05T00:05:00.000Z",
"dateTo": "2018-10-05T00:06:00.000Z",
}
onc.getArchivefile(params)
# Longer method name
# onc.getArchivefileByLocation(params)
# Alias method name
# onc.getListByLocation(params)
Get a list of all archived files available from a specific location and a device category for a specific time-range with a specific file extension
Return the archived files for a device with deviceCategoryCode “HYDROPHONE” at location Straight of Georgia East ( locationCode:”SEVIP”) with file extension “mat”.
params = {
"deviceCategoryCode": "HYDROPHONE",
"locationCode": "SEVIP",
"extension": "mat",
"dateFrom": "2018-10-05T00:05:00.000Z",
"dateTo": "2018-10-05T00:06:00.000Z",
}
onc.getArchivefile(params)
# Longer method name
# onc.getArchivefileByLocation(params)
# Alias method name
# onc.getListByLocation(params)
Download archived files that match the parameters
Download all “mat” files from a hydrophone at Straight of Georgia East (locationCode:”SEVIP”) using the parameter above.
params = {
"deviceCategoryCode": "HYDROPHONE",
"locationCode": "SEVIP",
"extension": "mat",
"dateFrom": "2018-10-05T00:05:00.000Z",
"dateTo": "2018-10-05T00:06:00.000Z",
}
onc.downloadDirectArchivefile(params)
# Alias method name
# onc.getDirectFiles(params)