The functions are:
CURV_TO_RECT_MAP(lon_in,lat_in,grid_out,radius) Compute mapping for spherical interpolation: curvilinear to rectangular grid. lon_in: Source grid longitudes (2-D) (degrees) lat_in: Source grid latitudes (2-D) (degrees) grid_out: Any variable on destination Longitude-Latitude grid, Lon and Lat (degrees) radius: Source points falling within radius are included in mapping to destination point (degrees) CURV_TO_RECT(V,mapping) Apply spherical interpolation: curvilinear to rectangular grid V: Variable to regrid, on curvilinear grid V(x,y,z,t) mapping: mapping computed by CURV_TO_RECT_MAPFor example:
yes? USE "data/model_out.nc" ! data with curvilinear coordinates yes? SHOW data currently SET data sets: 1> /home/ansley/data/model_out.nc (default) name title I J K L LON longitude of cell 1:180 1:173 ... ... LAT latitude of cell 1:180 1:173 ... ... U zonal wind 1:180 1:173 ... ... V meridional wind 1:180 1:173 ... ... yes? LET lonin = lon[D=1] yes? LET latin = lat[D=1] yes? ! Define output grid and a variable on the output grid yes? DEF AXIS/X=0:355:5/MODULO/UNITS=degrees xax yes? DEF AXIS/Y=-90:90:5/UNITS=degrees yax yes? LET lonlatout = x[gx=xax] + y[gy=yax] yes? ! Compute mapping, save to a file (computing mapping is slow) yes? LET radius = 10. yes? LET map = curv_to_rect_map ( lonin, latin, lonlatout, radius) yes? SAVE/CLOBBER/FILE=map_5deg.nc map yes? ! Apply mapping to variables yes? CANCEL VAR/ALL yes? USE map_5deg.nc yes? LET regridded_u = curv_to_rect(U[D=1], map[D=2]) yes? LET regridded_v = curv_to_rect(V[D=1], map[D=2])
These functions are implemented as an external function, and is only available on
systems where external functions (shared object files) are available. It will be made an internally-linked
function in future versions.
The function is:
RECT_TO_CURV(V,lon_bounds_out,lat_bounds_out,missing values allowed) bilinear interpolation from rectangular grid to curvilinear grid V: variable V(x,y,z,t) on rectilinear grid lon_bounds_out: Destination curvilinear grid longitude bounds(2-D) (degrees) lat_bounds_out: Destination curvilinear grid latitude bounds(2-D) (degrees) missing values allowed: number of missing values allowed in 4 surrounding source cells: 0 to 3For example, compare model data to COADS_CLIMATOLOGY data:
yes? USE "data/model_out.nc" yes? USE coads_climatology yes? SHOW data currently SET data sets: 1> /home/ansley/data/model_out.nc name title I J K L LON longitude of cell 1:180 1:173 ... ... LAT latitude of cell 1:180 1:173 ... ... U zonal wind 1:180 1:173 ... ... V merional wind 1:180 1:173 ... ... 2> /home/ja9/tmap/fer_dsets/data/coads_climatology.cdf (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 yes? LET uwnd_curv = RECT_TO_CURV(uwnd[D=2,L=1], lon[D=1], lat[D=1], 1) yes? LET uwnd_diff = u[D=1] - uwnd_curv[D=2,L=1] ! Do a curvilinear shade plot of the difference. yes? SHADE uwnd_diff, lon[D=1], lat[D=1]
This function is implemented as an external function, and is only available on systems where
external functions (shared object files) are available. It will be made an internally-linked
function in future versions.
yes? can mode verify yes? repeat/k=1:500 (let/quiet test`k` = `k`)
yes? SAY `var, RETURN=nc_offset` yes? SAY `var, RETURN=nc_scale`return the latest scale and offset value that were applied.
New color palette files, including ones designed for color-impaired viewers.
A discussion of these new palettes with examples is in the FAQ,
Which of Ferret's color palettes best convey information to color-impaired viewers?
http://ferret.pmel.noaa.gov/static/FAQ/graphics/color_friendly_palettes.html
New symbols are defined for all plots, giving access to details of the current viewport settings. These are set for user-defined viewports and also for pre-defined viewports as in the command
yes? set viewport rightThew new symbols are: VP_SCALE, VP_XLO, VP_XHI, VP_YLO, VP_YHI, VP_RT_MARGIN, and VP_TOP_MARGIN. and they are defined as follows.
When a viewport is defined by a command like:
yes? DEFINE VIEWPORT/XLIM=xlo:xyi/YLIM=ylo:yhi/TEXT=n my_viewport yes? SET VIEW my_viewport
The symbols VP_XLO, VP_XHI, VP_YLO, and VP_YHI are the arguments to /XLIM and /YLIM.
VP_SCALE is related to the DEFINE VIEWPORT/TEXT qualifier, if used, or to the default scaling if /TEXT is not used in the viewport definition. See the explanation in the section on DEFINE VIEWPORT in the Users Guide.
VP_RT_MARGIN and VP_TOP_MARGIN are the space remaining on the page at the right and the top, beyond the
ends of the x and y axes; PPL$XORG and PPL$YORG are symbols that already give us the left and bottom margin sizes.
yes? PLOT/THICK/I=1:100 cos(i/20), sin(i/30) ! black and red thick lines yes? PLOT/OVER/THICK=3/I=1:100 cos(i/30)*sin(i/20) ! Green is the next color yes? PLOT/OVER/THICK=1/I=1:100 cos(i/10) ! Blue is next; /THICK=1 is a thin line
yes? POLY/COLOR=red/PALETTE=blue/SET {1,2,1}, {2,1,0.5} yes? PPL SHAKEY,1,0 YES? PPL POLYGON
yes? GO basemap X=-50:50 Y=-20:20 20 yes? POLYGON/OVER/LINE/FILL {0,1,2}, {2,1,2}, 111.55
Also, the code now checks that enough precision is used in labels to distinguish them: Previously key labels for this plot were 370, 371, 371, 372, 372, ...
yes? LET a = 370 + x[x=1:10:1] + 0.2*y[y=1:10:1] yes? SHADE/LEV=(370,382,0.5) a
OLD OUTPUT (note repeated 100.1E longitudes and 0.1N latitudes)
yes? LIST/FORM=tab aa VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100 BAD FLAG : -9.9999998E+33 SUBSET : 6 by 9 points (LONGITUDE-LATITUDE) coord 100E 100.1E 100.1E 100.2E 100.2E 100.2E 0.1N 1.001 1.002 1.002 1.003 1.003 1.004 0.1N 1.001 1.002 1.002 1.003 1.003 1.004 0.1N 1.001 1.002 1.002 1.003 1.003 1.004 0.2N 1.002 1.002 1.003 1.003 1.004 1.004 0.2N 1.002 1.002 1.003 1.003 1.004 1.004
NEW OUTPUT
yes? LIST/FORM=tab aa VARIABLE : (X[GX=XAX] + Y[GY=YAX])/100 BAD FLAG : -9.9999998E+33 SUBSET : 6 by 9 points (LONGITUDE-LATITUDE) coord 100E 100.05E 100.1E 100.15E 100.2E 100.25E 0.11N 1.001 1.002 1.002 1.003 1.003 1.004 0.13N 1.001 1.002 1.002 1.003 1.003 1.004 0.15N 1.001 1.002 1.002 1.003 1.003 1.004 0.16N 1.002 1.002 1.003 1.003 1.004 1.004 0.18N 1.002 1.002 1.003 1.003 1.004 1.004For very fine grids, or long formats specified with /FORMAT= qualifier, the coordinates and data values may no longer line up in nice columns but this seems like a less severe problem than the inadequate precision.
yes? PLOT/I=1:10 I yes? LABEL 5,7,0,0,0.2, "@C002this<NL>@C003now<NL>@C004works correctly."
yes? SET DATA "http://www.ferret.noaa.gov/cgi-bin/nph-nc/data/coads_climatology.nc" yes? SHADE/L=1 sst
yes? ! Show the location of the time coordinate in January 1985 yes? USE coads yes? PLOT/SYM/SIZ=0.3/HLIM="1-jan-1985": "1-feb-1985" 0*t[GT=vwnd]
yes? LIST/I=1:300:0 var
yes? USE coads_climatology yes? SET AXIS/CAL=JULIAN time yes? PLOT/X=140W/Y=0 sst yes? PLOT/OVER/VS/LINE=3 {400,900,900,400}, {25.5,25.5,26.5,25.5} yes? POLY/OVER/PAL=green {400,900,900,400}, {25.5,25.5,26.5,25.5}