If you have data that's already on a grid, you can define new axes
and regrid to those new axes with ordinary Ferret regridding
operations.
Here are a couple of examples. First, use some data that has a
regular Y axis and an irregular X axis, regrid to a regular X axis
and a new Y axis, but keep the Z axis. On the SHOW DATA
commands, you can see which axes are irregular. Under the # pts
column note the the letter i for irregular or r for regular.
yes? USE myfile
yes? SHO data
currently SET data sets:
1> ./myfile.nc (default)
name title
I J K
L
TEMP TEMPERATURE
1:10 1:40 1:20 ...
yes? SHO GRID temp
GRID GLR1
name axis
# pts start end
XAXL X
10 i 123
222
YAXL LATITUDE 40
r 19.5S 19.5N
ZAXL DEPTH (m) 20 i-
0 5000
normal T
yes? DEF AXIS/X=123:223:5 newx
yes? DEF AXIS/Y=-20:20:5 newy
yes? LET outvar = temp[gx=newx,gy=newy]
yes? SHOW GRID outvar
yes? show grid outvar
GRID (G002)
name axis
# pts start end
NEWX X
21 r 123
223
NEWY Y
9 r -20
20
ZAXLEVITR DEPTH (m) 20 i- 0
5000
normal T
-------------------------------------------
Now, an example of how to use scat2gridgauss. See how the
variables LON and LAT are just 1-D lists of values, which become
inputs to the function, and X[GX=XAX], Y[GY=YAX] are the
coordinates of the axes we want the result to be on.
yes? SET DATA scat.nc
yes? SHOW data
currently SET data sets:
1> /home/shiva5/data/island_rainfall.cdf
(default)
name title
I J
K L
LAT Latitude
1:226 ... ... ...
LON Longitude
1:226 ... ... ...
RAIN Island rainfall
1:226 ... ... 1:840
yes? define axis/x=130:240:2.5 xax
yes? define axis/y=-35:20:2.5 yax
yes? let raingrid = scat2gridgauss_xy (lat, lon, rain,
x[gx=xax], y[gy=yax], 4, 2, 4, 2)
yes? stat sgrid
SCAT2GRIDGAUSS_XY (LON, LAT, RAIN, X[GX=XAX], Y[GY=YAX], 4,
2, 4,2)
X: 128.8 to 241.2
Y: -36.2 to 21.2
Z: N/A
TIME: 31-DEC-1970 12:00 to 19-APR-1973 12:00
DATA SET: /home/data/island_rainfall.cdf
Total # of data points: 869400 (45*23*1*840)
# flagged as bad data: 386543
Minimum value: 0
Maximum value: 380.4
Mean value: 5.8762 (unweighted average)
Standard deviation: 12.64
Hemerson Tonin wrote:
Hi ferreter'sDo external functions (scat2gridgauss_xy and scat2gridlaplace)
interpolations from irregular axes to regular ones?Because I have tryed with regular axis for longitude and irregular one for
latitude ( time and depth axes will not changed ) and, it has given me the
message:Bailing out of external function "scat2gridgauss_xy":
Input scattered x, y have different # of
points 4 11
**ERROR: : error in external functionWell, suggestions to do this will be welcome !
Thank's
Tonin, H. E.
School of Chemistry, Physics and Earth Sciences
Flinders University of South Australia
--
Ansley Manke Pacific Marine Environmental Laboratory Seattle
WA (206)526-6246