Re: resizing array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 30 2011 - 13:19:19 MST

NCL does have regridding function that do what you want.

In fact, some are 'better' than IDL's CONGRID. Some are
simple bilinear interpolation (eg: linint2); some can
do interpolation and smoothing (eg: spherical harmonic
based regridding); some can interpolate via local
area averaging on a sphere; other can interpolate conservatively.
Some allow missing values (_FillValue) some don't. Some can
fill in where missing values occur [eg: poisson_grid_fill]

I *speculate* IDL's CONGRID is cartesian oriented and
assumes all points are equally spaced. Hence, only
sizes are needed [eg, (46,72)]. NCL's functions
require that the target lat and lon locations be input.
This allows for unequally spaced latitudes [eg, gaussian]
and longitude grids.

http://www.ncl.ucar.edu/Document/Functions/

Click 'Regridding' to see all the regrid functions.

The following does not allow missing values:

http://www.ncl.ucar.edu/Document/Functions/Contributed/area_conserve_remap_Wrap.shtml

The following does allow missing values:
http://www.ncl.ucar.edu/Document/Functions/Contributed/area_conserve_remap_Wrap.shtml

If you are new to NCL, please go to

http://www.ncl.ucar.edu/Document/Manuals/

And download and read the mini-Language manual

Good Luck

On 11/30/2011 10:00 AM, Manoharan, Vani Starry wrote:
> Hi,
>
> I am trying to change an array of size (180X360) to (46,72) by averaging the data. I see that NCL does not have a function by itself to do this unlike IDL (CONGRID& RESIZE). Please see my ncl script attached. If I run this, it give sme the following error
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> warning:avg: Entire input array contains missing values, can't compute average
> fatal:Subscript out of range, error in subscript #1
> fatal:Execute: Error occurred at or near line 44 in file test1.ncl
>
> Could you please help me with this.
>
>
> My NCL script is attached as file.
> Thanks.
> Starry=
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 30 13:19:28 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST