Hi Zhen, Yes, SAMPLEIJ needs same length for the ipts and jpts. The resulting variable from this external function will have only one abstract axis which corresponds to the length of ipts(=jpts) instead of X and Y (Z and T will be inherited from the original variable). From the values given for ipts (=2,4,6,....,680) & jpts (=2,4,6,.. ..,380) it seems that you are trying to regrid the density variable to a coarser grid (without any averaging) which does have alternate positions as grid points. For doing this there are proper methods like --> defining a coarser destination grid, regrid the variable onto that grid using @XACT regridding. If you can explain what exactly you want to do, I can offer you a better help. Let me know if you have any questions. Regards, Jaison On Wed, 31 May 2006 zhen.li@gsfc.nasa.gov wrote:Dear Ferret_Users:
It seems to me that SAMPLEIJ only subsamples the array that has the same number of
points in "i" and "j" direction. For example, my effort to use the following
script to subsample the array of size [680,380] failed, because it only subsampled
the point in the "I" direction. The new array "var_ij" has a size of [390,1]. I wonder
if anyone can help me with this case.
!FILE/VAR="ipts" ipts.dat (ipts=2,4,6,....,680)
!FILE/VAR="jpts" jpts.dat (jpts=2,4,6,....,380)
!use ocean_density.res.nc
!let var_ij=sampleij(RHO_TAUM1,ipts[d=1],jpts[d=2])
Thanks!
Zhen