<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2149.0">
<TITLE>RE: Rapid statistics for subareas of a raster map?</TITLE>
</HEAD>
<BODY>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">You can use the "region" option and the r.le programs to get</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">this. Set the map of patches as the region map.</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Bill</FONT>
</P>
<UL>
<P><FONT SIZE=1 FACE="MS Sans Serif">----------</FONT>
<BR><B><FONT SIZE=1 FACE="MS Sans Serif">From:</FONT></B> <FONT SIZE=1 FACE="MS Sans Serif">hnw@mtqgrass.ESD.ORNL.GOV[SMTP:hnw@mtqgrass.ESD.ORNL.GOV]</FONT>
<BR><B><FONT SIZE=1 FACE="MS Sans Serif">Sent:</FONT></B> <FONT SIZE=1 FACE="MS Sans Serif">Friday, August 21, 1998 1:34 PM</FONT>
<BR><B><FONT SIZE=1 FACE="MS Sans Serif">To:</FONT></B> <FONT SIZE=1 FACE="MS Sans Serif">grassp-list@cecer.army.mil; grassu-list@cecer.army.mil</FONT>
<BR><B><FONT SIZE=1 FACE="MS Sans Serif">Subject:</FONT></B> <FONT SIZE=1 FACE="MS Sans Serif">Rapid statistics for subareas of a raster map?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I need to calculate n, mean, std, max, and min for a number of patches</FONT>
<BR><FONT SIZE=2 FACE="Arial">in a raster map.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I am currently masking the patch, zooming with g.region, and then using</FONT>
<BR><FONT SIZE=2 FACE="Arial">r.stats to spew the cells to an awk program which calculates the</FONT>
<BR><FONT SIZE=2 FACE="Arial">statistics.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">But it takes a long time for g.region to "walk" the edges of the window</FONT>
<BR><FONT SIZE=2 FACE="Arial">down to each individual patch. But if I don't window in the current</FONT>
<BR><FONT SIZE=2 FACE="Arial">region, it takes r.stats a long time to filter through all of the</FONT>
<BR><FONT SIZE=2 FACE="Arial">masked cells to get to the cells that are in the current patch.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Does anybody know of a better, faster approach for getting summary</FONT>
<BR><FONT SIZE=2 FACE="Arial">stats for patches in a raster map?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> ____ Oak Ridge National Laboratory</FONT>
<BR><FONT SIZE=2 FACE="Arial"> / ) / / / / P.O. Box 2008, M.S. 6274</FONT>
<BR><FONT SIZE=2 FACE="Arial"> /--< o / / /--/ Oak Ridge, TN 37830-6274</FONT>
<BR><FONT SIZE=2 FACE="Arial"> /___/__<__/__/_ / / _ (423) 241-2748</FONT>
<BR><FONT SIZE=2 FACE="Arial"> William W. Hargrove (423) 241-3870 (fax)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> hnw@fire.esd.ornl.gov </FONT><U> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial"><A HREF="http://www.esd.ornl.gov/~hnw" TARGET="_blank">http://www.esd.ornl.gov/~hnw</A></FONT></U>
</P>
</UL>
</BODY>
</HTML>