The metadata is very rich and informative. A quick way to get to the data is to read dap endpoint with xarray.
importcf_xarray# noqaimportxarrayasxr# Get this specific glider because it looks cool ;-)fordeploymentindeployments:ifdeployment["name"]=="sp064-20161214T1913":url=deployment["dap"]ds=xr.open_dataset(url)ds
Timestamp corresponding to the mid-point of the profile.
ioos_category :
Time
long_name :
Profile Time
observation_type :
calculated
platform :
platform
standard_name :
time
time_origin :
01-JAN-1970 00:00:00
[931 values with dtype=datetime64[ns]]
latitude
(trajectory, profile)
float64
...
_CoordinateAxisType :
Lat
actual_range :
[31.09158 33.40872]
ancillary_variables :
profile_lat_qc
axis :
Y
colorBarMaximum :
90.0
colorBarMinimum :
-90.0
comment :
Value is interpolated to provide an estimate of the latitude at the mid-point of the profile.
ioos_category :
Location
long_name :
Profile Latitude
observation_type :
calculated
platform :
platform
standard_name :
latitude
units :
degrees_north
valid_max :
90.0
valid_min :
-90.0
[931 values with dtype=float64]
longitude
(trajectory, profile)
float64
...
_CoordinateAxisType :
Lon
actual_range :
[-122.64472 -117.44867]
ancillary_variables :
profile_lon_qc
axis :
X
colorBarMaximum :
180.0
colorBarMinimum :
-180.0
comment :
Value is interpolated to provide an estimate of the longitude at the mid-point of the profile.
ioos_category :
Location
long_name :
Profile Longitude
observation_type :
calculated
platform :
platform
standard_name :
longitude
units :
degrees_east
valid_max :
180.0
valid_min :
-180.0
[931 values with dtype=float64]
lat_uv
(trajectory, profile)
float64
...
actual_range :
[31.09545 33.40885]
ancillary_variables :
lat_uv_qc
colorBarMaximum :
90.0
colorBarMinimum :
-90.0
comment :
The depth-averaged current is an estimate of the net current measured while the glider is underwater. The value is calculated over the entire underwater segment, which may consist of 1 or more dives.
ioos_category :
Location
long_name :
Depth-averaged Latitude
observation_type :
calculated
platform :
platform
standard_name :
latitude
units :
degrees_north
valid_max :
90.0
valid_min :
-90.0
[931 values with dtype=float64]
lon_uv
(trajectory, profile)
float64
...
actual_range :
[-122.63925 -117.44905]
ancillary_variables :
lon_uv_qc
colorBarMaximum :
180.0
colorBarMinimum :
-180.0
comment :
The depth-averaged current is an estimate of the net current measured while the glider is underwater. The value is calculated over the entire underwater segment, which may consist of 1 or more dives.
ioos_category :
Location
long_name :
Depth-averaged Longitude
observation_type :
calculated
platform :
platform
standard_name :
longitude
units :
degrees_east
valid_max :
180.0
valid_min :
-180.0
[931 values with dtype=float64]
time_uv
(trajectory, profile)
datetime64[ns]
...
actual_range :
[1.48174767e+09 1.49080815e+09]
ancillary_variables :
time_uv_qc
comment :
The depth-averaged current is an estimate of the net current measured while the glider is underwater. The value is calculated over the entire underwater segment, which may consist of 1 or more dives.
ioos_category :
Time
long_name :
Depth-averaged Time
observation_type :
calculated
standard_name :
time
time_origin :
01-JAN-1970 00:00:00
[931 values with dtype=datetime64[ns]]
depth
(trajectory, profile, obs)
float32
...
_CoordinateAxisType :
Height
_CoordinateZisPositive :
down
actual_range :
[ -8.817897 506.1147 ]
ancillary_variables :
depth_qc
axis :
Z
colorBarMaximum :
2000.0
colorBarMinimum :
0.0
colorBarPalette :
OceanDepth
instrument :
instrument_ctd
ioos_category :
Location
long_name :
Depth
observation_type :
calculated
platform :
platform
positive :
down
reference_datum :
sea-surface
standard_name :
depth
units :
m
valid_max :
2000.0
valid_min :
0.0
[341677 values with dtype=float32]
wmo_id
(trajectory)
object
...
ioos_category :
Identifier
long_name :
WMO ID
[1 values with dtype=object]
profile_id
(trajectory, profile)
float64
...
actual_range :
[ 2 932]
cf_role :
profile_id
comment :
Sequential profile number within the trajectory. This value is unique in each file that is part of a single trajectory/deployment.
ioos_category :
Identifier
long_name :
Profile ID
valid_max :
2147483647
valid_min :
1
[931 values with dtype=float64]
u
(trajectory, profile)
float64
...
actual_range :
[-0.17374186 0.21554044]
ancillary_variables :
u_qc
colorBarMaximum :
0.5
colorBarMinimum :
-0.5
comment :
The depth-averaged current is an estimate of the net current measured while the glider is underwater. The value is calculated over the entire underwater segment, which may consist of 1 or more dives.
ioos_category :
Currents
long_name :
Depth-averaged Eastward Sea Water Velocity
observation_type :
calculated
platform :
platform
standard_name :
eastward_sea_water_velocity
units :
m s-1
valid_max :
10.0
valid_min :
-10.0
[931 values with dtype=float64]
v
(trajectory, profile)
float64
...
actual_range :
[-0.18477483 0.15863204]
ancillary_variables :
v_qc
colorBarMaximum :
0.5
colorBarMinimum :
-0.5
comment :
The depth-averaged current is an estimate of the net current measured while the glider is underwater. The value is calculated over the entire underwater segment, which may consist of 1 or more dives.
The data may be used and redistributed for free but is not intended for legal use, since it may contain inaccuracies. No person or group associated with this data makes any warranty, express or implied, including warranties of merchantability and fitness for a particular purpose, or assumes any legal liability for the accuracy, completeness, or usefulness, of this information.
Metadata_Conventions :
Unidata Dataset Discovery v1.0, COARDS, CF-1.6
naming_authority :
edu.ucsd.spray
Northernmost_Northing :
33.40872
platform_type :
Spray Glider
processing_level :
Automatic QC has been done to this real time data.
project :
Scripps Institution of Oceanography Instrument Development Group
publisher_email :
drudnick@ucsd.edu
publisher_name :
Scripps Institution of Oceanography Instrument Development Group
publisher_url :
http:/spray.ucsd.edu
references :
Sherman, J., R.E. Davis, W.B. Owens and J. Valdes, 2001. The autonomous underwater glider 'Spray.' IEEE Oceanic Eng., 26, 437-446.
Rudnick, D. L., R. E. Davis, C. C. Eriksen, D. M. Fratantoni, and M. J. Perry, 2004. Underwater gliders for ocean research. Mar. Tech. Soc. J., 38, 73-84.
There are many things the user can do with the API.
Here is another example that finds all glider deployments within a boundary box.
bbox=[[-125.72,32.60],[-117.57,36.93]]
The cell below defines two helper functions to parse the geometry from the JSON and convert the trajectory to a shapely LineString to prepare the data for GIS operations later.
fromshapely.geometryimportLineStringdefparse_geometry(geometry):""" Filters out potentially bad coordinate pairs as returned from GliderDAC. Returns a safe geometry object. :param dict geometry: A GeoJSON Geometry object """forgeomingeometry["features"]:ifgeom["geometry"]["type"]=="LineString":coordinates=geom["geometry"]["coordinates"]breakcoords=[]forlon,latincoordinates:iflonisNoneorlatisNone:continuecoords.append([lon,lat])return{"coordinates":coords}deffetch_trajectory(deployment):""" Downloads the track as GeoJSON from GliderDAC :param dict deployment: The deployment object as returned from GliderDAC """track_url=f"https://gliders.ioos.us/status/api/tracks.php?dataset_id={deployment['name']}&type=full"response=requests.get(track_url)ifresponse.status_code!=200:raiseOSError(f"Failed to get Glider Track for {deployment["deployment_dir"]}")geometry=parse_geometry(response.json())coords=LineString(geometry["coordinates"])returncoords
Now it is easy to check which tracks lie inside the box.
res=response.json()["results"]len(res[-100:])
100
fromshapely.geometryimportboxsearch_box=box(bbox[0][0],bbox[0][1],bbox[1][0],bbox[1][1])inside=dict()# Getting only the first 20 deployments.fordeploymentinresponse.json()["results"][0:21]:try:coords=fetch_trajectory(deployment)exceptOSError:continueifsearch_box.intersects(coords):inside.update({deployment["name"]:coords})
Finally, we can create an interactive map displaying the tracks found in the bounding box.