+
Getting Started
+
Contents
+
+
Before using the library
+
You'll need a token to access all the web services.
+
+
How to get a token?
+
+ - Register for an Oceans 3.0 account at https://data.oceannetworks.ca/Registration.
+ - Log into your account at https://data.oceannetworks.ca by clicking the Log In link.
+ - Click the Profile link (top right corner) to access your account profile.
+ - Access the Web Services API tab and click Copy Token.
+ - If you forget your token, you can always find it in your Oceans 3.0 account profile.
+
+
+
Then, use the token to create an Onc object like
+
+ - Directly, run
+
onc = Onc('YOUR TOKEN HERE');
+
+ - Save the token in a file named 'TOKEN' and run
+
onc = Onc(readToken);
+
+ - with other parameters like output path
+
onc = Onc(readToken, 'outPath', 'YOUR_DESTINATION_FOLDER');
+
+
+
For more information about creating an Onc object, see ONC Class
+
+
+
Note
+
+ - It's important to check that you are using the latest version. Outdated version may results in bugs.
+ - When you run Onc() to create an Onc object, it will run a version check and prints out version outdated warning if fails. How to update to latest version.
+
+
+
+
General Tutorial - 1. Searching with discovery services
+
Check sections in the left panel for full documentation, source code and examples on each service.
+
To download data from Ocean Networks Canada's database (Oceans 3.0) , you need to specify the type of data you are interested in
+ and where in particular (i.e. location, from specific instrument (device)) it originates from.
+ In the Oceans 3.0 API, there are a unique codes that identify every location, device, property, data product type, etc.
+ You include these codes in a group of filters to retrieve the information you're interested in.
+ The Oceans 3.0 API Discovery services allow you to explore the hierarchy of ONC's database to obtain the codes required for your filters
+ to obtain the information/data you are interested in (they work like a "search" function).
+
+
The example below uses the getLocations method, which is querying the locations database tables that include "Bullseye" in
+ their name (i.e. "Clayoquot Slope Bullseye Vent"). It returns a list with all locations that match the search filters provided.
+
Using ONC library
+
+params = {'locationName', 'Bullseye'};
+
+onc.getLocations(params)
+
+
Using MATLAB's HTTP library
+
+params.locationName = 'Bullseye';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/locations';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+response = request.send(uri,options);
+response.Body.Data
+
+
+ ans =
+ deployments: 38
+ locationName: 'Bullseye'
+ depth: 1.2569e+03
+ bbox: [1x1 struct]
+ description: ' Bullseye is a location at Clayoquot Slope, where gas hydrates, seafloor cold seeps, and hydrate dynamics are observed.'
+ hasDeviceData: 1
+ lon: -126.8480
+ locationCode: 'NC89'
+ hasPropertyData: 0
+ lat: 48.6706
+ dataSearchURL: 'https://data.oceannetworks.ca/DataSearch?location=NC89'
+
+
Each entry of this list contains more meta data information for that location, e.g. the locationName, the geographical coordinates and depth,
+ a description field and the URL for Oceans 3.0 Data Search tool. The parameter locationCode contains the string "NC89", which is needed for the next steps.
+
1.1 What device categories are available here at the location NC89?
+
Using ONC library
+
+params = {'locationCode', 'NC89'};
+
+onc.getDeviceCategories(params)
+
+
Using MATLAB's HTTP library
+
+params.locationCode = 'NC89';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/deviceCategories';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+response = request.send(uri,options);
+response.Body.Data
+
+
ans = 13×1 struct
+
+
+
+ Fields
+ |
+
+ cvTerm
+ |
+
+ description
+ |
+
+ deviceCategoryCode
+ |
+
+ deviceCategoryName
+ |
+
+ hasDeviceData
+ |
+
+ longDescription
+ |
+
+
+
+
+
+ 1
+ |
+
+ 1×1 struct
+ |
+
+ 'Acoustic Doppler Current Profiler 55 kHz '
+ |
+
+ 'ADCP55KHZ'
+ |
+
+ 'Acoustic Doppler Current Profiler 55 kHz'
+ |
+
+ 1
+ |
+
+ ' Acoustic Doppler Current Profilers are hydroacoustic instruments, similar to sonars. ADCPs measure current speed and direction at multiple predetermined depths simultaneously. ADCPs use the Doppler effect of sound waves that are scattered by particles in seawater over a depth range.'
+ |
+
+
+
+ 2
+ |
+
+ 1×1 struct
+ |
+
+ 'Acoustic Doppler Current Profiler 75 kHz '
+ |
+
+ 'ADCP75KHZ'
+ |
+
+ 'Acoustic Doppler Current Profiler 75 kHz'
+ |
+
+ 1
+ |
+ ' Acoustic Doppler Current Profilers (ADCP) are hydroacoustic instruments, similar to sonars. ADCPs measure current speed and direction at multiple predetermined depths simultaneously. ADCPs use the Doppler effect of sound waves that are scattered by particles in seawater over a depth range.' |
+
3 | 1×1 struct |
+ 'Broadband Seismometer' |
+ 'BBS' |
+ 'Broadband Seismometer' |
+ 1 |
+ ' Broadband Seismometers measure seismic waves over a broad frequency range depending on the device (e.g. 0.00278 Hz - 250 Hz). A broadband seismometer facilitates measurement of seismic events in the widest frequency band possible.' |
+
---|
4 | 1×1 struct |
+ 'Bottom Pressure Recorder' |
+ 'BPR' |
+ 'Bottom Pressure Recorder' |
+ 1 |
+ ' Bottom Pressure Recorders (BPR) are instruments that can detect small changes in pressure on the seafloor. ' |
+
---|
5 | 1×1 struct |
+ 'Controlled Source Electromagnetic Method' |
+ 'CSEM' |
+ 'Controlled Source Electromagnetic Method' |
+ 1 |
+ ' The Controlled Source Electromagnetic Method (CSEM) measures sub-surface resistivity structure through the measurement of the electromegnetic fields resulting from stimulation by a towed source.' |
+
---|
6 | 1×1 struct |
+ 'Conductivity Temperature (and Depth Sensor)' |
+ 'CTD' |
+ 'Conductivity Temperature Depth' |
+ 1 |
+ ' Conductivity Temperature Depth (CTD) is an instrument package that contains sensors for measuring the conductivity, temperature, and pressure of seawater. Salinity, sound velocity, depth and density are variables that can be derived from sensor measurements. CTDs can carry additional instruments and sensors such as oxygen sensors, turbidity sensors and fluorometers.' |
+
---|
7 | 1×1 struct |
+ 'Current Meter' |
+ 'CURRENTMETER' |
+ 'Current Meter' |
+ 1 |
+ ' Acoustic Current Meters (ACM) measure current speed and direction, using the Doppler Effect. Aquadopp current meters have a sensor head that contains 3 acoustic transducers, a tilt sensor, a temperature sensor and a pressure sensor. The instrument transmits a short pulse of sound, and then listens to its echo to measure the change in pitch or frequency. The change in pitch can determine the velocity of the current.' |
+
---|
8 | 1×1 struct |
+ 'Gravimeter' |
+ 'GRAVIMETER' |
+ 'Gravimeter' |
+ 1 |
+ ' Gravimeters (or gravity meters) measure the gravity field of the Earth with such a resolution that they can detect very small changes in the underlying or surrounding structures.' |
+
---|
9 | 1×1 struct |
+ 'Junction Box' |
+ 'JB' |
+ 'Junction Box' |
+ 1 |
+ ' Junction Boxes supply power and communications to deployed instruments. Junction boxes have a number of serial and ethernet ports, including 400V ethernet ports that enable connections to other junction boxes and high-voltage instruments. Junction boxes can convert high voltages to lower voltages (15V, 24V or 48V) required by many instruments.' |
+
---|
10 | 1×1 struct |
+ 'Oxygen Sensor' |
+ 'OXYSENSOR' |
+ 'Oxygen Sensor' |
+ 1 |
+ ' Oxygen sensors measure dissolved oxygen concentration in seawater.' |
+
---|
11 | 1×1 struct |
+ 'Pan Tilt Lights' |
+ 'PTL' |
+ 'Pan Tilt Lights' |
+ 1 |
+ ' Pan Tilt Lights are used for cameras and allow remotely controlled operations such as changing the camera's field of view and illuminating the subject matter.' |
+
---|
12 | 1×1 struct |
+ 'Tiltmeter' |
+ 'TILTMTR' |
+ 'Tiltmeter' |
+ 1 |
+ ' A tiltmeter is a sensitive inclinometer designed to measure very small changes from the vertical level, either on the ground or in structures.' |
+
---|
13 | 1×1 struct |
+ 'Video Camera' |
+ 'VIDEOCAM' |
+ 'Video Camera' |
+ 1 |
+ ' Video cameras record video of characteristics of the surrounding environments and can be deployed on fixed and mobile platforms.' |
+
---|
+
+
1.2 What properties are available for the device category CTD at this location NC89?
+
Using ONC library
+
+params = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD'};
+
+onc.getProperties(params)
+
+
+
Using MATLAB's HTTP library
+
+params.locationCode = 'NC89';
+params.deviceCategoryCode = 'CTD';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/properties';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+response = request.send(uri,options);
+response.Body.Data
+
+
ans = 8×1 struct
+
+
+ Fields |
+ cvTerm |
+ description |
+ hasDeviceData |
+ hasPropertyData |
+ propertyCode |
+ propertyName |
+ uom |
+
+
+
+
+ 1 |
+ 1×1 struct | 'Conductivity: siemens per metre' | 1 | 1 | 'conductivity' | 'Conductivity' | 'S/m' |
2 |
+ 1×1 struct | 'Density' | 1 | 1 | 'density' | 'Density' | 'kg/m3' |
---|
3 |
+ 1×1 struct | 'Pressure' | 1 | 1 | 'pressure' | 'Pressure' | 'decibar' |
---|
4 |
+ 1×1 struct | 'Salinity' | 1 | 1 | 'salinity' | 'Salinity' | 'psu' |
---|
5 |
+ 1×1 struct | 'Temperature: sea water' | 1 | 1 | 'seawatertemperature' | 'Sea Water Temperature' | 'C' |
---|
6 |
+ 1×1 struct | 'Sigma-t' | 1 | 1 | 'sigmat' | 'Sigma-t' | 'kg/m3' |
---|
7 |
+ 1×1 struct | 'Sigma-theta' | 1 | 1 | 'sigmatheta' | 'Sigma-theta' | 'kg/m3' |
---|
8 |
+ 1×1 struct | 'Sound Speed: sound velocity sensor' | 1 | 1 | 'soundspeed' | 'Sound Speed' | 'm/s' |
+
+
+
+
+
1.3 What data product types are available for the device category CTD at this location NC89?
+
Using ONC library
+
+params = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD'};
+
+onc.getDataProducts(params)
+
+
Using MATLAB's HTTP library
+
+params.locationCode = 'NC89';
+params.deviceCategoryCode = 'CTD';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/dataProducts';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+response = request.send(uri,options);
+response.Body.Data
+
+
ans = 9×1 struct
+
+
+ Fields |
+ dataProductCode |
+ dataProductName |
+ dataProductOptions |
+ extension |
+ hasDeviceData |
+ hasPropertyData |
+ helpDocument |
+
+
+
+
+ 1 |
+ 'LF' | 'Log File' | 3×1 struct | 'txt' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/4' |
2 |
+ 'MSQAQCR' | 'Manual Scalar QAQC Results' | 2×1 struct | 'qaqc' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/106' |
---|
3 |
+ 'SBCTDRF' | 'Sea-Bird CTD Raw Files' | [] | 'hex' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/78' |
---|
4 |
+ 'TSSD' | 'Time Series Scalar Data' | 8×1 struct | 'json' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/1' |
---|
5 |
+ 'TSSD' | 'Time Series Scalar Data' | 5×1 struct | 'csv' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/1' |
---|
6 |
+ 'TSSD' | 'Time Series Scalar Data' | 5×1 struct | 'mat' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/1' |
---|
7 |
+ 'TSSD' | 'Time Series Scalar Data' | 5×1 struct | 'txt' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/1' |
---|
8 |
+ 'TSSP' | 'Time Series Scalar Plot' | 5×1 struct | 'pdf' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/2' |
---|
9 |
+ 'TSSP' | 'Time Series Scalar Plot' | 4×1 struct | 'png' | 1 | 0 | 'https://wiki.oceannetworks.ca/display/DP/2' |
+
+
+
+
+
+
+
General Tutorial - 2. Downloading data
+
Check sections in the left panel for full documentation, source code and examples on each service.
+
Once you determine the exact filters that identify the information you are interested in, there are different methods available to download data.
+
+
+ - Near real-time scalar data sensor readings for a given timeframe
+ - Near real-time raw data for a given timeframe
+ - Download archived files containing raw data or processed data
+ - Download data products that are also available via Oceans 3.0 Data Search Tool
+
+
+
2.1 Near real-time scalar data download
+
In this example we want to download one minute of Pressure sensor data from a CTD at location "Bullseye" (locationCode: NC89)
+
Using ONC library
+
+params = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD', ...
+ 'dateFrom', '2017-01-20T00:00:00.000Z', ...
+ 'propertyCode', 'pressure', ...
+ 'dateTo', '2017-01-20T00:01:00.000Z', ...
+ };
+
+
+result = onc.getDirectByLocation(params);
+
+
Using MATLAB's HTTP library
+
+params.locationCode = 'NC89';
+params.deviceCategoryCode = 'CTD';
+params.dateFrom = '2017-01-20T00:00:00.000Z';
+params.propertyCode = 'pressure';
+params.dateTo = '2017-01-20T00:01:00.000Z';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/scalardata/location';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+result = request.send(uri,options);
+
+
+fieldnames(result)
+
ans = 'citations'
'messages'
'next'
'parameters'
'queryUrl'
'sensorData'
+
+struct2table(result.sensorData(1).data)
+
+
ans = 240×3 table
+
+
+ |
+ qaqcFlags |
+ sampleTimes |
+ values |
+
+
+
+
+ 1 |
+ 1 | '2017-01-20T00:00:00.025Z' | 1.2707e+03 |
2 |
+ 1 | '2017-01-20T00:00:00.275Z' | 1.2707e+03 |
---|
3 |
+ 1 | '2017-01-20T00:00:00.525Z' | 1.2707e+03 |
---|
4 |
+ 1 | '2017-01-20T00:00:00.775Z' | 1.2707e+03 |
---|
5 |
+ 1 | '2017-01-20T00:00:01.025Z' | 1.2707e+03 |
---|
6 |
+ 1 | '2017-01-20T00:00:01.275Z' | 1.2707e+03 |
---|
7 |
+ 1 | '2017-01-20T00:00:01.525Z' | 1.2707e+03 |
---|
8 |
+ 1 | '2017-01-20T00:00:01.775Z' | 1.2707e+03 |
---|
9 |
+ 1 | '2017-01-20T00:00:02.025Z' | 1.2707e+03 |
---|
10 |
+ 1 | '2017-01-20T00:00:24.775Z' | 1.2707e+03 |
---|
â‹® |
+
+
+
+
2.2 Near real-time raw data readings
+
In this example we want to download one minute of raw data from a CTD at location "Bullseye" (locationCode: NC89)
+
Using ONC library
+
+params = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD', ...
+ 'dateFrom', '2020-06-20T00:00:00.000Z', ...
+ 'dateTo', '2020-06-20T00:01:00.000Z', ...
+ };
+
+result = onc.getDirectRawByLocation(params);
+
+
+
Using MATLAB's HTTP library
+
+params.locationCode = 'NC89';
+params.deviceCategoryCode = 'CTD';
+params.dateFrom = '2020-06-20T00:00:00.000Z';
+params.dateTo = '2020-06-20T00:01:00.000Z';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'http://data.oceannetworks.ca/api/rawdata/location';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params)
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+result = request.send(uri,options);
+
+
+fieldnames(result)
+
ans = 'citations'
'data'
'messages'
'metadata'
'next'
'outputFormat'
'queryUrl'
+
+struct2table(result.data)
+
+
ans = 60×3 table
+
+
+ |
+ lineTypes |
+ readings |
+ times |
+
+
+
+
+ 1 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.229</p1><ser1><type>sbe63</type><oxph>38.099</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4819</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:00.843Z' |
+
+
+ 2 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089873</oxtv></ser1><sal> 34.4821</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:01.842Z' |
+
+ 3 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16667</c1><p1>1269.217</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:02.840Z' |
+
+ 4 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8524</t1><c1> 3.16667</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:03.838Z' |
+
+ 5 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8525</t1><c1> 3.16669</c1><p1>1269.216</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089874</oxtv></ser1><sal> 34.4822</sal><sv>1482.012</sv></data></datapacket>' |
+ '2020-06-20T00:00:04.837Z' |
+
+ 6 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8526</t1><c1> 3.16670</c1><p1>1269.225</p1><ser1><type>sbe63</type><oxph>38.097</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4822</sal><sv>1482.013</sv></data></datapacket>' |
+ '2020-06-20T00:00:05.837Z' |
+
+
+ â‹® |
+ ... |
+ ... |
+ ... |
+
+
+
+
+
+
2.2.1. Downloading more data
+
+
Pagination of response due to too many data rows
+
If the row of the data is above 100,000, not all the data will be returned. The rest of the data can be queried based on the next key in the response.
+
+ - If you use onc library.
getDirectRawByLocation supports a boolean allPages parameter. When set to True, it will try to retrieve all the pages.
+ - If you use MATLAB's HTTP library.
You have to manually query the next pages until the next key in the response json is None, and concatenate all the data together.
+
+
+
Using ONC library
+
+paramsLongerRange = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD', ...
+ 'dateFrom', '2020-06-20T00:00:00.000Z', ...
+ 'dateTo', '2020-06-22T00:00:00.000Z', ...
+ };
+
+result = onc.getDirectRawByLocation(paramsLongerRange, 'allPages', true)
+struct2table(result.data)
+
+
+ Data size is greater than the row limit and will be downloaded in multiple pages.
+ Estimated approx. 1 pages
+ Estimated approx. 5.79 seconds to complete
+
+ (100000 samples) Downloading page 2...
+ (172796 samples) Completed in 2.25 seconds.
+result =
citations: [1×1 struct]
+ data: [1×1 struct]
+ messages: []
+ metadata: [1×1 struct]
+ next: []
+ outputFormat: 'array'
+ queryUrl: 'https://data.oceannetworks.ca/api/rawdata?locationCode=NC89&deviceCategoryCode=CTD&dateFrom=2020-06-20T00:00:00.000Z&dateTo=2020-06-22T00:00:00.000Z&method=getByLocation&token=YOUR_TOKEN'
+
+
+
ans = 172796×3 table
+
+
+ |
+ lineTypes |
+ readings |
+ times |
+
+
+
+
+ 1 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.229</p1><ser1><type>sbe63</type><oxph>38.099</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4819</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:00.843Z' |
+
+ 2 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089873</oxtv></ser1><sal> 34.4821</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:01.842Z' |
+
+ 3 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16667</c1><p1>1269.217</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:02.840Z' |
+
+ 4 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8524</t1><c1> 3.16667</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:03.838Z' |
+
+ 5 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8525</t1><c1> 3.16669</c1><p1>1269.216</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089874</oxtv></ser1><sal> 34.4822</sal><sv>1482.012</sv></data></datapacket>' |
+ '2020-06-20T00:00:04.837Z' |
+
+ 6 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8526</t1><c1> 3.16670</c1><p1>1269.225</p1><ser1><type>sbe63</type><oxph>38.097</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4822</sal><sv>1482.013</sv></data></datapacket>' |
+ '2020-06-20T00:00:05.837Z' |
+
+ 7 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8528</t1><c1> 3.16670</c1><p1>1269.229</p1><ser1><type>sbe63</type><oxph>38.098</oxph><oxtv>1.089862</oxtv></ser1><sal> 34.4820</sal><sv>1482.013</sv></data></datapacket>' |
+ '2020-06-20T00:00:06.838Z' |
+
+ 8 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8529</t1><c1> 3.16671</c1><p1>1269.226</p1><ser1><type>sbe63</type><oxph>38.098</oxph><oxtv>1.089857</oxtv></ser1><sal> 34.4820</sal><sv>1482.014</sv></data></datapacket>' |
+ '2020-06-20T00:00:07.842Z' |
+
+ 9 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8530</t1><c1> 3.16672</c1><p1>1269.224</p1><ser1><type>sbe63</type><oxph>38.099</oxph><oxtv>1.089849</oxtv></ser1><sal> 34.4819</sal><sv>1482.014</sv></data></datapacket>' |
+ '2020-06-20T00:00:08.837Z' |
+
+
+ â‹® |
+
+
+
+
+
Using MATLAB's HTTP library
+
+paramsLongerRange.locationCode = 'NC89';
+paramsLongerRange.deviceCategoryCode = 'CTD';
+paramsLongerRange.dateFrom = '2020-06-20T00:00:00.000Z';
+paramsLongerRange.dateTo = '2020-06-22T00:00:00.000Z';
+paramsLongerRange.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'http://data.oceannetworks.ca/api/rawdata/location';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(paramsLongerRange);
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+result = request.send(uri,options);
+
+
+
+struct2table(result.Body.Data.data)
+
+
ans = 100000×3 table
+
+
+ |
+ lineTypes |
+ readings |
+ times |
+
+
+
+
+ 1 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.229</p1><ser1><type>sbe63</type><oxph>38.099</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4819</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:00.843Z' |
+
+ 2 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16666</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089873</oxtv></ser1><sal> 34.4821</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:01.842Z' |
+
+ 3 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8523</t1><c1> 3.16667</c1><p1>1269.217</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:02.840Z' |
+
+ 4 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8524</t1><c1> 3.16667</c1><p1>1269.223</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089870</oxtv></ser1><sal> 34.4820</sal><sv>1482.011</sv></data></datapacket>' |
+ '2020-06-20T00:00:03.838Z' |
+
+ 5 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8525</t1><c1> 3.16669</c1><p1>1269.216</p1><ser1><type>sbe63</type><oxph>38.096</oxph><oxtv>1.089874</oxtv></ser1><sal> 34.4822</sal><sv>1482.012</sv></data></datapacket>' |
+ '2020-06-20T00:00:04.837Z' |
+
+ 6 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8526</t1><c1> 3.16670</c1><p1>1269.225</p1><ser1><type>sbe63</type><oxph>38.097</oxph><oxtv>1.089869</oxtv></ser1><sal> 34.4822</sal><sv>1482.013</sv></data></datapacket>' |
+ '2020-06-20T00:00:05.837Z' |
+
+ 7 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8528</t1><c1> 3.16670</c1><p1>1269.229</p1><ser1><type>sbe63</type><oxph>38.098</oxph><oxtv>1.089862</oxtv></ser1><sal> 34.4820</sal><sv>1482.013</sv></data></datapacket>' |
+ '2020-06-20T00:00:06.838Z' |
+
+ 8 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8529</t1><c1> 3.16671</c1><p1>1269.226</p1><ser1><type>sbe63</type><oxph>38.098</oxph><oxtv>1.089857</oxtv></ser1><sal> 34.4820</sal><sv>1482.014</sv></data></datapacket>' |
+ '2020-06-20T00:00:07.842Z' |
+
+ 9 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8530</t1><c1> 3.16672</c1><p1>1269.224</p1><ser1><type>sbe63</type><oxph>38.099</oxph><oxtv>1.089849</oxtv></ser1><sal> 34.4819</sal><sv>1482.014</sv></data></datapacket>' |
+ '2020-06-20T00:00:08.837Z' |
+
+
+ â‹® |
+
+
+
+
+
Now check the parameter field "next"
+
+result.Body.Data.next
+result.Body.Data.next.parameters
+
+
ans = parameters: [1×1 struct]
+ url: 'https://data.oceannetworks.ca/api/rawdata/location?dateTo=2020-06-22T00%3A00%3A00.000Z&locationCode=NC89&deviceCategoryCode=CTD&dateFrom=2020-06-21T03%3A46%3A42.044Z&token=YOUR_TOKEN'
+
+ans = dateTo: '2020-06-22T00:00:00.000Z'
+ locationCode: 'NC89'
+ deviceCategoryCode: 'CTD'
+ dateFrom: '2020-06-21T03:46:42.044Z'
+ token: 'YOUR_TOKEN'
+
+
+
Update the dateFrom parameter to get the next page
+
+paramsLongerRange.dateFrom = result.Body.Data.next.parameters.dateFrom;
+uri.Query = matlab.net.QueryParameter(paramsLongerRange);
+result = request.send(uri,options);
+struct2table(result.Body.Data.data)
+
+
ans = 72796×3 table
+
+
+ |
+ lineTypes |
+ readings |
+ times |
+
+
+
+ 1 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8635</t1><c1> 3.16756</c1><p1>1269.622</p1><ser1><type>sbe63</type><oxph>38.117</oxph><oxtv>1.089511</oxtv></ser1><sal> 34.4807</sal><sv>1482.064</sv></data></datapacket>' |
+ '2020-06-21T03:46:43.045Z' |
+
+ 2 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8636</t1><c1> 3.16755</c1><p1>1269.626</p1><ser1><type>sbe63</type><oxph>38.124</oxph><oxtv>1.089509</oxtv></ser1><sal> 34.4806</sal><sv>1482.064</sv></data></datapacket>' |
+ '2020-06-21T03:46:44.044Z' |
+
+ 3 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16757</c1><p1>1269.629</p1><ser1><type>sbe63</type><oxph>38.125</oxph><oxtv>1.089508</oxtv></ser1><sal> 34.4807</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:45.043Z' |
+
+ 4 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16758</c1><p1>1269.626</p1><ser1><type>sbe63</type><oxph>38.123</oxph><oxtv>1.089506</oxtv></ser1><sal> 34.4808</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:46.043Z' |
+
+ 5 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16758</c1><p1>1269.629</p1><ser1><type>sbe63</type><oxph>38.122</oxph><oxtv>1.089506</oxtv></ser1><sal> 34.4808</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:47.047Z' |
+
+ 6 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16758</c1><p1>1269.620</p1><ser1><type>sbe63</type><oxph>38.123</oxph><oxtv>1.089511</oxtv></ser1><sal> 34.4809</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:48.048Z' |
+
+ 7 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16757</c1><p1>1269.624</p1><ser1><type>sbe63</type><oxph>38.123</oxph><oxtv>1.089504</oxtv></ser1><sal> 34.4807</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:49.044Z' |
+
+ 8 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16758</c1><p1>1269.630</p1><ser1><type>sbe63</type><oxph>38.121</oxph><oxtv>1.089502</oxtv></ser1><sal> 34.4807</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:50.058Z' |
+
+ 9 |
+ ' ' |
+ '<?xml version="1.0"?><datapacket><hdr><mfg>Sea-Bird</mfg><model>19plus</model><sn>01907035</sn></hdr><data><t1> 2.8637</t1><c1> 3.16756</c1><p1>1269.632</p1><ser1><type>sbe63</type><oxph>38.120</oxph><oxtv>1.089501</oxtv></ser1><sal> 34.4806</sal><sv>1482.065</sv></data></datapacket>' |
+ '2020-06-21T03:46:51.042Z' |
+
+ â‹® |
+
+
+
+
Now check the parameter field "next" again
+
+result.Body.Data.next
+
+
ans =
+
+ []
+
+
2.3. Downloading archived files
+
A faster way to download data products and processed data files that are available in Oceans 3.0 (if it suits your needs) is to leverage how ONC scripts
+auto-generate and archive data products of different types at set time intervals. You can directly download these data product files from our files archive, as long as you know their unique filename.
+
In the following example, we get the list of archived files available for a camera (deviceCategoryCode: VIDEOCAM) at Ridley Island (locationCode: RISS) for 5-minute timerange.
+
Using ONC library
+
+params = {'locationCode', 'RISS', ...
+ 'deviceCategoryCode', 'VIDEOCAM', ...
+ 'dateFrom', '2016-12-01T00:00:00.000Z', ...
+ 'dateTo', '2016-12-01T00:05:00.000Z', ...
+ };
+
+result = onc.getListByLocation(params);
+result.files
+
+
ans =
+'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z.mp4'
'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z.an'
'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z-VideoQAQCResults.an'
'AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg'
+
+
Using MATLAB's HTTP library
+
+params = struct();
+params.locationCode = 'RISS';
+params.deviceCategoryCode = 'VIDEOCAM';
+params.dateFrom = '2016-12-01T00:00:00.000Z';
+params.dateTo = '2016-12-01T00:05:00.000Z';
+params.token = 'YOUR TOKEN HERE';
+
+
+request = matlab.net.http.RequestMessage;
+url = 'https://data.oceannetworks.ca/api/archivefile/location';
+uri = matlab.net.URI(url);
+uri.Query = matlab.net.QueryParameter(params);
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+result = request.send(uri,options);
+result.Body.Data.files
+
+
ans = 'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z.mp4'
'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z.an'
'AXISQ6044PTZACCC8E334C53_20161201T000000.000Z-VideoQAQCResults.an'
'AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg'
+
+
Once we have the file names, you can use the method "getFile()" to download individual files:
+
Using ONC library
+
+onc.getFile('AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg', 'overwrite', true)
+
+
Downloading file "AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg"...
+ [==================================================] 100%
+ File was downloaded to "AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg"
+ans = url: 'https://data.oceannetworks.ca/api/archivefiles?method=getFile&filename=AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg&token=YOUR_TOKEN'
+ status: 'completed'
+ size: 113511
+ downloadTime: 0.8380
+ file: "AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg"
+
+
+
Using MATLAB's HTTP library
+
+params.filename = 'AXISQ6044PTZACCC8E334C53_20161201T000001.000Z.jpg';
+params.token = 'YOUR TOKEN HERE';
+
+url_location = 'https://data.oceannetworks.ca/api/archivefile/download';
+request = matlab.net.http.RequestMessage;
+uri = matlab.net.URI(url_location);
+uri.Query = matlab.net.QueryParameter(params);
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+result = request.send(uri,options);
+
+
+
2.4 Downloading data products
+
Other than using Oceans 3.0 Data Search, we can request the ONC server to generate a data product. This is done through the data product delivery services methods.
+
+
Hint
+
This service should ONLY be used when the requested files are not already provided using the ArchiveFiles services (see 2.3 above).
+ The data product delivery services will re-generate files using ONC's web machines and this process can often take very long time to generate these results.
+ If you request data files for very long-time ranges and large file sizes, ONCs system will sometimes slow down and stall and requires some manual actions.
+
We therefore encourage you to check other services before requesting data through this service. If you are unsure what to use feel free to contact u.
+
+
This process will require three steps before you will be able to see the downloaded data product on your computer:
+
+
+ - Request the data.
+ - Run the Request.
+ - Download the data.
+
+
+
The following example downloads two PNG files with plots for 30 minutes of data from a CTD (find them in the "output" folder beside this jupyter notebook).
+ The filter includes codes for location, deviceCategory, and dataProduct, as well as the file extension and a time interval.
+ They also include a couple of filters to configure this specific data product type (starting with the "dpo_" prefix) which can be obtained from the Data Product Options documentation. You can download more than 120 different types of data products including audio & video.
+
Using ONC library
+
ONCs library contains all three steps (methods) in one call. So this is the preferred library to use over the requests library.
+
+params = {'locationCode', 'NC89', ...
+ 'deviceCategoryCode', 'CTD', ...
+ 'dataProductCode', 'TSSP', ...
+ 'extension', 'png', ...
+ 'dateFrom', '2017-01-19T00:00:00.000Z', ...
+ 'dateTo', '2017-01-19T00:30:00.000Z', ...
+ 'dpo_qualityControl', '1', ...
+ 'dpo_resample', 'none', ...
+ };
+
+result = onc.orderDataProduct(params)
+
+
Requesting data product...
+Request Id: 18690549
+Estimated File Size: 185 kB
+Estimated Processing Time: 20 s
+
+To cancel this data product, visit url:
+ https://data.oceannetworks.ca/api/dataProductDelivery?method=cancel&token=YOUR_TOKEN&dpRequestId=18690549
+
+ queued
+ data product running.......
+ complete
+
+Downloading data product files with runId 40531301...
+
+ Search complete, waiting on the file system to synchronize (ClayoquotSlope_Bullseye_ConductivityTemperatureDepth_20170119T000000Z_20170119T003000Z-clean.png)....
+ Downloaded "ClayoquotSlope_Bullseye_ConductivityTemperatureDepth_20170119T000000Z_20170119T003000Z-clean.png"
+
+ Downloaded "ClayoquotSlope_Bullseye_ConductivityTemperatureDepth_20170119T000000Z_20170119T003000Z-clean_PNG_META.xml"
+
+Download process finished.
+
+
+Total run time: 0.17 seconds
+Total download Time: 0.688 seconds
+2 files (124.37 KB) downloaded
+result =
downloadResults: [1×2 struct]
+ stats: [1×1 struct]
+
+
+downloadResults1 = result.downloadResults(1)
+downloadResults2 = result.downloadResults(2)
+stats = result.stats
+
+
+
downloadResults1 =
+
url: 'https://data.oceannetworks.ca/api/dataProductDelivery?method=download&token=YOUR_TOKEN&dpRunId=40531301&index=1'
+ status: 'complete'
+ statusCode: OK
+ size: 111106
+ file: 'ClayoquotSlope_Bullseye_ConductivityTemperatureDepth_20170119T000000Z_20170119T003000Z-clean.png'
+ index: '1'
+ downloaded: 1
+ requestCount: 6
+fileDownloadTime: 0.3850
+
+
+downloadResults2 =
url: 'https://data.oceannetworks.ca/api/dataProductDelivery?method=download&token=YOUR_TOKEN&dpRunId=40531301&index=meta'
+ status: 'complete'
+ statusCode: OK
+ size: 13264
+ file: 'ClayoquotSlope_Bullseye_ConductivityTemperatureDepth_20170119T000000Z_20170119T003000Z-clean_PNG_META.xml'
+ index: 'meta'
+ downloaded: 1
+ requestCount: 1
+fileDownloadTime: 0.3030
+
+
+
stats =
+
+
runTime: 0.1710
+ downloadTime: 0.6880
+ requestCount: 17
+ totalSize: 124370
+
+
+
Using MATLAB's HTTP library
+
+params = struct();
+params.locationCode = 'NC89';
+params.deviceCategoryCode = 'CTD';
+params.dataProductCode = 'TSSP';
+params.extension = 'png';
+params.dateFrom = '2017-01-19T00:00:00.000Z';
+params.dateTo = '2017-01-19T00:30:00.000Z';
+params.dpo_qualityControl = '1';
+params.dpo_resample = 'none';
+params.token = readToken;
+
+url_location = 'https://data.oceannetworks.ca/api/dataProductDelivery/request';
+request = matlab.net.http.RequestMessage;
+uri = matlab.net.URI(url_location);
+uri.Query = matlab.net.QueryParameter(params);
+
+
+options = matlab.net.http.HTTPOptions();
+options.ConnectTimeout = 120;
+
+
+requestResponse = request.send(uri,options);
+result = requestResponse.Body.Data
+
+
+
result =
citations: [1×1 struct]
+ disclaimer: 'Software Developers are implementing estimates of processing times and file sizes for data requests. These are extremely rough to begin with, but bear with us. We expect these estimates will gradually improve.'
+ dpRequestId: 18690550
+ estimatedFileSize: '185 kB'
+estimatedProcessingTime: '20 s'
+ messages: []
+ queryPids: 25848930
+ queryURL: 'https://data.oceannetworks.ca/api/dataProductDelivery/request?locationCode=NC89&deviceCategoryCode=CTD&dataProductCode=TSSP&extension=png&dateFrom=2017-01-19T00:00:00.000Z&dateTo=2017-01-19T00:30:00.000Z&token=YOUR_TOKEN&dpo_resample=none&dpo_resample=none&dpo_qualityControl=1'
+
+
+
+
+url_run = 'https://data.oceannetworks.ca/api/dataProductDelivery/run';
+
+requestID = requestResponse.Body.Data.dpRequestId;
+params_run = struct();
+params_run.dpRequestId = requestID;
+params_run.token = readToken;
+
+request = matlab.net.http.RequestMessage;
+uri = matlab.net.URI(url_run);
+uri.Query = matlab.net.QueryParameter(params_run);
+runResponse = request.send(uri,options);
+result = runResponse.Body.Data
+
+
result =
dpRunId: 40531302
+ fileCount: 0
+ status: 'queued'
+
+
+
+runId = response(1).dpRunId
+
+
runId = 40531302
+
+
+url_download = 'https://data.oceannetworks.ca/api/dataProductDelivery/download';
+params_download = struct();
+params_download.dpRunId = runId;
+params_download.token = readToken;
+params_download.index = '1';
+request = matlab.net.http.RequestMessage;
+uri = matlab.net.URI(url_download);
+uri.Query = matlab.net.QueryParameter(params_download);
+
+
+downloadResponse = request.send(uri,options);
+result = downloadResponse.Body.Data
+responseCode = double(downloadResponse.StatusCode)
+
+
+
result =
message: 'Running'
+ status: 'running'
+
+responseCode = 202
+
+
+
Another option to get the data
+
Obtain your downloads from your user FTP directory (More -> User Directory) in Oceans 3.0. Navigate to the folder that contains the runId: You will see the files in this folder.
+
+
+
+
+
diff --git a/doc/Index.html b/doc/Index.html
new file mode 100644
index 0000000..8a11bfd
--- /dev/null
+++ b/doc/Index.html
@@ -0,0 +1,158 @@
+
+
+ Returns: The Onc object created.
-For detailed information and usage examples, run doc command or visit MATLAB's help browser https://data.oceannetworks.ca/Profile then find Ocean Networks Canada API Client under supplemental software
+For detailed information and usage examples, run doc command or visit MATLAB's help browser https://www.mathworks.com/help/matlab/ then find Ocean Networks Canada API Client under supplemental software
+