Accessing and Exploring Data Using GeoCODES and THREDDS Data Server

Table of Contents

Data Search

Use GeoCODES Search API

Use the GeoCODES search API to search for URLs from begin query to end query times
beginQuery = '2013-03-21T00:00:00Z';
endQuery = '2019-09-05T00:00:00Z';
searchURL = "https://geodex.org/api/dev/graph/temporal";
data = webread(searchURL,'b',beginQuery,'e',endQuery)
data = struct with fields:
Head: [11 struct] Results: [11 struct]
bindings = data.Results.Bindings;
URL = strings(length(bindings),1);
StartTime = URL;
EndTime = URL;
for k = 1:length(bindings)
StartTime(k,1) = bindings(k).begin.Value;
EndTime(k,1) = bindings(k).end.Value;
URL(k,1) = bindings(k).s.Value;
end
table(StartTime, EndTime, URL)
ans = 643 table
 StartTimeEndTimeURL
1"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Regional_Alaska/catalog.html?dataset=grib/NCEP/WW3/Regional_Alaska/Best"
2"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/Alaska_11km/catalog.html?dataset=grib/NCEP/NAM/Alaska_11km/Best"
3"2019-04-28T00:00:03.000Z""2019-05-28T18:58:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/NLDN/catalog.html?dataset=grib/NCEP/MRMS/NLDN/TP"
4"2019-04-28T00:00:00.000Z""2019-05-28T18:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/RTMA/CONUS_2p5km/catalog.html?dataset=grib/NCEP/RTMA/CONUS_2p5km/Best"
5"2019-04-28T00:00:00.000Z""2019-05-31T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/Alaska_95km/catalog.html?dataset=grib/NCEP/NAM/Alaska_95km/Best"
6"2019-04-28T00:00:00.000Z""2019-05-31T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_20km/noaaport/catalog.html?dataset=grib/NCEP/NAM/CONUS_20km/noaaport/Best"
7"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Regional_US_West_Coast/catalog.html?dataset=grib/NCEP/WW3/Regional_US_West_Coast/Best"
8"2019-04-28T00:00:00.000Z""2019-05-28T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GEFS/Global_1p0deg_Ensemble/members-analysis/catalog.html?dataset=grib/NCEP/GEFS/Global_1p0deg_Ensemble/members-analysis/TP"
9"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/Polar_90km/catalog.html?dataset=grib/NCEP/NAM/Polar_90km/Best"
10"2019-04-28T00:00:00.000Z""2019-05-28T18:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/RTMA/GUAM_2p5km/catalog.html?dataset=grib/NCEP/RTMA/GUAM_2p5km/TP"
11"2019-04-28T00:00:00.000Z""2019-06-13T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_onedeg/catalog.html?dataset=grib/NCEP/GFS/Global_onedeg/Best"
12"2019-04-28T00:00:00.000Z""2019-05-29T13:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/RAP/CONUS_40km/catalog.html?dataset=grib/NCEP/RAP/CONUS_40km/Best"
13"2019-04-28T00:00:31.000Z""2019-05-28T18:58:32.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/RotationTrackML/catalog.html?dataset=grib/NCEP/MRMS/RotationTrackML/TP"
14"2019-05-25T00:00:00.000Z""2019-05-29T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/HRRR/CONUS_2p5km/catalog.html?dataset=grib/NCEP/HRRR/CONUS_2p5km/Best"
15"2019-04-28T00:00:00.000Z""2019-06-03T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/FAROP/Global_1p0deg/catalog.html?dataset=grib/FNMOC/FAROP/Global_1p0deg/Best"
16"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/NAVGEM/Global_0p5deg/catalog.html?dataset=grib/FNMOC/NAVGEM/Global_0p5deg/Best"
17"2019-04-28T00:00:31.000Z""2019-05-28T18:58:32.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/RotationTrack/catalog.html?dataset=grib/NCEP/MRMS/RotationTrack/TP"
18"2019-04-28T00:00:00.000Z""2019-05-28T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/NCODA/Global_Ocean/catalog.html?dataset=grib/FNMOC/NCODA/Global_Ocean/TP"
19"2019-05-11T00:00:00.000Z""2019-06-10T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NDFD/CPC/CONUS/catalog.html?dataset=grib/NCEP/NDFD/CPC/CONUS/TP"
20"2019-04-28T03:00:00.000Z""2019-06-01T06:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/SREF/CONUS_40km/ensprod/catalog.html?dataset=grib/NCEP/SREF/CONUS_40km/ensprod/Best"
21"2019-04-28T00:00:00.000Z""2019-05-31T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/COAMPS/Western_Atlantic/catalog.html?dataset=grib/FNMOC/COAMPS/Western_Atlantic/Best"
22"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Regional_Eastern_Pacific/catalog.html?dataset=grib/NCEP/WW3/Regional_Eastern_Pacific/Best"
23"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_40km/conduit/catalog.html?dataset=grib/NCEP/NAM/CONUS_40km/conduit/Best"
24"2019-04-28T00:00:00.000Z""2019-06-01T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/COAMPS/Europe/catalog.html?dataset=grib/FNMOC/COAMPS/Europe/Best"
25"2019-04-28T00:00:00.000Z""2019-05-28T18:58:02.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/BaseRef/catalog.html?dataset=grib/NCEP/MRMS/BaseRef/TP"
26"2019-04-28T00:00:00.000Z""2019-06-13T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GEFS/Global_1p0deg_Ensemble/members/catalog.html?dataset=grib/NCEP/GEFS/Global_1p0deg_Ensemble/members/Best"
27"2019-04-28T00:00:00.000Z""2019-05-29T15:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/RAP/CONUS_13km/catalog.html?dataset=grib/NCEP/RAP/CONUS_13km/Best"
28"2019-04-28T00:00:00.000Z""2019-06-07T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Puerto_Rico_0p5deg/catalog.html?dataset=grib/NCEP/GFS/Puerto_Rico_0p5deg/Best"
29"2019-04-28T00:00:00.000Z""2019-05-31T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/Alaska_45km/noaaport/catalog.html?dataset=grib/NCEP/NAM/Alaska_45km/noaaport/Best"
30"2019-05-25T00:00:00.000Z""2019-05-30T03:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/HRRR/CONUS_3km/wrfprs/catalog.html?dataset=grib/HRRR/CONUS_3km/wrfprs/Best"
31"2019-04-28T00:00:00.000Z""2019-06-01T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/WW3/Europe/catalog.html?dataset=grib/FNMOC/WW3/Europe/Best"
32"2019-04-28T00:00:00.000Z""2019-05-28T18:58:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/Precip/catalog.html?dataset=grib/NCEP/MRMS/Precip/TP"
33"2019-04-28T03:00:00.000Z""2019-06-01T06:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/SREF/PacificNE_0p4/ensprod/catalog.html?dataset=grib/NCEP/SREF/PacificNE_0p4/ensprod/Best"
34"2019-05-25T00:00:00.000Z""2019-05-29T11:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/HRRR/CONUS_3km/surface/catalog.html?dataset=grib/HRRR/CONUS_3km/surface/Best"
35"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Coastal_US_West_Coast/catalog.html?dataset=grib/NCEP/WW3/Coastal_US_West_Coast/Best"
36"2019-04-28T00:00:00.000Z""2019-06-07T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/CONUS_95km/catalog.html?dataset=grib/NCEP/GFS/CONUS_95km/Best"
37"2019-04-28T00:00:38.000Z""2019-05-28T18:58:38.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/Radar/catalog.html?dataset=grib/NCEP/MRMS/Radar/TP"
38"2019-04-28T00:00:00.000Z""2019-05-31T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_80km/catalog.html?dataset=grib/NCEP/NAM/CONUS_80km/Best"
39"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Coastal_US_East_Coast/catalog.html?dataset=grib/NCEP/WW3/Coastal_US_East_Coast/Best"
40"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_12km/conduit/catalog.html?dataset=grib/NCEP/NAM/CONUS_12km/conduit/Best"
41"2019-05-01T06:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NDFD/NWS/CONUS/NOAAPORT/catalog.html?dataset=grib/NCEP/NDFD/NWS/CONUS/NOAAPORT/Best"
42"2019-04-28T00:00:00.000Z""2019-06-13T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg/catalog.html?dataset=grib/NCEP/GFS/Global_0p5deg/Best"
43"2019-04-28T00:00:00.000Z""2019-06-07T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/CONUS_80km/catalog.html?dataset=grib/NCEP/GFS/CONUS_80km/Best"
44"2019-04-28T12:00:00.000Z""2019-05-31T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NDFD/SPC/CONUS/catalog.html?dataset=grib/NCEP/NDFD/SPC/CONUS/Best"
45"2019-05-25T00:00:00.000Z""2019-05-28T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg_ana/catalog.html?dataset=grib/NCEP/GFS/Global_0p25deg_ana/TP"
46"2019-04-28T00:00:00.000Z""2019-06-07T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Pacific_40km/catalog.html?dataset=grib/NCEP/GFS/Pacific_40km/Best"
47"2019-04-28T00:00:00.000Z""2019-05-28T18:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/MRMS/Model/catalog.html?dataset=grib/NCEP/MRMS/Model/TP"
48"2019-04-28T00:00:00.000Z""2019-06-01T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/COAMPS/Northeast_Pacific/catalog.html?dataset=grib/FNMOC/COAMPS/Northeast_Pacific/Best"
49"2019-04-28T00:00:00.000Z""2019-06-01T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/COAMPS/Equatorial_America/catalog.html?dataset=grib/FNMOC/COAMPS/Equatorial_America/Best"
50"2019-04-28T00:00:00.000Z""2019-05-28T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg_ana/catalog.html?dataset=grib/NCEP/GFS/Global_0p5deg_ana/TP"
51"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/Alaska_45km/conduit/catalog.html?dataset=grib/NCEP/NAM/Alaska_45km/conduit/Best"
52"2019-04-28T00:00:00.000Z""2019-06-01T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_12km/catalog.html?dataset=grib/NCEP/NAM/CONUS_12km/Best"
53"2019-05-25T00:00:00.000Z""2019-06-13T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg/catalog.html?dataset=grib/NCEP/GFS/Global_0p25deg/Best"
54"2019-05-25T00:00:00.000Z""2019-05-28T18:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/HRRR/CONUS_2p5km_ANA/catalog.html?dataset=grib/NCEP/HRRR/CONUS_2p5km_ANA/TP"
55"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/WW3/Global_1p0deg/catalog.html?dataset=grib/FNMOC/WW3/Global_1p0deg/Best"
56"2019-04-28T03:00:00.000Z""2019-06-01T06:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/SREF/Alaska_45km/ensprod/catalog.html?dataset=grib/NCEP/SREF/Alaska_45km/ensprod/Best"
57"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Global/catalog.html?dataset=grib/NCEP/WW3/Global/Best"
58"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Regional_US_East_Coast/catalog.html?dataset=grib/NCEP/WW3/Regional_US_East_Coast/Best"
59"2019-04-28T00:00:00.000Z""2019-06-01T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/FNMOC/COAMPS/Southern_California/catalog.html?dataset=grib/FNMOC/COAMPS/Southern_California/Best"
60"2019-04-28T00:00:00.000Z""2019-05-28T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_onedeg_ana/catalog.html?dataset=grib/NCEP/GFS/Global_onedeg_ana/TP"
61"2019-04-28T00:00:00.000Z""2019-06-13T12:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/GEFS/Global_1p0deg_Ensemble/derived/catalog.html?dataset=grib/NCEP/GEFS/Global_1p0deg_Ensemble/derived/Best"
62"2019-04-28T06:00:00.000Z""2019-06-01T06:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/SREF/CONUS_40km/ensprod_biasc/catalog.html?dataset=grib/NCEP/SREF/CONUS_40km/ensprod_biasc/Best"
63"2019-04-28T00:00:00.000Z""2019-06-05T00:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Coastal_Alaska/catalog.html?dataset=grib/NCEP/WW3/Coastal_Alaska/Best"
64"2019-04-28T00:00:00.000Z""2019-05-29T16:00:00.000Z""https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/RAP/CONUS_20km/catalog.html?dataset=grib/NCEP/RAP/CONUS_20km/Best"

