You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

The ONC MatLab client library contains a number of classes and functions that make access to the ONC data, through the Oceans 2.0 API, quick and easy to use.

Requires

Currently, only R2017a is supported, due to updates to the HTTP library that support payloads with non-200 status codes

Installation

The ONC client library is a Add-On Toolbox that can be installed in MatLab by performing the following

  1. Download the latest version of the ONC Toolbox onc-1.01.mltbx
  2. Open MATLAB R2017a and click the 'Open' button.



  3. Select the downloaded file and click the 'Open' button.



  4. When presented with the 'Install onc' dialog, click the 'Install' button.



  5. To view the ONC Add-On toolbox click on the 'Add-On' button on the Home ribbon and select 'Manage Add-Ons'






History

version
Date
Description
Toolbox
Source
1.06/28/2017Beta version

onc-1.0.mltbx

 
1.017/18/2017Added getDirectScalar, getDirectRaw, getDirectFilesonc-1.01.mltbxsource-1.01.zip

 

Classes

 

class
description
oncA wrapper class for access to Oceans 2.0 API web services

 

ONC Class

Description

This class provides a wrapper for some for the most common Oceans 2.0 API requests, including the discovery services (locations, devices, deviceCategories, properties) and delivery (dataProductDelivery, scalardata and rawdata).

constructor

 

onc(token, production, showInfo, outPath, timeout)
Parameter
Type
Description
Example
Required   
tokenstringAll Web Services require a token. This can be generated at http://dmas.uvic.ca/Profile. Click on the "Web Services" tab and click "Generate Token"token=5ba514e8-1203-428c-8835-879c8173e387
Optional   
productionboolean

Indicates if the ONC Production server URL is used for service requests.

  • Default is true.
  • false is intended for internal ONC testing only.
  • All external users should use false or leave blank.
true or false
showInfoboolean

Indicates if verbose script messages are displayed, such as request url and processing time information.

  • Default is false.
  • True is intended for script debugging.
true or false
outPathstring

The path that downloaded files are saved to.

  • Default is 'c:/Temp'.
  • Full path will be created if it does not already exist.
'c:/ONC/Download'
timeoutint

The web service request timeout in seconds

  • Default is 60
30

 

Usage

o = onc('YOUR_TOKEN_HERE')

Or

isProduction = true
showInfo = false
outPath = 'c:/ONC/Data'
timeout = 30
o = onc('YOUR_TOKEN_HERE',isProduction,showInfo,outPath,timeout)

 

methods

Discovery methods

 

getLocations(parameters)

 

Returns a list of locations, as a list of struct objects.

 

Parameter
Type
Description
Example
Optional   
parametersstruct or array

A comma separated list of filter parameters, used to filter data from the ONC devices endpoint.

  • A list of filter/value pairs in the following format struct('<filter_1>','<value_1>','<filter_2>','<value_2>',...) or {'<filter_1>','<value_1>','<filter_2>','<value_2>',...}
  • If excluded, all locations are returned.
  • See locations Discovery Service for available parameters (filters).
struct('locationCode','BACAX')

or

{'locationCode','BACAX'}
Example - Print all locations in North East Pacific with Hydrophones deployed
o = onc('YOUR_TOKEN_HERE')

locations = o.locations({'deviceCategoryCode','ADCP2MHZ'});
for i=1:numel(locations)
    disp(locations(i));
end

 

 

 

getDevices(parameters)

 

Returns a list of devices, as a list of struct objects.

 

Parameter
Type
Description
Example
Optional   
parametersstruct or array

A comma separated list of filter parameters, used to filter data from the ONC devices endpoint.

  • A list of filter/value pairs in the following format struct('<filter_1>','<value_1>','<filter_2>','<value_2>',...) or {'<filter_1>','<value_1>','<filter_2>','<value_2>',...}

  • If excluded, all devices are returned.
  • See devices Discovery Service for available parameters (filters).
struct('deviceCode','NORTEKADCP9917')

or

