Re: Regridding question

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Fri Oct 21 2005 - 10:28:21 MDT


Hi Sudipta,

The NCL function that you want to use is linint2:
http://www.ncl.ucar.edu/Document/Functions/Built-in/linint2.shtml

(A Wrap version of this function exists as well if you use
contributed.ncl, so all metadata is transferred, see:
http://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_Wrap.shtml
)

The input and output latitudes/longitudes must be monotonically
increasing, but it is pretty easy to get around that, here is an example
script:

starting off with sst array:
sst (time,lat,lon) 1x2degree grid, lats go from 64N:74S, lons from
                     1:359E... @_FillValue is assigned as attribute
;================================================================
printVarSummary(sst)
sst2 = sst(:,::-1,:) ; reverse order of latitudes for linint2_Wrap
printVarSummary(sst2)
delete(sst)

latnew = ispan(-74,64,2)
lonnew = ispan(1,359,2)
sstr = linint2_Wrap (sst2&lon,sst2&lat,sst2, True, lonnew,latnew, 0)
delete(sst2)
printVarSummary(sstr)

sstfinal = sstr(:,::-1,:) ; reverse order of latitudes, now from N->S
delete(sstr)
printVarSummary(sstfinal)
;=====================================================================
sstfinal is a 2x2 array running from 64N->74S, 1E:1W...

The script above can be shortened considerably by removing the
printVarSummary lines and by combining other lines, but this way you can
see what is happening..

Hope that helps.
Adam

ssarkar wrote:
> Hi
> I have a set of SST data that is gridded from 64N to 74S and from 1E to
> 1W by a 1x2 degree grid, making it a total of 139x180 pts grid.
> I wish to take this grid and convert it to a 2x2 degree grid. My problem
> is I am not aware of any NCL function that will allow me to specify the
> lat offset, that is to have a grid where lat varies from +64 to -74 and
> not from +90 to -90. Also 139/2 is 69.5 so what size do i choose for my
> new latitude specifications?
> Any suggestion for handling this kind of gridding problem?
>
> Sudipta Sarkar
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Wed Oct 26 2005 - 06:49:20 MDT