Obtain URL to Data on THREDDS Test Data Server Using GeoCODES

Encapsulate into a live script function
urlPath = "NCEP/WW3/Regional_US_East_Coast";
tdsURL = geocodesSearch(beginQuery, endQuery, urlPath)
tdsURL = "https://thredds-test.unidata.ucar.edu/thredds/catalog/grib/NCEP/WW3/Regional_US_East_Coast/catalog.html?dataset=grib/NCEP/WW3/Regional_US_East_Coast/Best"
uri = matlab.net.URI(tdsURL);
server = uri.Scheme + "://" + uri.Host
server = "https://thredds-test.unidata.ucar.edu"
dataset = extractAfter(uri.EncodedQuery, "dataset=")
dataset = "grib/NCEP/WW3/Regional_US_East_Coast/Best"
web(tdsURL,'-browser')

Extract OPeNDAP URL

xmlURL = replace(tdsURL, '.html','.xml');
xml = webread(xmlURL);
opendapServiceType = extractBefore(extractAfter(xml,"OPENDAP"),"service ");
opendapPath = extractBefore(extractAfter(opendapServiceType,'base="'),'"')
opendapPath = '/thredds/dodsC/'
opendapURL = server + opendapPath + dataset
opendapURL = "https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best"
opendapAccessFormURL = opendapURL + ".html"
opendapAccessFormURL = "https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best.html"
web(opendapAccessFormURL,'-browser')

