Re: IDL's CONGRID function

From: Tony.Conrad <Tony.Conrad_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Sep 2008 16:52:33 -0400

Dennis:

Thanks for your response. We are looking into this and considering what
to do next. [We may end up using IDL for this one!]

---Tony Conrad

Dennis Shea said the following on 9/11/2008 6:18 PM.
> The short answer is "no"
>
> NCL forces the user to specify the the coordinates
> of both the in and out arrays. Regular to gaussian
> would require some user specification
>
> http://www.ncl.ucar.edu/Document/Functions/regrid.shtml
> [ignore area2int]
>
> It seems to me you could create a CONGRID substitute.
> linint1, linint2, ftsurf, [if global, shperical harmonic
> regriders], if the input is on a curvilinear grid, perhaps
> rcm2rgrid, rtc
> [untested]
>
> function congrid (q, dimout[*],cyclic:logical, opt:integer)
>
> begin
> dimq = dimsizes(q)
> Ni = dimsizes (dimq)
> nxi = dimq(Ni-1)
> nyi = dimq(Ni-2)
>
> No = dimsizes( dimout )
> nxo = dimout(No-1)
> nyo = dimout(No-2)
>
>
> xi = ispan(1,nxi,1)
> yi = ispan(1,nyi,1)
> xo = ispan(1,nxo,1)
> yo = ispan(1,nyo,1)
>
> if (opt.eq.0) then ; bilinear
> qNew = linint2(xi,yi,q,cyclic,xo,yo,False)
> end if
>
> if (opt.eq.1) then ; spline
> qNew = ftsurf(xi,yi,q,xo,yo)
> end if
>
> ; etc
>
> copy_VarAtts(q,qNew)
> return(qNew)
> end
>
> if the
>
> If the rank of dimout is 3 ... perform 1d
> interpoation [linint1] after the horizonatal interp.
>
> Good luck
>
> Tony.Conrad wrote:
>> Hello:
>>
>> Does NCL have something equivalent to IDL's CONGRID function?
>>
>> (IDL's CONGRID function shrinks or expands the size of an array by an
>> arbitrary amount. It uses various interpolation methods to do this.
>> With CONGRID one can quickly resize a 2 or 3 dimensional
>> array---example: resizing 2-dimensional array X from X[200, 300] to
>> X[1330, 178]. Please have a look at
>> http://idlastro.gsfc.nasa.gov/idl_html_help/CONGRID.html . )
>>
>> ---Ten Thousand Thanks
>> ---Tony Conrad
>> ---NSOF/NOAA
>> ---Suitland, Maryland, USA
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 12 2008 - 14:52:33 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 17 2008 - 10:32:36 MDT