calculating standard deviation of a grid
Steve Chiswell
chiz at unidata.ucar.edu
Fri Jun 1 12:56:18 MDT 2007
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
>
> Also, I've looked at the GDSTAT program, but that give you statistics at each individual grid point over a range of times, not stats for a while grid.
>
> Your feedback is most welcome!
> Jonathan
>
> ......................................................................The information contained in this email message is intended only for the use of the individuals to whom it isaddressed and may contain information that is privileged and sensitive. If the reader of this message is notthe intended recipient, you are hereby notified that any dissemination, distribution or copying of thiscommunication is strictly prohibited. If you have received this communication in error, please notify thesender immediately by email at the above referenced address. Thank you.
>
--
Steve Chiswell <chiz at unidata.ucar.edu>
Unidata
More information about the gembud
mailing list