Data Import

Obtain OPeNDAP Data Information

ncdisp(opendapURL)
Source: https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best Format: classic Global Attributes: Originating_or_generating_Center = 'US National Weather Service, National Centres for Environmental Prediction (NCEP)' Originating_or_generating_Subcenter = '0' GRIB_table_version = '2,1' Type_of_generating_process = 'Forecast' Analysis_or_forecast_generating_process_identifier_defined_by_originating_centre = 'Global Multi-Grid Wave Model (Static Grids)' file_format = 'GRIB-2' Conventions = 'CF-1.6' history = 'Read using CDM IOSP GribCollection v3' featureType = 'GRID' _CoordSysBuilder = 'ucar.nc2.dataset.conv.CF1Convention' Dimensions: lat = 331 lon = 301 ordered_sequence_of_data = 2 time = 285 Variables: lat Size: 331x1 Dimensions: lat Datatype: single Attributes: units = 'degrees_north' _CoordinateAxisType = 'Lat' lon Size: 301x1 Dimensions: lon Datatype: single Attributes: units = 'degrees_east' _CoordinateAxisType = 'Lon' time Size: 285x1 Dimensions: time Datatype: double Attributes: units = 'Hour since 2019-05-12T00:00:00Z' standard_name = 'time' long_name = 'GRIB forecast or observation time' calendar = 'proleptic_gregorian' _CoordinateAxisType = 'Time' reftime Size: 285x1 Dimensions: time Datatype: double Attributes: standard_name = 'forecast_reference_time' long_name = 'GRIB reference time' calendar = 'proleptic_gregorian' units = 'Hour since 2019-05-12T00:00:00Z' _CoordinateAxisType = 'RunTime' ordered_sequence_of_data Size: 2x1 Dimensions: ordered_sequence_of_data Datatype: single Attributes: units = 'count' long_name = 'Ordered Sequence of Data' positive = 'up' Grib_level_type = 241 _CoordinateAxisType = 'GeoZ' _CoordinateZisPositive = 'up' LatLon_Projection Size: 1x1 Dimensions: Datatype: int32 Attributes: grid_mapping_name = 'latitude_longitude' earth_radius = 6371229 _CoordinateTransformType = 'Projection' _CoordinateAxisTypes = 'Lat Lon' Direction_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Attributes: long_name = 'Direction of swell waves @ Ordered Sequence of Data' units = 'degree_true' abbreviation = 'SWDIR' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time ordered_sequence_of_data lat lon ' Grib_Variable_Id = 'VAR_7-0--1-7_L241' Grib2_Parameter = [10 0 7] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Direction of swell waves' Grib2_Level_Type = 241 Grib2_Level_Desc = 'Ordered Sequence of Data' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Mean_period_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Attributes: long_name = 'Mean period of swell waves @ Ordered Sequence of Data' units = 's' abbreviation = 'SWPER' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time ordered_sequence_of_data lat lon ' Grib_Variable_Id = 'VAR_7-0--1-9_L241' Grib2_Parameter = [10 0 9] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Mean period of swell waves' Grib2_Level_Type = 241 Grib2_Level_Desc = 'Ordered Sequence of Data' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Significant_height_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Attributes: long_name = 'Significant height of swell waves @ Ordered Sequence of Data' units = 'm' abbreviation = 'SWELL' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time ordered_sequence_of_data lat lon ' Grib_Variable_Id = 'VAR_7-0--1-8_L241' Grib2_Parameter = [10 0 8] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Significant height of swell waves' Grib2_Level_Type = 241 Grib2_Level_Desc = 'Ordered Sequence of Data' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Wave_Steepness_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Wave Steepness @ Ground or water surface' units = '' abbreviation = 'WSTP' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-192_L1' Grib2_Parameter = [10 0 192] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Wave Steepness' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Wind_direction_from_which_blowing_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Wind direction (from which blowing) @ Ground or water surface' units = 'degree_true' abbreviation = 'WDIR' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-0_L1' Grib2_Parameter = [0 2 0] Grib2_Parameter_Discipline = 'Meteorological products' Grib2_Parameter_Category = 'Momentum' Grib2_Parameter_Name = 'Wind direction (from which blowing)' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Wind_speed_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Wind speed @ Ground or water surface' units = 'm/s' abbreviation = 'WIND' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-1_L1' Grib2_Parameter = [0 2 1] Grib2_Parameter_Discipline = 'Meteorological products' Grib2_Parameter_Category = 'Momentum' Grib2_Parameter_Name = 'Wind speed' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' u-component_of_wind_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'u-component of wind @ Ground or water surface' units = 'm/s' abbreviation = 'UGRD' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-2_L1' Grib2_Parameter = [0 2 2] Grib2_Parameter_Discipline = 'Meteorological products' Grib2_Parameter_Category = 'Momentum' Grib2_Parameter_Name = 'u-component of wind' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Significant_height_of_combined_wind_waves_and_swell_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Significant height of combined wind waves and swell @ Ground or water surface' units = 'm' abbreviation = 'HTSGW' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-3_L1' Grib2_Parameter = [10 0 3] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Significant height of combined wind waves and swell' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' v-component_of_wind_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'v-component of wind @ Ground or water surface' units = 'm/s' abbreviation = 'VGRD' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-3_L1' Grib2_Parameter = [0 2 3] Grib2_Parameter_Discipline = 'Meteorological products' Grib2_Parameter_Category = 'Momentum' Grib2_Parameter_Name = 'v-component of wind' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Direction_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Direction of wind waves @ Ground or water surface' units = 'degree_true' abbreviation = 'WVDIR' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-4_L1' Grib2_Parameter = [10 0 4] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Direction of wind waves' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Significant_height_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Significant height of wind waves @ Ground or water surface' units = 'm' abbreviation = 'WVHGT' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-5_L1' Grib2_Parameter = [10 0 5] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Significant height of wind waves' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Mean_period_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Mean period of wind waves @ Ground or water surface' units = 's' abbreviation = 'WVPER' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-6_L1' Grib2_Parameter = [10 0 6] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Mean period of wind waves' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Primary_wave_direction_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Primary wave direction @ Ground or water surface' units = 'degree_true' abbreviation = 'DIRPW' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-10_L1' Grib2_Parameter = [10 0 10] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Primary wave direction' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1' Primary_wave_mean_period_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Attributes: long_name = 'Primary wave mean period @ Ground or water surface' units = 's' abbreviation = 'PERPW' missing_value = NaN grid_mapping = 'LatLon_Projection' coordinates = 'reftime time lat lon ' Grib_Variable_Id = 'VAR_7-0--1-11_L1' Grib2_Parameter = [10 0 11] Grib2_Parameter_Discipline = 'Oceanographic products' Grib2_Parameter_Category = 'Waves' Grib2_Parameter_Name = 'Primary wave mean period' Grib2_Level_Type = 1 Grib2_Level_Desc = 'Ground or water surface' Grib2_Generating_Process_Type = 'Forecast' Grib2_Statistical_Process_Type = 'UnknownStatType--1'
ncdisp(opendapURL,'/','min')
Source: https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best Format: classic Variables: lat Size: 331x1 Dimensions: lat Datatype: single lon Size: 301x1 Dimensions: lon Datatype: single time Size: 285x1 Dimensions: time Datatype: double reftime Size: 285x1 Dimensions: time Datatype: double ordered_sequence_of_data Size: 2x1 Dimensions: ordered_sequence_of_data Datatype: single LatLon_Projection Size: 1x1 Dimensions: Datatype: int32 Direction_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Mean_period_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Significant_height_of_swell_waves_ordered_sequence_of_data Size: 301x331x2x285 Dimensions: lon,lat,ordered_sequence_of_data,time Datatype: single Wave_Steepness_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Wind_direction_from_which_blowing_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Wind_speed_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single u-component_of_wind_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Significant_height_of_combined_wind_waves_and_swell_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single v-component_of_wind_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Direction_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Significant_height_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Mean_period_of_wind_waves_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Primary_wave_direction_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single Primary_wave_mean_period_surface Size: 301x331x285 Dimensions: lon,lat,time Datatype: single
opendapInfo = ncinfo(opendapURL)
opendapInfo = struct with fields:
Filename: 'https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best' Name: '/' Dimensions: [14 struct] Variables: [120 struct] Attributes: [110 struct] Groups: [] Format: 'classic'
variables = string({opendapInfo.Variables.Name})'
variables = 201 string array
"lat" "lon" "time" "reftime" "ordered_sequence_of_data" "LatLon_Projection" "Direction_of_swell_waves_ordered_sequence_of_data" "Mean_period_of_swell_waves_ordered_sequence_of_data" "Significant_height_of_swell_waves_ordered_sequence_of_data" "Wave_Steepness_surface" "Wind_direction_from_which_blowing_surface" "Wind_speed_surface" "u-component_of_wind_surface" "Significant_height_of_combined_wind_waves_and_swell_surface" "v-component_of_wind_surface" "Direction_of_wind_waves_surface" "Significant_height_of_wind_waves_surface" "Mean_period_of_wind_waves_surface" "Primary_wave_direction_surface" "Primary_wave_mean_period_surface"