{'deviceCode','NORTEKADCP9917'}
Example - Print all devices deployed at Barkley Canyon - Axis, between June 1, 2016 and May 31, 2017
o = onc('YOUR_TOKEN_HERE')

devices = o.getDevices({'locationCode','BACAX', ... 				%BACAX - Barkley Canyon / Axis
						'deploymentBegin','2016-06-01T00:00:00.000Z', ...
						'deploymentEnd':'2017-05-31T23:59:59.999Z'})  

devices = o.devices({'deviceCategoryCode','ADCP2MHZ'});
for i=1:numel(devices)
    disp(devices(i));
end

 

 

 

getDeviceCategories(parameters)

 

Returns a list of deviceCategories, as a list of struct objects.

 

Parameter
Type
Description
Example
Optional   
parametersstruct or array

A comma separated list of filter parameters, used to filter data from the ONC deviceCategories endpoint.

  • A list of filter/value pairs in the following format struct('<filter_1>','<value_1>','<filter_2>','<value_2>',...) or {'<filter_1>','<value_1>','<filter_2>','<value_2>',...}
  • If excluded, all device categories are returned.
  • See deviceCategories Discovery Service for available parameters (filters).
struct('deviceCategoryCode','HYDROPHONE')

or

{'deviceCategoryCode','HYDROPHONE'}
Example - Print all device categories available at Barkley Canyon - Upper Slope
o = ONC('YOUR_TOKEN_HERE')

deviceCategories = o.getDeviceCategories({'locationCode':'NCBC'})    #NCBC - Barkely Canyon / Upper Slope

for i=1:numel(deviceCategories)
    disp(deviceCategories(i));
end

 

 

 

getProperties(parameters)

 

Returns a list of properties, as a list of struct objects.

 

Parameter
Type
Description
Example
Optional   
parametersstruct or array

A comma separated list of filter parameters, used to filter data from the ONC properties endpoint.

  • A list of filter/value pairs in the following format struct('<filter_1>','<value_1>','<filter_2>','<value_2>',...) or {'<filter_1>','<value_1>','<filter_2>','<value_2>',...}
  • If excluded, all properties are returned.
  • See properties Discovery Service for available parameters (filters).
struct('propertyCode','seawatertemperature')

or

{'propertyCode','seawatertemperature'}
Example - Print all properties that are available at Barkley Canyon - Axis
o = onc('YOUR_TOKEN_HERE')

properties = o.getProperties({'locationCode':'BACAX'})  #BACAX - Barkley Canyon / Axis

for i=1:numel(properties)
    disp(properties(i));
end

 

 

getDataProducts(parameters)

 

Returns a list of data products as a list of struct objects.

 

Parameter
Type
Description
Example
Optional   
parametersstruct or array

A dictionary of parameters, used to filter data from the ONC dataProducts endpoint.

  • A list of filter/value pairs in the following format struct('<filter_1>','<value_1>','<filter_2>','<value_2>',...) or {'<filter_1>','<value_1>','<filter_2>','<value_2>',...}
  • If excluded, all data products are returned.
  • See dataProducts Discovery Service for available parameters (filters).
struct('dataProductCode','TSSD', ...
       'extension','json')
or
{'dataProductCode','TSSD', ...
 'extension','json'}
Example - Print all MatLab data product
o = onc('YOUR_TOKEN_HERE')

dataProducts = o.getDataProducts({'extension','mat'}) %mat - MatLab

for i=1:numel(dataProducts)
    disp(dataProducts(i));
end

 

Data Product Download methods

 

orderDataProduct(parameters, maxRetries, downloadResultsOnly, includeMetadataFile)

 

Requests a data product and downloads the generated files to the class's outPath.

This method performs the complete data product download workflow by calling additional methods to perform the following steps:

 1. Request a data product, which includes estimates for download size and time.

 2. Run a requested data product, which kicks off a process on the task machine to generate the data product.

 3. Download the data product to disk. The process will continue to poll the web service to determine if the product is ready to download. If it is not ready, status messages will be provided. Once it is ready, it will download the data product to disk

 

