Re: possible bug in wgt_areaave

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 24 2012 - 08:39:36 MDT

The 'wgt_areaave' is working correctly.
----------------------------------------
The NCL array syntax:

; Use calc as stated on
; http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml
; x_ave = sum(x*wgty*wgtx)/sum(wgty*wgtx)

will work when 'x' has no _FillValue. A modification must be used
when x has _FillValue. The documentation will be changed.

(0) [1] wgt_areaave(x,cost,1.0,0) =1.41421 ; no _FillValue attribute
(0) [2] wgt_areaave(x2,cost,1.0,0)=1.65685 ; with _FillValue att
(0) [3] wgt_areaave(x,cost,1.0,0) =1.65685 ; with _FillValue att

(0) [4] loop=1.65685 kmsg=5 ; do loop example

(0) [5] sum(x*wgty*wgtx)/sum(wgty*wgtx)=1.41421 ; not correct
(0) [6] sum(x*wgty*wgtx)/sum(WGTY*WGTX)=1.65685 ; correct

See Example 6 is at
http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml

On 7/23/12 10:36 PM, Lauren.Stevens@csiro.au wrote:
> Hi NCL-Talk,
> I am running the attached script using:
> NCAR Command Language Version 6.0.0
> and a Linuxmachine.
> I just had a question about how wgt_areave should work with missing values.
> Please have a look at the script and tell me if the function
> wgt_areaave is doing the right thing.
> It's probably something I'm missing but your help would be appreciated.
> Kind Regards, Lauren
>
>
> _______________________________________________
> 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 Tue Jul 24 08:39:51 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2012 - 09:48:26 MDT