Convert Start Time of Data to Datetime

index = variables == "time";
disp(opendapInfo.Variables(index))
Name: 'time' Dimensions: [11 struct] Size: 285 Datatype: 'double' Attributes: [15 struct] ChunkSize: [] FillValue: [] DeflateLevel: [] Shuffle: 0
startTime = opendapInfo.Variables(index).Attributes(1).Value
startTime = 'Hour since 2019-05-12T00:00:00Z'
startTime = extractAfter(startTime, 'Hour since ')
startTime = '2019-05-12T00:00:00Z'
startTime = datetime(startTime,'InputFormat','yyyy-MM-dd''T''HH:mm:SSZ','TimeZone','UTC')
startTime = datetime 12-May-2019 00:00:00

Read Coordinate Data: lat, lon, t

lat = ncread(opendapURL,'lat');
lon = ncread(opendapURL,'lon');
t = ncread(opendapURL,'time') + 1;

Compute Limits and Grid

latlim = double([min(lat) max(lat)]);
lonlim = double([min(lon) max(lon)]);
[latGrid, lonGrid] = meshgrid(lat, lon);

Obtain Units of Variable

varname = "Wind_speed_surface";
varinfo = ncinfo(opendapURL, varname)
varinfo = struct with fields:
Filename: 'https://thredds-test.unidata.ucar.edu/thredds/dodsC/grib/NCEP/WW3/Regional_US_East_Coast/Best' Name: 'Wind_speed_surface' Dimensions: [13 struct] Size: [301 331 285] Datatype: 'single' Attributes: [115 struct] ChunkSize: [] FillValue: [] DeflateLevel: [] Shuffle: 0 Format: 'classic'
units = varinfo.Attributes(contains(string({varinfo.Attributes.Name}),'units')).Value
units = 'm/s'

