NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: calculating standard deviation of a grid

On Fri, 2007-06-01 at 12:26 -0400, Case.Jon wrote:
Dear Gembud,
Does anyone know of a way to calculate the standard deviation of a specific grid using GDLIST? There is a function to give you the average of a scalar grid over the GAREA, but I don't see a way to specify a GFUNC that can calculate the standard deviation. Actually, the only missing link I need is to find the number of non-missing grid points in the array. I haven't identified such a utility though.

Jon,

You can determine the number of non-missing grid points in your sub
area using a function like:
GDPFUN   = ysum(xsum(bool(S)))

The bool(S) function will provide a 1/0 output with 1's at existing
points, so
the column sumation of the individual row sums will produce a grid of
the number of non-missing points at all points. You could further assign
the
value to just the non-missing point locations (but not needed here)
with:
GDPFUN = mask(ysum(xsum(bool(S))),S)

The standard deviation of the grid area could be done in GDPLOT2 similar
to:
GDPFUN = 
ysum(xsum(bool(tmpc)))//n!mul(savs(tmpc),n)//sm!mul(savs(expi(tmpc,2)),n)//ss!sqrt(quo(sub(ss,quo(mul(sm,sm),n)),sub(n,1))
(or the individual terms above can be computed in GDDIAG to output with
GDLIST).

Steve Chiswell
Unidata User Support



  • 2007 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the gembud archives: