Re: setting missing values

From: Andrea Hahmann <hahmann_at_nyahnyahspammersnyahnyah>
Date: Tue, 10 Jun 2008 16:15:29 -0600

James

Instead of using "dim_avg" you can use "dim_sum" and then count the
number of points that are not zero with the function "num". Something
like avg = sum(matrix)/num(not zero)

Andrea

James Correia wrote:
> Hi NCL-ers,
>
> I have a 3D variable (vertical level, lat, lon). I am taking an
> average (using dim_avg) over space but want to exclude those grid
> points which have zeros in the whole column. I know I can set them to
> missing, but what is the best way to set those columns to missing (I
> do not want to simply set all zeros to missing, only those grid points
> where the whole column is zero).
>
> Not sure if I can use the mask function for this.
> Thanks for any insight.
>
>
>
>
>
> --
> James Correia Jr.
> Post Doc
> Climate Physics Group, PNNL
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
----------------------------------------------------------------
Andrea N. Hahmann, Ph.D.
Research Applications Laboratory
Natl. Center for Atmospheric Research      Phone: 1-303-497-8383
PO BOX 3000                                Fax:   1-303-497-8401
Boulder, CO 80301                          hahmann_at_ucar.edu
----------------------------------------------------------------
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 10 2008 - 16:15:29 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 11 2008 - 13:31:20 MDT