[GRASS5] Re: d.vect.thematic wish: handle null values
Daniel Calvelo Aros
dcalvelo at minag.gob.pe
Mon Aug 15 15:00:41 EDT 2005
Hi all,
Sorry for jumping in so late, I've been traveling.
AFAIR the problem is actually within db.select's output. Moritz, could you
apply this patch to v.univar.sh and send the result (in /tmp/db.select.out)
back to me? When I was dealing with this problem I only used the DBF driver,
which gave zeros for nulls under unspecified cirsumstances.
I can fix the script to filter out nulls, but I'm pretty sure the problem will
remain under certain configurations.
-- Daniel Calvelo Aros
---------- Original Message -----------
From: Michael Barton <michael.barton at asu.edu>
To: mlennert at club.worldonline.be
Cc: "daniel.calvelo at minag.gob.pe" <daniel.calvelo at minag.gob.pe>, Grass
Developers List <grass5 at grass.itc.it>
Sent: Sat, 13 Aug 2005 17:12:29 -0700
Subject: Re: [GRASS5] Re: d.vect.thematic wish: handle null values
> I think that this is the place in v.univar.sh that needs to be
> updated to deal with null values
>
> # calculate statistics
> echo "Calculating statistics..."
> cat $TMP | awk 'BEGIN {sum = 0.0 ; sum2 = 0.0}
> NR == 1{min = $1 ; max = $1}
> {sum += $1 ; sum2 += $1 * $1 ; N++}
> {
> if ($1 > max) {max = $1}
> if ($1 < min) {min = $1}
> }
> END{
> print ""
> print "Number of values:",N
> print "Minimum:",min
> print "Maximum:",max
> print "Range:",max-min
> print "-----"
> print "Mean:",sum/N
> print "Variance:",(sum2 - sum*sum/N)/N
> print "Standard deviation:",sqrt((sum2 - sum*sum/N)/N)
> print "Coefficient of variation:",(sqrt((sum2 -
> sum*sum/N)/N))/(sqrt(sum*sum)/N)
> print "-----"
> }'
>
> I think there needs to be the equivalent of
>
> for $1<>""
>
> in the beginning of this. Any awk expert know how to implement this?
>
> Of course if v.univar were expanded to accomplish the same things as
> v.univar.sh ...
>
> Michael
>
> On 8/12/05 2:42 AM, "Moritz Lennert" <mlennert at club.worldonline.be> wrote:
>
> > On Fri, August 12, 2005 11:27, Moritz Lennert said:
> >> On Fri, August 12, 2005 1:49, Michael Barton said:
> >>> Thanks for the clarification Moritz. Is this in the custom breaks section?
> >>
> >> No, this happens independently of the 'themecalc' choice.
> >
> > Sorry, I lied: actually the custom breaks are the only ones that work...
> >
> > All the others fail, with more or less the same error message...
> >
> > Moritz
> >
>
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
------- End of Original Message -------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aa.patch
Type: application/octet-stream
Size: 365 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20050815/2293c4a2/aa.obj
More information about the grass-dev
mailing list