Read 3-Dimensional Data

index = 100;
data = ncread(opendapURL,varname,[1 1 index],[inf inf, 1]);

Data Display

Display 3-Dimensional Data as Surface

figure
surface(lonGrid,latGrid,data,'EdgeColor','none')
Use datetime and duration to calculate time of observation
observationTime = string(startTime + hours(t(index)));
title([varname; "Time = " + observationTime],'Interpreter','none')

Create a Map using Mapping Toolbox

load('coastlines','coastlat','coastlon')
figure
worldmap(latlim, lonlim)
geoshow(latGrid,lonGrid,data,'DisplayType','surface')
geoshow(coastlat,coastlon,'Color','k')
colorbar
title([varname; "Time = " + observationTime],'Interpreter','none')

Create a Contour Map using Mapping Toolbox

c = parula;
c(1,:) = [1 1 1];
figure('Colormap',c)
worldmap(latlim, lonlim)
geoshow(latGrid,lonGrid,data,'DisplayType','texture')
geoshow(coastlat,coastlon,'Color','k')
[~,h] = contourm(double(latGrid),double(lonGrid),double(data),'color','k');
xData = [h.Children.XData];
yData = [h.Children.YData];
[latData,lonData] = minvtran(xData, yData);
cb = contourcbar();
cb.XLabel.String = replace(varname,'_',' ') + " " + units;
title([varname; "Time = " + observationTime],'Interpreter','none')