;..Get some useful procedures (colormap generation, map bkgd options,...) load "/home/jps/ncarg/ncarg4.0/ncl/test/basic_fns.ncl" ;...start up application, X-workstation, basic map-bkgr: appid, wid, mapid load "/home/jps/ncarg/ncarg4.0/ncl/test/startx.ncl" ;...READ IN DATA FILE..... filename="/net/jps/archive/b/jps/archive/b/ljp/unpack/ECD_to_NMC/Dec85/EC.85120100.nc" file1=addfile(filename,"r") ;...EXTRACT A HORIZ. 2-D SLICE................................................ ; TEMP=file1->T(0,5,:,:) ; TEMP=file1->T(0,5,1:30,50:100) ;..Approach #1.... i1=10 i2=40 j1=1 j2=30 k1=5 it1=0 TEMP=file1->T(it1, k1, j1:j2, i1:i2) lata=file1->lat(j1) latb=file1->lat(j2) lon1=file1->lon(i1) lon2=file1->lon(i2) lat1=min(lata,latb) ;Note: "min" and "max" are MY functions! lat2=max(lata,latb) print("minimum latitude = "+lat1) print("maximum latitude = "+lat2) ; ;...Approach #2.... lat1=10 lat2=60 lon1=200 lon2=310 pres1=500 pres2=500 it1=0 TEMP=file1->T(it1, {pres1:pres2}, {lat1:lat2}, {lon1:lon2} ) ;............................................................................. ;...Set the map limits based on what data was selected.... set_mplims(mapid, lat1,lat2, lon1,lon2) ;...do the contouring... contour(appid,wid,cnid,dataid, TEMP,lat1,lat2,lon1,lon2) draw(cnid) clear(wid) overlay(mapid,cnid) ; mapid is in charge of the vp setup and coords clear(wid) draw(mapid) ;restore = False restore = True NhlRemoveOverlay(mapid,cnid,restore) ;============================================================================ ;============================================================================ ;============================================================================ ;============================================================================ ;======================= TESTING JUNK...===================================== ;============================================================================ quit ;....ALTERNATE COLORMAP SET-UP..... ;..Allocate a 64x3 array for the colormap (the first dimension is arbitrary). ;..The second dimension represents each component of an RGB triple. cmap_64 = new ((/64,3/), float) ;..Go ahead and generate a 64-element colormap. gen_colormap_64(cmap_64) ;..Assign the 64-element colormap to the workstation. setvalues wid "wkColorMap" : cmap_64 ; index 1=bkgd, 2=fgrd ; "wkColorMap" : "default" end setvalues clear(wid) draw(mapid) setvalues wid "wkColorMap" : "temp1" end setvalues getvalues wid "wkColorMap" : cmap_64 end getvalues getvalues wid "wkColorMap" : cmap_63 end getvalues