Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added getLocationHierarchy()

...

Code Block
languagepy
titleExample - Print all locations with 2 MHz ADCP deployed
linenumberstrue
collapsetrue
o = onc('YOUR_TOKEN_HERE');

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

getLocationHierarchy()

No Format
getLocationHierarchy(filters)

 

Returns a hierarchical subtree of locations whose root is defined by the input filter. In this case the only valid input filter is locationCode. In Oceans 2.0 Instruments and Variables are organized by Location so that users can easily drill down by place name or mobile platform name to find the instruments or properties they are interested in. 

 

Parameter

Type

Description

Example

Optional   
filtersstruct or array

A comma separated list of one or more filter criteria, used to return an exclusive set of location elements from the ONC locations 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.
  • Valid filters: locationCode
  • See locations Discovery Service for more information on filter usage.
struct('locationCode','BACAX')

or

{'locationCode','BACAX'}

 

Returns

A hierarchy of location objects.

Code Block
       locationName: 'Axis '
           children: null
              depth: 984.3076
        description: 'Depth: 985 m Latitude: 48.3167 Longitude: -126.0501 Type: Stationary platform Description: Canyon axis: benthic processes, biodiversity, sediment dynamics.'
      hasDeviceData: 'true'
       locationCode: 'BACAX'
    hasPropertyData: 'true'


Property

Type

Description

Example
location[]listA list of location structures. 
location[].locationNamestringThe full name of the location.
locationName: "Axis (POD 1)"
location[].depthdoubleThe average depth of the deployments.
depth75
location[].descriptionstringThe description of the location.
description: "Depth: 985 m Latitude: 48.3167 Longitude: -126.0501 Type: Stationary platform 
               Description: Canyon axis: benthic processes, biodiversity, sediment dynamics."
location[].hasDeviceDatastringIndicates that data products can be requrested using a device category for the location.
hasDeviceData: "true"
location[].locationCodestringA code that unquely identifies a location.
locationCode: "BACAX"
location[].hasPropertyDatastringIndicates that data products can be requested using property code for the location.
hasPropertyData: "true"


Code Block
languagepy
titleExample - Print locations at Barkley Upper South Slope
linenumberstrue
collapsetrue
o = onc('YOUR_TOKEN_HERE');

locations = o.getLocationHierarchy({'locationCode','BACUS'});
if isfield( locations, 'children' )
    for i = 1 : numel( locations.children )
        locations.children(i)
    end
end

 

 

getDevices()

No Format
getDevices(filters)

...