Parameter
Type
Description
Example
Required   
parametersstruct or array

A comma separated list of filter parameters, used to request data as a data product from the ONC dataProductDelivery endpoint.

struct('locationCode','BACAX',...
'deviceCategoryCode','ADCP2MHZ',...
'dataProductCode','TSSD',...
'extension','csv',...
'begin','2016-07-27T00:00:00.000Z',...
'end','2016-08-01T00:00:00.000Z',...
'dpo_qualityControl',1,...
'dpo_resample','none',...
'dpo_dataGaps',0)

or

{'locationCode','BACAX',...
'deviceCategoryCode','ADCP2MHZ',...
'dataProductCode','TSSD',...
'extension','csv',...
'begin','2016-07-27T00:00:00.000Z',...
'end','2016-08-01T00:00:00.000Z',...
'dpo_qualityControl',1,...
'dpo_resample','none',...
'dpo_dataGaps',0}

Option   
maxRetriesint

The number of times to retry the service before the function aborts.

  • If excluded, the default of 100 is used
 
downloadResultsOnlyboolean

Indicates if the files will be downloaded or if only the url to the file will be returned

  • false - Files are downloaded to the ONC class outPath property location
  • true - Files will not be downloaded. The download URLs are available from the url property for each downloadResult in downloadResults in the returned struct
  • If excluded, the default of false is used
 
includeMetadataFileboolean

Indicates if the metadata file associated with the data product request will be downloaded

  • false - Metadata file is not downloaded
  • true - Metadata file is downloaded
  • If excluded, the default of false is used.
 

 

Returns

A dictionary of download results and run time statistics

           url: "http://qaweb2.neptune.uvic.ca/api/dataProductDelivery?method=download&token=b6ede000-1865-4ac3-94ad-e87d8bdfd307&dpRunId=4658962&index=1"
      messages: {1×2 cell}
        status: 'complete'
          size: 3060227
          file: '\\142.104.222.56\c$\ONC\data\BarkleyCanyon_Axis_ADCP2MHz_20160727T000005Z_20160731T235958Z-clean.csv'
         index: 1
    downloaded: 1

           url: "http://qaweb2.neptune.uvic.ca/api/dataProductDelivery?method=download&token=b6ede000-1865-4ac3-94ad-e87d8bdfd307&dpRunId=4658962&index=meta"
      messages: {}
        status: 'complete'
          size: 27504
          file: '\\142.104.222.56\c$\ONC\data\BarkleyCanyon_Axis_ADCP2MHz_20160727T000005Z_20160731T235958Z-clean_CSV_META.pdf'
         index: 'meta'
    downloaded: 1
Property
Type
Description
downloadResultslistA cell array of download results struct objects.
downloadResults{}.urlstringThe URL used to make the download request.
downloadResults{}.messagelistA cell array of the messages that were returned from the dataProductDelivery download method when it was polled.
downloadResults{}.statusstring

The status of the download process at the request. Possible values are:

  • "running" - The data product request is running on the Task server.
  • "complete" - The data product request Task has completed and file has been downloaded or url has been returned.
  • "error" - An error, preventing the task execution or download from completing successfully, has occurred.
downloadResults{}.sizefloatThe actual size of the file in bytes.
downloadResults{}.filestringThe full path of the file that was downloaded.
downloadResults{}.indexstringThe index of the file downloaded. The index can either be a number 1-* or "meta" for the data product metadata file.
downloadResults{}.downloadedbooleanIndicates if the file was downloaded. If the filter downloadResultsOnly=True is used, the data product is not downloaded and the value will be False
Example - Download Time Series Scalar Data Product in CSV format for ADCP 2 MHZ at Barkley Canyon - Axis
o = onc('YOUR_TOKEN_HERE')

