How to use Ferret and DODS to access and analyze remote data

Below is an annotated version of the dods_demo.jnl


! *********************************************************
! DEMO: Using Ferret and DODS to access remote data sets
! *********************************************************

! First we will examine the COADS climatology dataset from the Pacific
! Marine Environmental Laboratory (PMEL) in Seattle, Washington.

! Note: Once the dataset has been initialized from the remote site,
! using the dataset is exactly the same as if it were local

yes? USE ""
yes? show data

     currently SET data sets:
     currently SET data sets:
    1>  (default)
 name     title                             I         J         K         L
 SST      SEA SURFACE TEMPERATURE          1:180     1:90      ...       1:12
 AIRT     AIR TEMPERATURE                  1:180     1:90      ...       1:12
 SPEH     SPECIFIC HUMIDITY                1:180     1:90      ...       1:12
 WSPD     WIND SPEED                       1:180     1:90      ...       1:12
 UWND     ZONAL WIND                       1:180     1:90      ...       1:12
 VWND     MERIDIONAL WIND                  1:180     1:90      ...       1:12
 SLP      SEA LEVEL PRESSURE               1:180     1:90      ...       1:12

! SHOW DATA verifies that this is indeed a remote dataset

! Now let's look at a color contour of Sea Surface Temperature

yes? FILL/T="16-jul" sst
yes? GO land

! Next, let's look at a subregion of the SST.
! Note: Higher data access speed may be noticed due to data caching by Ferret

yes? GO BASEMAP X=130E:170W Y=30N:70N 20
yes? FILL/OVERLAY/T="16-jul"/X=140E:180E/Y=40N:65N sst

! Remote data has full random access. Here we will plot the evolution of SST
! averaged over the Equatorial waveguide (an XT section)

yes? fill/x=140e:180e/l=1:24 sst[y=5s:5n@ave]

! Now, let's use a different dataset, with ocean temperature, the NODC World Ocean Atlas 1998 ! computed by Levitus and served by the Climate Diagnostics Center (CDC) in Boulder, Colorado

yes? USE ""
yes? SHOW DATA 2

     currently SET data sets:
    2>  (default)
 name     title                             I         J         K         L
 OTEMP    Ocean Temperature, analyzed mea  1:360     1:180     1:24      1:12

! This data set contains monthly mean global grids at a number of depths

! Let's look at the surface temperature for June, in the
! North Atlantic

yes? FILL/T="15-jun-1998"/Z=0/X=80W:20E/Y=0:80N otemp[D=2]
yes? GO fland 20

! Now, let's see where the NOCD field (served from Boulder)
! exceeds the June COADS climatological data (served from Seattle)

! This requires regridding the 2x2 degree COADS data to the 1x1 degree
! NODC grid

yes? LET coads_on_nodc = SST[D=1,G=otemp[D=2]] yes? LET warmer = IF otemp[D=2,Z=0] GT coads_on_nodc THEN 1 yes? SHADE/OVER/X=80W:20E/Y=0:80N/PAL=black/LEVELS/PATTERN=weave/T="15-jun-1998" warmer
yes? go fland

! Next lets examine some topography data serfved by the IRI/LDEO Climate Data Library
! at Columbia University (IRI/LDEO). This data is in the form of a
! 7200*3000 grid (some 20 megabytes)

! We will use this to illustrate the ability of Ferret and DODS to
! subsample -- making the data transfer much faster. For graphics, we
! don't have 7200x3000 pixels to show anyway!

! *********************************************************

yes? USE ""

! Performance greatly enhanced through use of strides
yes? SHADE/LEV=(0,100,10)(100,1000,100)(1000,4000,400)(inf)/PALETTE=topo topo[I=1:7200:12, J=1:3000:8] 6 June 2008