A GDS/OPENDAP(DODS) Server Example Using The Reanalysis II Data Set



The reanalysis II goes back to 1979 and reanalysis I to 1948.
They can be accessed through GDS/OPENDAP(DODS) on the NOMADS server:

http://nomad3.ncep.noaa.gov/ncep_data

and the backup server


http://nomads6.ncdc.noaa.gov/ncep_data


If you do not have experience writing these queries and know a little unix scripting, here is an example for a query that wants data at, say, the points beginning at the dateline and 45 N on the 2.5 degree grid and also points 20 degrees more North as well as East, four in all, using a stride of 8 X 2.5 degrees = 20: [54:8:61][72:8:80] for the reanalysis II first day (01/01/1979) is [0:0] which is the first time period and the "tmpprs" temperature variable in K, at the first level, 1000mb (surface), also "[0:0]". The information that describes these files is in a "metadata description", which are man and machine readable ascii web pages. This particular data set information can be found at

http://nomad3.ncep.noaa.gov:9090/dods/reanalysis-2/6hr/pgb/tmp.info

which gives the location of the data URL, which (happens to be) is the same as the .info address URL but .info becomes .ascii. 

There are some howto's at http://nomad3.ncep.noaa.gov

The query constraint values mentioned above are in order: http://nomad....ascii?<variable>[time1:stride:time2][level1:stride:level2][lat1:stride:lat2][lon1:stride:lon2]

For this data set, time [0:0] is 01/01/1979, which turns out to be the 722451.0 day since the year 1. Strides default to 1 and then need not be shown. The following will return 4 reanalysis 1000mb, temperatures points:

http://nomad3.ncep.noaa.gov:9090/dods/reanalysis-2/6hr/pgb/tmp.ascii?tmpprs
[0:0][0:0][54:8:61][72:8:80]

If the queries are removed then the entire field is returned.






Typing the above URL and constraints into any browser with no return the following text:
-------------------------------

tmpprs, [1][1][2][2]
[0][0][0], 277.8, 282.3
[0][0][1], 272.8, 271.4
                                                                               
                                                                               
                                                                               
time, [1]
722451.0
lev, [1]
1000.0
lat, [2]
45.0, 65.0
lon, [2]
180.0, 200.0
----------------------------------

note that the variable is returned, followed by the dimension of the query returned: one time, one level 2 lats, 2 lons, and each of the 4 temperature values 
returned are numbered (for each time) in a 3D array starting with the ith time, [0], kth level, [0], first lat [0] and two values at the 2 lons on the first line and the second line
has the next lat at the two lons ([0][0][1]).  Then the GDS part of the server delivers the time since the year 1, the level (in units in this case, mb as per the metadata description file) the two lats and lons so the first point returned is at (45,180), and along the 45 lat to the next point because we skipped 20 degrees or 8 points to (45,200), the two values are 277.8, 282.3
and then the next lat at (65,180) and then (65,200) with values 272.8, 271.4.

Of course, you want to issue these in a more automated fashion: 

Attached is a unix script "dods_box" that does this with the above URL and then prints (echos) out the results which could be used in product building. 
The output of running the script is also attached as output2.txt

This sort of script or idea even in another language can be changed on the fly and placed inside of loops to do many complex tasks.   If you do place these queries in loops then
also add  add a "sleep 20" (wait 20 seconds) inside the loop to stop run-away loops as today's common PC's can generate hundreds of queries per second which the server will
attempt to fulfill, but then our throttle will kick in and add a sleep 60.