[Thread Prev][Thread Next][Index]

Re: regridding data



Hi Mulyono,
Yes, you can easily do this. There is no need to add a variable "zero";
that method is used when we want to put a variable onto a grid that has
more dimensions than the original variable.

You just need to define the new axes as you have done, and define
your new variable on the desired grid as follows:

use/regulart monthly.globe.nc
DEFINE AXIS/X=5e:355e:5 ax_x
DEFINE AXIS/Y=35s:35n:5 ax_y
DEFINE GRID/like=monthly/x=ax_x/y=ax_y grd
LET monthly5deg = monthly[g=grd]

This will use linear interpolation to put the data on the new grid. Linear regridding is the default method. If you like, you can specify another method of regridding with a transformation like @asn or @ave

LET monthly5deg = monthly[g=grd@ave]

Please see Chapter 4, section 2.4 in the Users Guide (in the index, look up the
topic "regridding, syntax and examples") for more discussion of regridding.

Ansley Manke

R Prabowo wrote:

Hi ferreters,

Is there any way that i can regrid data into smaller or grater x and y axis?
I have been trying to regrid data[x=0:375.5:2.5, y=40s:40n:2.5] into data'[x=5e:355e:5, y=35s:35n:5] using

use/regulart monthly.globe.nc
show data
DEFINE AXIS/X=5e:355e:5 ax_x
DEFINE AXIS/Y=35s:35n:5 ax_y
DEFINE GRID/like=monthly/x=ax_x/y=ax_y grd
LET zero = 0*x[g=grd]+0*y[g=grd]+0*t[g=grd]
LET monthly5deg = monthly + zero ! ***
save/clobber/file=monthly5deg.globe.nc monthly5deg ! ***

This script gave error warning as:

*** NOTE: Ambiguous coordinates on X axis: MONTHLY5DEG + ZERO
**ERROR: inconsistent sizes of data regions: X axis
ZERO has 73 points (I=00:72)
expression has 144 points (I=001:144)
LIST/FORMAT=CDF/clobber/file=monthly5deg.globe.nc MONTHLY5DEG
Command file, command group, or REPEAT execution aborted

When I changed line ***s into:
LET monthly5deg = monthly[g=grd@asn] + zero
save/clobber/file=monthly5deg.globe.nc monthly5deg

the script worked, but the values of monthly5deg[i=1:73,j=1:17] in monthly5deg.globe.nc will be exactly the values of monthly[i=1:73,j=1:17] in monthly.globe.nc
Any one can give me clues? Thank you very much.
cheers..


Mulyono



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement