[GRASS-windows] Re: Zonal Statistics - min

Markus Neteler neteler at osgeo.org
Fri Mar 18 04:29:26 EDT 2011


Hi Rasmus,

On Fri, Mar 18, 2011 at 9:15 AM, Rasmus Borgstrøm <Rb at gras.ku.dk> wrote:

>  Hi Markus
>
> Yes you're right. Solved the output issue. Thanks!
>

excellent.

  Next problem is then how to access the minimum value in the stats.txt
> file. Can you guide me in a direction or to script examples (unfortunately I
> didn't find any in your book)?
>

In general, see page 49 for the usage of the eval function (I am not quite
sure that this works on
Windows, though). Shell script style (no -t):

eval `r.univar -g -e map=MOD02QKM output=-`

BUT: since you want zonal statistics eval will fail since the same variable
names are
printed for each zone.

I am afraid that you have to continue with -t (table style) and perhaps
consider the (file) output
as CSV table. Then access by row/column to feed the subsequent script.

Maybe other list member have an idea how to do that in Windows (I would use
cut/grep/etc).

Markus


> I would like have the minimum value used in a r.mapcalc DOS_MODIS =
> MODISIMAGE - STATS.TXT(%MIN%)
>
> Basically what I am trying to is a Dark Objection Subtraction of a MODIS
> timeserie, so if you have ideas for other approaches for this please let me
> know.
>
> Best regards,
> Rasmus
>
> >>>
>     *From: * Markus Neteler <neteler at osgeo.org> *To:* rasmus borgstrøm<
> rb at gras.ku.dk> *CC:* <grass-windows at lists.osgeo.org> *Date: * 18-03-2011
> 02:01 *Subject: * Re: [GRASS-windows] Re: Zonal Statistics - min
> On Thu, Mar 17, 2011 at 10:41 PM, rasmus borgstrøm <rb at gras.ku.dk> wrote:
> > Hi
> >
> > I have installed winGRASS 7 and tried to calculate the zonal statistics,
> but
> > I cannot seem to get the results.
> > I tried this:
> > r.univar -g -e -t map=MOD02QKM zones=fields.10m
> output=out2>fields_stats.txt
> >
> > I assume this will write the zonal stat to the .txt file, but I cannot
> seem
> > to access/find the txt file. ?!
>
> You are writing the output to out2 (maybe better call it out2.txt or
> even better stats.txt).
> It should be in the current directory. The >fields_stats.txt will not gain
> anything since output= is used and not set to output=- (stdout).
>
> I guess you are already there.
>
> Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-windows/attachments/20110318/9eb644a1/attachment.html


More information about the grass-windows mailing list