results = o.orderDataProduct(struct('locationCode','BACAX',...
                				    'deviceCategoryCode','ADCP2MHZ',...
                				    'dataProductCode','TSSD',...
                				    'extension','csv',...
                				    'begin','2016-07-27T00:00:00.000Z',...
                				    'end','2016-08-01T00:00:00.000Z',...
                				    'dpo_qualityControl',1,...
                				    'dpo_resample','none',...
                				    'dpo_dataGaps',0),100,false,true);
            
for i=1:numel(results)
    disp(results{i});
end

 

 

requestDataProduct(parameters)

 

Requests a data product using the dataProductDelivery service and provides request information so that the calling function can decide if should run the data product.
The struct of information it returns includes a requestID, which is used to run the data product, and estimates of the expected download times and file sizes.

 

Parameter
Type
Description
Example
Required   
parameters

struct or array

A comma separated list of filter parameters, used to request data as a data product from the ONC dataProductDelivery endpoint.

struct('locationCode','BACAX',...
'deviceCategoryCode','ADCP2MHZ',...
'dataProductCode','TSSD',...
'extension','csv',...
'begin','2016-07-27T00:00:00.000Z',...
'end','2016-08-01T00:00:00.000Z',...
'dpo_qualityControl',1,...
'dpo_resample','none',...
'dpo_dataGaps',0)
or
{'locationCode','BACAX', ...
'deviceCategoryCode','ADCP2MHZ', ...
'dataProductCode','TSSD', ...
'extension','csv', ...
'begin','2016-07-27T00:00:00.000Z', ...
'end','2016-08-01T00:00:00.000Z', ...
'dpo_qualityControl',1, ...
'dpo_resample','none', ...
'dpo_dataGaps',0}

 

Returns

returns a data product request struct

for archived files (AD):

           dpRequestId: 2046404
    compressedFileSize: 12563408
              fileSize: 70766230
              numFiles: 4
         downloadTimes: {1x3 cell}
 
 
                         10Mbps: 7.076623
                         50Mbps: 1.4153247
                         150Mbps: 0.47177488

 

for generated files:

                dpRequestId: 2046404
          estimatedFileSize: 8348187
    estimatedProcessingTime: 16
Property
Type
Description
Example
Always contains
dpRequestIdintA unique id for a data product request
dpRequestId: 2046404
May contain
compressedFileSizeintThe compressed size of the known file(s) in bytes.compressedFileSize: 12563408
fileSizeintThe size of known file(s) in bytes.fileSize: 70766230
numFilesintThe number of files.numFiles: 4
downloadTimescell arrayA dictionary of estimated download times
downloadTimes: {1x3 cell}
              10Mbps: 7.076623
              50Mbps: 1.4153247
              150Mbps: 0.47177488
estimatedFileSizeintThe estimated file size of generated data productestimatedFileSize: 8348187
estimatedProcessingTimeintThe estimated time, in seconds, that it will take to run the data product request.estimatedProcessingTime: 16

 

 

runDataProduct(requestId)

 

Runs a data product request using the dataProductDelivery service with a Request Id and returns a list of run ids

 

Parameter
Type
Description
Example
Required   
requestIdint

A dataProductDelivery dpRequestId, which is returned by the dataProductDelivery service request method, or as the 'dpRequestId' property in the dpRequest returned by the requestDataProduct() method.

2046404

 

Returns

a list of runIds

    dpRunId: 4659102
     status: 'data product running'
Example - Run a requested data product
o = onc('YOUR_TOKEN_HERE')

runs = o.runDataProduct(YOUR_REQUEST_ID_HERE)
 
disp(runs)

 

 

downloadDataProduct(runId, fileCount, estimatedProcessingTime, maxRetries, downloadResultsOnly, includeMetadataFile)

 

Polls the dataProductDelivery service until data product generation task is complete and downloads all of the files and/or retrieves the file information (url, file and download status).

 

Parameter
Type
Description
Example
Required   
runIdint

A dataProductDelivery dpRunId, which is returned by the dataProductDelivery service run method, or as the dpRunId property in the list returned by the runDataProduct() method.

4629218
Option   
fileCountint

