I work with ASCAT files as well, and I use the command
"scat2gridgauss_xy" to plot over all the passes in the end of a day.
Not sure if I'm doing right, but comparing with the shading output it
looks similar (also the "min" and "max" values), I attached an
example of the shade picture for the "scat2gridgauss_xy" output
("shadeWIND_SPEEDscat2grid.gif") and for " shade WIND_SPEED, lon,lat"
Your question about the shade command got me curious, and for sure, I
tried to do the same and I still don't understand, if there isn't
interpolation, why it plots in areas between the points of LON/LAT
Sorry Ansley, would you explain better this "checkerboard" variable? I
reproduced it but could not understand...besides, it uses the "shade"
command as well (shade checkerboard, lon, lat), equal "shade
By the end, I had a problem when I tried to do the same as Martin,
with the command "curv_to_rect_map", Ferret stops; don't show any
error and remains in the in blank display.
I first tried axis with 12.5 km ( ASCAT resolution) and after 1°, but
ferrets locks anyway...does anyone have a clue way I'm not able to do it?
OBS: I use FERRET v6.401
Linux(g77) 2.6.9-89.ELsmp - 12/09/09
Above these tests commands:
shade WIND_SPEED,LON,LAT; go land_hires
plot/vs lon,lat ; go land_hires
define axis/x=1:267238:1 tripaxis
define axis/x=0:360:0.1126/UNIT=degrees xaxis
define axis/y=-90:90:0.1126/UNIT=degrees yaxis
0.2252, 2, 0)
0.2252, 2, 0)
shade/level=(0,20,1) mag; go land_hires
let checkerboard = 0*wind_speed+mod(i+j,2)
shade/pal=greyscale/lev=(0,2,1) checkerboard, lon, lat
let lonin=lon;let latin=lat
Paula Lamosa Nunes
Date: Fri, 18 Feb 2011 11:23:37 -0800
Subject: Re: [ferret_users] plotting and interpolating data given on
There is a newer interpolation method in the pipeline, but not yet
available. The libcf library being developed by Unidata and a group of
collaborators will give us faster tools for interpolating between
grids. We are paying close attention to this development and will
implement it in Ferret as soon as it's ready. When there's a beta
version of the interpolation code, and other capabilities available,
we will add it as an option for people to experiment with. Here's the
link to the information about libcf:
With the existing tools in Ferret, if all your data has the same
curvilienar grid and are interpolating to the same rectilinear grid,
you can re-use the map function. This speeds up the entire process
quite a lot, and it's the reason we have two functions; one to compute
the map and the other to apply it.
The SHADE command only fills each grid box with the corresponding
color. It's not doing any interpolation. The curvilinear version of
the shade command can use curvlinear coordinate variables that define
either the edges of the grid cells or their centers. Here it looks
like the grid defines the centers - else their size would be one
larger than the grid size of the data fields.
yes? use "ascat_20100111_005400_metopa_16755_eps_o_125_1018_ovw.l2.nc"
yes? sh dat
currently SET data sets:
name title I J
TIME time 1:82 1:3259
LAT latitude 1:82 1:3259
LON longitude 1:82 1:3259
cross track wind vector cell nu 1:82 1:3259
model wind speed at 10 m 1:82 1:3259
model wind direction at 10 m 1:82 1:3259
ICE_PROB ice probability 1:82 1:3259
ICE_AGE ice age (a-parameter) 1:82 1:3259
wind vector cell quality 1:82 1:3259
wind speed at 10 m 1:82 1:3259
WIND_DIR wind direction at 10 m 1:82 1:3259
backscatter distance 1:82 1:3259
A nice way to visualize a grid is to define a "checkerboard" variable,
which alternates 1 and zero over the grid, based on the variable we're
yes? let checkerboard = 0*wind_speed+mod(i+j,2)
checkerboard, lon, lat
So I think what looks in your shade.gif image like data smeared across
the middle of this swath is really just the way the shape of the cells
changes. The question is why the regridded data has a gap in that
area. There should be many points within the 1-degree radius that
you've chosen, to use in the interpolation. I don't understand that,
but will try to look into it.
On 2/18/2011 8:42 AM, Martin Schmidt wrote:
I am trying to use ASCAT data downloaded from
The files are netcdf files in curvilinear form, lat, lon and data
are defined on a common abstract (x,y) grid.
It does not have a geophysical meaning.
Ferret should be able to deal with such data. Indeed
shade/d=1 WIND_SPEED, lon,lat; frame /file=shade.gif
works and gives figure shade.gif.It does not look really bad.
Now I want to put the data on a regular grid in geographic
coordinates. The GFDL routine curv_to_rect_map
should be fine.
yes? define axis/x=0:360:1/modulo/units=degrees xax
yes? def axis/y=-85:85:1/units=degrees yax
yes? let lonlatout = y[gy=yax] + x[gx=xax]
yes? let lonin = lon[d=1]
yes? let latin = lat[d=1]
yes? let map = curv_to_rect_map ( lonin,latin,lonlatout,1)
yes? save/clobber/file=curv_map.nc map
(1 degree resolution)
After some coffee:
yes? cancel var/all
yes? use curv_map.nc
yes? let wo=curv_to_rect(wind_SPEED[d=1], map[d=2])
yes? shade wo; frame /file=curv_to_rect.gif
Both figures are in the attachment. The results have something to
do with each other but they are also pretty different.
So my question:
I do not really believe in the figure shade.gif. The reason is,
that I may plot (lon,lat) pairs into
the figure (plot/vs/ov lon,lat. In shade.gif there remain broad
bands of coloured areas, in curv_to_rect.gif most data are covered
by the symbols.
So I guess, that the shade command implies some inappropriate
Does anyone have experience with plotting and processing such
It is great to have the interpolation tool curv_to_rect. But is
there a chance to optimize the code
for a speed up of the curv_to_rect_map routine? I would like to
process years of data on a finer grid and it is very slow with 1
Unfortunately the weights are changing for every file.
Is there another and faster way to do this with ferret?