Discovery methods allow you to search for available locations, deployments, device categories, devices, properties, and data products. They support numerous filters and might resemble an "advanced search" function for ONC data sources.
Some usage examples are:
- Obtain the codes required to use other API services
- Explore what's available in a certain location or device
- Obtain the deployment dates for a device
- List available data products for download in a particular device or location
Note that from the ONC API perspective:
- Locations can contain other locations (i.e. "Cambridge bay" may contain separate children locations for its underwater network and shore station)
- Locations can contain device categories, which contain devices, which contain properties
- You can also perform searches without considering the hierarchy mentioned above (i.e. search for locations with data on a specific property or search for all properties in a specific location)
Summary
Method | Description | |
---|---|---|
| Returns a filtered list of locations | link |
| Returns a filtered tree of locations with their children | link |
| Returns a filtered list of deployments | link |
| Returns a filtered list of device categories | link |
| Returns a filtered list of devices | link |
| Returns a filtered list of properties | link |
| Returns a filtered list of data products | link |
getLocations
Returns a filtered list of locations as a list of dictionary objects. Visit locations Discovery Service for more information on filter usage.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of locations returned. Valid filters:
When excluded, the method will return all locations available. |
|
Example: Print locations in North East Pacific with Hydrophones from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'locationCode': 'NEP', 'deviceCategoryCode': 'HYDROPHONE', 'includeChildren': 'true' # Include child locations of NEP in this search } result = onc.getLocations(filters) onc.print(result) |
Returns
A list of locations represented as dictionaries, with their detailed information.
Example of a returned location [ { "deployments": 50, "locationName": "Axis", "depth": 984.3076, "bbox": { "maxDepth": 987, "maxLat": 48.316837, "maxLon": -126.050125, "minDepth": 981, "minLat": 48.316517, "minLon": -126.05087 }, "description": "Canyon axis: benthic processes, biodiversity, sediment dynamics.", "hasDeviceData": "true", "lon": -126.05033, "locationCode": "BACAX", "hasPropertyData": "true", "lat": 48.31669, "dataSearchURL": "https://data.oceannetworks.ca/DataSearch?location=BACAX" } ] |
getLocationHierarchy
Returns a hierarchical tree of locations whose root is defined by the location code provided as filter.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary with the key locationCode which specifies the base location from which children locations will be obtained. If excluded, a tree with all locations is returned. |
|
Example - Print children of location with code STR01 from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'locationCode': 'STR01' } result = onc.getLocationHierarchy(filters) onc.print(result) |
Returns
A list of location objects.
Example of a returned location with 2 children [ { "locationName": "Neutrino Project Mooring 01 (Yellow)", "description": "TBD", "hasDeviceData": true, "locationCode": "STR01", "hasPropertyData": false, "children": [ { "locationName": "POCAM 110 mab", "children": null, "description": "", "hasDeviceData": "true", "locationCode": "STR01.PO1", "hasPropertyData": "false" }, { "locationName": "POCAM 50 mab", "children": null, "description": "", "hasDeviceData": "true", "locationCode": "STR01.PO2", "hasPropertyData": "false" } ] } ] |
getDeployments
Returns a filtered list of device deployments as a list of dictionary objects. Visit Deployments Discovery Service for more information on filter usage.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of device deployments returned. Valid filters: When excluded, the method will return all device deployments. |
|
Example - Get all deployments for a device from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'deviceCode': 'NORTEKADCP9917' } result = onc.getDeployments(filters) onc.print(result) |
Returns
A list of deployment objects.
Example of a returned deployment [ { "deviceCode": "NORTEKADCP9917", "locationCode": "BACWL", "begin": "2012-05-31T20:46:05.000Z", "end": "2014-05-10T01:40:00.000Z", "hasDeviceData": true, "lat": 48.311743, "lon": -126.065378, "depth": 860.0, "heading": null, "pitch": null, "roll": null } ] |
getDeviceCategories
Returns a filtered list of locations as a list of dictionary objects. Visit DeviceCategories Discovery Service for more information on filter usage.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of device categories returned. Valid filters: When excluded, the method will return all device categories available. |
|
Example - Get device categories available in a location from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'locationCode': 'NCBC' } result = onc.getDeviceCategories(filters) onc.print(result) |
Returns
A list of device categories represented as dictionaries, with their detailed information.
Example of a returned device category [ { "deviceCategoryCode": "CTD", "deviceCategoryName": "CTD", "description": "Conductivity Temperature (and Depth Sensor)", "longDescription": " Conductivity Temperature Depth (CTD) is an abbreviated name for an (...)", "hasDeviceData": "true", "cvTerm": { "deviceCategory": [ { "uri": "http://vocab.nerc.ac.uk/collection/L05/current/130/", "vocabulary": "SeaDataNet device categories" } ] } } ] |
getDevices
Returns a filtered list of devices as a list of dictionary objects. Visit devices Discovery Service for more information on filter usage.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of devices returned. Valid filters: When excluded, all devices are returned. |
|
Example - Get all devices deployed at a location in a time range from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'locationCode': 'BACAX', 'dateFrom': '2016-06-01T00:00:00.000Z', 'dateTo': '2017-05-31T23:59:59.999Z' } result = onc.getDevices(filters) onc.print(result) |
Returns
A list of devices represented as dictionaries, with their detailed information.
Example of a returned device [ { "deviceCode": "BC_POD1_AD2M", "deviceId": 11302, "deviceName": "Nortek Aquadopp HR-Profiler 2965", "deviceLink": "https://data.oceannetworks.ca/DeviceListing?DeviceId=11302", "cvTerm": { "device": [ { "uri": "http://vocab.nerc.ac.uk/collection/L22/current/TOOL0888/", "vocabulary": "SeaVoX Device Catalogue" } ] }, "dataRating": [ { "dateFrom": "2008-11-01T00:00:00.000Z", "dateTo": "2010-05-27T19:27:04.000Z", "samplePeriod": 1, "sampleSize": 1 }, { "dateFrom": "2010-05-27T19:27:04.000Z", "dateTo": "None", "samplePeriod": 10, "sampleSize": 1 } ] } ] |
getProperties
Returns a filtered list of properties as a list of dictionary objects. Visit Properties Discovery Service for more information on filter usage.
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of properties returned. Valid filters: When excluded, the method will return all properties available. |
|
Example - Get all properties available for a specific device from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'deviceCode': 'BC_POD1_AD2M' } result = onc.getProperties(filters) onc.print(result) |
Returns
A list of properties represented as dictionaries, with their detailed information.
Example of a property returned [ { "propertyCode": "soundspeed", "propertyName": "Sound Speed", "description": "Sound Speed: sound velocity sensor", "uom": "m/s", "hasDeviceData": true, "hasPropertyData": false, "cvTerm": { "property": [], "uom": [ { "uri": "http://vocab.nerc.ac.uk/collection/P06/current/UVAA/", "vocabulary": "BODC data storage units" } ] } } ] |
getDataProducts
Returns a filtered list of available data products as a list of dictionary objects. Visit DataProducts Discovery Service for more information on filter usage.
Data products can be downloaded using the methods for Delivery Services (requires the data product's code and extension).
Parameter | Type | Description | Example |
---|---|---|---|
filters | dictionary | A dictionary of one or more filters to refine the list of data products returned. Valid filters: When excluded, the method will return all data products available. |
|
Example - Get data products with .mat extension in a location from onc.onc import ONC onc = ONC('YOUR_TOKEN_HERE') filters = { 'locationCode': 'PHYD', 'extension': 'mat' } result = onc.getDataProducts(filters) onc.print(result) |
Returns
A list of data product descriptions represented as dictionaries, with their detailed information.
Example of a returned data product description [ { "dataProductCode": "TSSD", "dataProductName": "Time Series Scalar Data", "extension": "json", "hasDeviceData": true, "hasPropertyData": true, "helpDocument": "https://wiki.oceannetworks.ca/display/DP/1" } ] |