The actual or estimated file count, which is returned from the dataProductDelivery request method

  • If there is no estimated file count, use 0.
  • If excluded, the default of 0 is used.
1
estimatedProcessingTimeint

The estimated time in seconds, that it should take to run the request on the task machine.

  • Used to determine how often the dataProductDelivery service is called to see if the task processing is complete.
  • Estimated processing time is provided by the dataProductDelivery request method
2
maxRetriesint

The number of times to retry the service before the function aborts.

  • If excluded, the default of 100 is used
10
downloadResultsOnlyboolean

Determines if the files will be downloaded or if only the url to the file will be returned

  • false - Files are downloaded to the ONC class outPath property location
  • true - Files will not be downloaded. The download URLs are available from the url property for each downloadResult in downloadResults in the returned struct
  • If excluded, the default of false is used
true
includeMetadataFileboolean

Indicates if the metadata file associated with the data product request will be downloaded

  • false - Metadata file is not downloaded
  • true - Metadata file is downloaded
  • If excluded, the default of false is used.

true

 

Returns

returns a list of download results struct objects 

           url: "http://qaweb2.neptune.uvic.ca/api/dataProductDelivery?method=download&token=b6ede000-1865-4ac3-94ad-e87d8bdfd307&dpRunId=4658962&index=1"
      messages: {1×2 cell}
        status: 'complete'
          size: 3060227
          file: '\\142.104.222.56\c$\ONC\data\BarkleyCanyon_Axis_ADCP2MHz_20160727T000005Z_20160731T235958Z-clean.csv'
         index: 1
    downloaded: 1

           url: "http://qaweb2.neptune.uvic.ca/api/dataProductDelivery?method=download&token=b6ede000-1865-4ac3-94ad-e87d8bdfd307&dpRunId=4658962&index=meta"
      messages: {}
        status: 'complete'
          size: 27504
          file: '\\142.104.222.56\c$\ONC\data\BarkleyCanyon_Axis_ADCP2MHz_20160727T000005Z_20160731T235958Z-clean_CSV_META.pdf'
         index: 'meta'
    downloaded: 1
Property
Type
Description
urlstringThe URL used to make the download request.
messagelistA list of the messages that were returned from the dataProductDelivery download method when it was polled.
statusstring

The status of the download process at the request. Possible values are:

  • "running" - The data product request is running on the Task server.
  • "complete" - The data product request Task has completed and file has been downloaded or url has been returned.
  • "error" - An error, preventing the task execution or download from completing successfully, has occurred.
sizefloatThe actual size of the file in bytes.
filestringThe full path of the file that was downloaded.
indexstringThe index of the file downloaded. The index can either be a number 1-* or "meta" for the data product metadata file.
downloadedbooleanIndicates if the file was downloaded. If the filter downloadResultsOnly=True is used, the data product is not downloaded and the value will be False

 

 

Example - Download the results of requested data product run
o = onc('YOUR_TOKEN_HERE')

results = o.downloadDataProduct(YOUR_RUN_ID_HERE, 1)
 
for i=1:numel(results)
    disp(results{i});
end

 

 

Near Real-Time data product methods

 

getDirectScalar(parameters, outputFormat, metadata, rowLimit)

 

Returns scalar data, in JSON Object or Array format, in the response payload.

 

Parameter
Type
Description
Example
Required   
parametersstruct or array

A comma separated list of filter parameters, used to request data as a data product from the ONC dataProductDelivery endpoint.

struct('locationCode','TWDP', ...

'deviceCategoryCode','TSG', ...
'begin','2016-09-01T00:00:00.000Z', ...
'end','2016-09-01T08:00:00.000Z')

or

{'locationCode','TWDP', ...
'deviceCategoryCode','TSG', ...
'begin','2016-09-01T00:00:00.000Z', ...
'end','2016-09-01T08:00:00.000Z'}

Option   
outputFormatstring

