Recipe: Matlab program as OPeNDAP client: Difference between revisions
Move from http to https |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 4: | Line 4: | ||
By accessing the collection <code>inst01hr_3d_T_Cv</code> via the OPeNDAP server | By accessing the collection <code>inst01hr_3d_T_Cv</code> via the OPeNDAP server | ||
https://opendap.nccs.nasa.gov/dods/OSSE/G5NR/Ganymed/7km | |||
we want to read the surface temperature data inside the box bound by latitudes 25<sup>o</sup>N, 50<sup>o</sup>N and longitudes -130<sup>o</sup>W, -65<sup>o</sup>W for 2006/Sep/18, 9z and compute its min/max. | we want to read the surface temperature data inside the box bound by latitudes 25<sup>o</sup>N, 50<sup>o</sup>N and longitudes -130<sup>o</sup>W, -65<sup>o</sup>W for 2006/Sep/18, 9z and compute its min/max. | ||
Line 12: | Line 12: | ||
The metadata for the collection <code>inst01hr_3d_T_Cv</code> is available at | The metadata for the collection <code>inst01hr_3d_T_Cv</code> is available at | ||
https://opendap.nccs.nasa.gov/dods/OSSE/G5NR/Ganymed/7km/0.5000_deg/inst/inst01hr_3d_T_Cv.info | |||
==== Code ==== | ==== Code ==== | ||
This code accesses the collection <code>inst01hr_3d_T_Cv</code> from the OPeNDAP server and reads a subset of the temperature data. | This code accesses the collection <code>inst01hr_3d_T_Cv</code> from the OPeNDAP server and reads a subset of the temperature data (all levels inside the bounding box specified above) and computes its max/min. It then computes the max/min of the above data at the surface (level=72). | ||
NOTE: | NOTE: | ||
Line 24: | Line 24: | ||
<syntaxhighlight lang="matlab" line> | <syntaxhighlight lang="matlab" line> | ||
% opendap url | % opendap url | ||
opdurl = ' | opdurl = 'https://opendap.nccs.nasa.gov:9090/dods/OSSE/G5NR/Ganymed/7km/0.5000_deg/inst/inst01hr_3d_T_Cv' | ||
% bounding box | % bounding box | ||
Line 57: | Line 57: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== | ==== Output ==== | ||
Running this MATLAB script, we get the output | |||
>> g5nr_reader | |||
opdurl = | |||
https://opendap.nccs.nasa.gov:9090/dods/OSSE/G5NR/Ganymed/7km/0.5000_deg/inst/inst01hr_3d_T_Cv | |||
Reading Tsub (subset of T)...done. | |||
max(Tsub): 305.604828 | |||
min(Tsub): 191.695648 | |||
max(Tsub at surface): 305.604828 | |||
min(Tsub at surface): 276.292328 | |||
Reading | |||
== Discussion == | == Discussion == |