The encoding of the response output.

  • Object - Data is a list of dictionaries with sampleTime, value and qaqcFlag for a given sensor.
  • Array - Data has 3 arrays for a given sensor. Array of sampleTime, array of values and array of qaqcFlags
  • If excluded, the default 'Object' is used.
"outputFormat","Array"
metadatastring

The amount of metadata detail that is included in the response output.

  • Minimum - Provides only basic property information. Response includes serviceMetadata dictionary only.
  • Full - Provides all property information. Response includes both metadata and serviceMetadata dictionaries.
  • If excluded, the default 'Minimum' is used.
"metadata","Full"
rowLimitinteger

The maximum number of rows of scalar data that will be returned for each sensor

  • Maximum is 100,000
  • If excluded, the default 100,000 is used
"rowLimit",5000

 

Returns

A structure that contains sensor data that matches the filter criteria defined in the input parameters, metadata and service metadata.

 
Property
Type
Description
metadatastructA structure of metadata, if metadata='Full' input parameter is used
metadata.bboxstructA Bounding Box structure
metadata.bbox.maxDepthfloatThe maximum depth of the instruments contributing to the results
metadata.bbox.maxLatfloatThe maximum Latitude of bounding box of the instruments contributing to the results
metadata.bbox.maxLonfloatThe maximum Longitude of the bounding box of the instruments contributing to the results
metadata.bbox.minDepthfloatThe minimum Depth of the instruments contributing to the results
metadata.bbox.minLatfloatThe minimum Latitude of bounding box of the instruments contributing to the results
metadata.bbox.minLonfloatThe minimum Longitude of the bounding box of the instruments contributing to the results
sensorDatalistA list of sensor dictionaries
sensorData[].acutalSamplesintThe number of samples in the data list
sensorData[].datalistA list of observation structures
sensorData[].data[].qaqcFlagintThe QAQC Flag for the observation
sensorData[].data[].sampleTimedatetime string

The recorded time of the observation

sensorData[].data[].valuefloatThe value of the observation
sensorData[].sensorstringThe code of the sensor that is being observed
sensorData[].sensorNamestringThe name of the sensor that is being observed
sensorData[].unitOfMeasurestringThe unit of measure of the observation
serviceMetadatadictionaryA dictionary of the metadata for the service request
serviceMetadata.metadatastringThe requested metadata filter
serviceMetadata.nextDataFromdatetime stringThe begin date for next reading in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.outputFormatstringThe requested JSON output format
serviceMetadata.rowLimitintThe requested row limit per sensor
serviceMetadata.sensorsstringA comma separated list of the requested sensors
serviceMetadata.totalActualSamplesintThe number of observations expected for all of the sensors
serviceMetadata.begindatetime stringThe begin date of the request in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.enddatetime stringThe end date of the request in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.deviceCategoryCodestringThe Device Category Code of the request. See Available Device Categories for further details
serviceMetadata.locationCodestringThe Location Code of the request. See Available Locations for further details.



Example - Print the last Thermosalinograph reading from Tswwassen - Duke Point Ferry
o = onc('YOUR_TOKEN_HERE');
 
result = o.getDirectScalar({'locationCode','TWDP','deviceCategoryCode','TSG'});

disp(result);
Example - Print 1 hour of Thermosalinograph readings from Tswwassen - Duke Point Ferry
o = onc('YOUR_TOKEN_HERE');
 
result = o.getDirectScalar(struct('locationCode','TWDP','deviceCategoryCode','TSG', 'begin','2016-09-01T00:00:00.000Z', 'begin','2016-09-01T01:00:00.000Z'));

disp(result);

 

 

Example - Print 1 hour of Thermosalinograph readings from Tswwassen - Duke Point Ferry as an Array
o = onc('YOUR_TOKEN_HERE');
 
result = o.getDirectScalar(struct('locationCode':'TWDP','deviceCategoryCode':'TSG', 'begin':'2016-09-01T00:00:00.000Z', 'begin':'2016-09-01T01:00:00.000Z'),'Array');

disp(result);
getDirectRaw(parameters, rowLimit)

 

Returns raw data from an instrument in the payload, in JSON format.

 

Parameter
Type
Description
Example
Required   
parameters

struct

or

cell array

A structure or array of parameters, used to request data as a data product from the ONC dataProductDelivery endpoint.

struct('locationCode','TWDP', ...
'deviceCategoryCode','TSG', ...
'begin','2016-09-01T00:00:00.000Z', ...
'end','2016-09-01T08:00:00.000Z')

or

{'locationCode','TWDP', ...
'deviceCategoryCode','TSG', ...
'begin','2016-09-01T00:00:00.000Z', ...
'end','2016-09-01T08:00:00.000Z'}

Option   
rowLimitinteger

The maximum number of rows of raw data that will be returned

  • Maximum is 100,000
  • If excluded, the default 100,000 is used
"rowLimit",5000

 

Returns

A dictionary that contains sensor data that matches the filter criteria defined in the input parameters, metadata and service metadata.

o = onc('YOUR_TOKEN_HERE');
 
result = o.getDirectRaw(struct('locationCode','BACAX','deviceCategoryCode','CTD'));

disp(result);
Property
Type
Description
metadatadictionaryA dictionary of metadata, if metadata='Full' input parameter is used
metadata.bboxdictionaryA Bounding Box dictionary
metadata.bbox.maxDepthfloatThe maximum depth of the instruments contributing to the results
metadata.bbox.maxLatfloatThe maximum Latitude of bounding box of the instruments contributing to the results
metadata.bbox.maxLonfloatThe maximum Longitude of the bounding box of the instruments contributing to the results
metadata.bbox.minDepthfloatThe minimum Depth of the instruments contributing to the results
metadata.bbox.minLatfloatThe minimum Latitude of bounding box of the instruments contributing to the results
metadata.bbox.minLonfloatThe minimum Longitude of the bounding box of the instruments contributing to the results
sensorDatalistA list of sensor dictionaries
sensorData[].acutalSamplesintThe number of samples in the data list
sensorData[].datalistA list of observation dictionaries
sensorData[].data[].qaqcFlagintThe QAQC Flag for the observation
sensorData[].data[].sampleTimedatetime string

The recorded time of the observation

sensorData[].data[].valuefloatThe value of the observation
sensorData[].sensorstringThe code of the sensor that is being observed
sensorData[].sensorNamestringThe name of the sensor that is being observed
sensorData[].unitOfMeasurestringThe unit of measure of the observation
serviceMetadatadictionaryA dictionary of the metadata for the service request
serviceMetadata.metadatastringThe requested metadata filter
serviceMetadata.nextDataFromdatetime stringThe begin date for next reading in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.outputFormatstringThe requested JSON output format
serviceMetadata.rowLimitintThe requested row limit per sensor
serviceMetadata.sensorsstringA comma separated list of the requested sensors
serviceMetadata.totalActualSamplesintThe number of observations expected for all of the sensors
serviceMetadata.begindatetime stringThe begin date of the request in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.enddatetime stringThe end date of the request in yyyy-MM-ddTHH:mm:ss.SSSZ format
serviceMetadata.deviceCategoryCodestringThe Device Category Code of the request. See Available Device Categories for further details
serviceMetadata.locationCodestringThe Location Code of the request. See Available Locations for further details.

 

 

Example - Print the last raw instrument reading from AIS Reviever at the Underwater Listening Station at IONA
o = onc('YOUR_TOKEN_HERE');
 
payload = o.getDirectRaw(struct('locationCode','IONA','deviceCategoryCode','AISRECEIVER'),1);

disp(payload);
Example - Print 1 hour of raw CTD readings from Barkley Canyon Axis
o = onc('YOUR_TOKEN_HERE');
 
payload = o.getDirectRaw(struct('locationCode','BACAX','deviceCategoryCode','CTD','begin','2017-05-23T00:00:00.000Z','end','2017-05-23T01:00:00.000Z'));

disp(payload);
  • No labels