Details Ticket 3704


Comment | Reply | Take | Resolve


Serial Number 3704
Subject d.rast.arrow: magnitude raster map sets arrow length
Area wish6
Queue grass
Requestors david.p.finlayson@gmail.com
Owner none
Status open
Last User Contact Wed Oct 12 22:26:00 2005 (3 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Oct 12 22:26:00 2005 (3 yr ago)
Created Fri Sep 30 20:00:19 2005 (3 yr ago)

Transaction History Ticket 3704


Fri, Sep 30 2005 20:00:19    Request created by guest  
Subject: d.rast.arrow does not save a line in the monitor history

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: GRASS 6.1.cvs (2005)

Name: David Finlayson

d.rast.arrow does not appear to write a line in the monitor history. As a result,
d.save, d.out.png (what else?) do not put the arrow command in their output.
I wonder if this is the reson that d.zoom does not work with d.rast.arrow? There
is another bug (Tracking ID 2012) that may be related.

David

Here is a snippit the will reproduce:

    d.rast $map 
    d.rast.arrow $map
    d.legend $map
    d.out.png output=$map.png
    d.save -c 

 
Mon, Oct 3 2005 07:27:41    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Mon, 3 Oct 2005 18:27:24 +1300
From Hamish <hamish_nospam@yahoo.com>
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Message-Id <20051003182724.08949f1f.hamish_nospam@yahoo.com>
In-Reply-To <20050930180020.1C29B101FB2@lists.intevation.de>
References <20050930180020.1C29B101FB2@lists.intevation.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> this bug's URL: http://intevation.de/rt/webrt?serial_num=3704
> ---------------------------------------------------------------------
> 
> Subject: d.rast.arrow does not save a line in the monitor history
..
> GRASS Version: GRASS 6.1.cvs (2005)
> 
> Name: David Finlayson
> 
> d.rast.arrow does not appear to write a line in the monitor history.
> As a result, d.save, d.out.png (what else?) do not put the arrow
> command in their output.
> 
> I wonder if this is the reson that d.zoom does not work with
> d.rast.arrow? There is another bug (Tracking ID 2012) that may be
> related.

d.rast.arrow isn't saved to the command history. Easy enough to add this
by putting this:

D_add_to_list(G_recreate_command());

towards the end of the main{} function in arrow.c.

Same with d.rast.num.


Any d.redraw type command depends on what is saved to the window's
command history list (see d.save). Sometimes this isn't what was entered
on the command line (eg d.text and d.barscale -m).


Another question:

Do the default fonts (romans et. al) have an arrow char built in?
(distant memory that they did?) If so we could use it with
R_text_rotation() to improve to a 360 degree resolution arrow drawing 
for standard GRASS aspect maps and ANSWERS aspect maps instead of the
current 8-way ones... maybe freetype same-char compatibility issues.



Hamish


Tue, Oct 4 2005 00:12:38    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 4 Oct 2005 11:12:20 +1300
From Hamish <hamish_nospam@yahoo.com>
To grass5@grass.itc.it
Cc grass-bugs@intevation.de
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Message-Id <20051004111220.53c04d65.hamish_nospam@yahoo.com>
In-Reply-To <20051003182724.08949f1f.hamish_nospam@yahoo.com>
References <20050930180020.1C29B101FB2@lists.intevation.de> <20051003182724.08949f1f.hamish_nospam@yahoo.com>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
I wrote:

> Another question:
> 
> Do the default fonts (romans et. al) have an arrow char built in?
> (distant memory that they did?) If so we could use it with
> R_text_rotation() to improve to a 360 degree resolution arrow drawing 
> for standard GRASS aspect maps and ANSWERS aspect maps instead of the
> current 8-way ones... maybe freetype same-char compatibility issues.

Probably better to just define an arrow in polar coordinates and vary
theta. Easy enough to drop a new fn into arrow.c to do this.



Hamish


Tue, Oct 4 2005 02:09:58    Mail sent by dfinlays@u.washington.edu  
Return-Path <david.p.finlayson@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PxCp/egYu8QEbABJTSxfe1LcAZ6+JwY0Dpny3CpSz3KH98u4lFiatHoowdiyP6vp1RhlV3SHieBhsUNm0uw7zZqjZJ2V7ZpRH3futpb0zQg2MG4XS4k5tCzKFJmhknKZNfeVMC+IRrRI0aKQPXcRgYHNV3cxx4JeJnwcEPTPlNw=
Message-ID <be6d1720510031709t305f995m818cf0543a0d09a4@mail.gmail.com>
Date Mon, 3 Oct 2005 17:09:53 -0700
From David Finlayson <dfinlays@u.washington.edu>
Reply-To dfinlays@u.washington.edu
Sender david.p.finlayson@gmail.com
To Hamish via RT <grass-bugs@intevation.de>
Subject Re: [bug #3704] (grass) d.rast.arrow does not save a line
In-Reply-To <20051003221238.C7A601006CA@lists.intevation.de>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Content-Disposition inline
References <20051003221238.C7A601006CA@lists.intevation.de>
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
That would be nice.

Someday I would like to see a general raster vector display tool in
GRASS. Something like grdvector in GMT. What's the MATLAB equivalent
pswiggle or something like that? Anyway, something that can handle
direction and magnitude from either U and V components, or a single
grid with bearing/angle. It should also probably handle both Cartesian
and Nautical conventions for representing angles and both Atmospheric
and Oceanographic conventions for plotting the arrows (currents coming
from or currents going to).

David



On 10/3/05, Hamish via RT <grass-bugs@intevation.de> wrote:
> I wrote:
>
> > Another question:
> >
> > Do the default fonts (romans et. al) have an arrow char built in?
> > (distant memory that they did?) If so we could use it with
> > R_text_rotation() to improve to a 360 degree resolution arrow drawing
> > for standard GRASS aspect maps and ANSWERS aspect maps instead of the
> > current 8-way ones... maybe freetype same-char compatibility issues.
>
> Probably better to just define an arrow in polar coordinates and vary
> theta. Easy enough to drop a new fn into arrow.c to do this.
>
>
>
> Hamish
>
>
> --- Headers Follow ---
>
> >From hamish_nospam@yahoo.com  Tue Oct  4 00:12:38 2005
> Return-Path: <hamish_nospam@yahoo.com>
> Delivered-To: grass-bugs@lists.intevation.de
> Received: from mail.intevation.de (aktaia [212.95.126.10])
>         by lists.intevation.de (Postfix) with ESMTP id 560771005D8
>         for <grass-bugs@lists.intevation.de>; Tue,  4 Oct 2005 00:12:38 +=
0200 (CEST)
> Received: from localhost (localhost [127.0.0.1])
>         by mail.intevation.de (Postfix) with ESMTP id 154B536CE0
>         for <grass-bugs@lists.intevation.de>; Tue,  4 Oct 2005 00:12:38 +=
0200 (CEST)
> Received: from mailhub1.otago.ac.nz (mailhub1.otago.ac.nz [139.80.64.218]=
)
>         by mail.intevation.de (Postfix) with ESMTP id 9E87636CDC
>         for <grass-bugs@intevation.de>; Tue,  4 Oct 2005 00:12:36 +0200 (=
CEST)
> Received: from galadriel.otago.ac.nz (galadriel.otago.ac.nz [139.80.64.21=
3])
>         by mailhub1.otago.ac.nz (8.12.11/8.12.11) with ESMTP id j93MCMqR0=
24079;
>         Tue, 4 Oct 2005 11:12:22 +1300
> Received: from ocean3 (ocean3.otago.ac.nz [139.80.35.38])
>         by galadriel.otago.ac.nz (8.12.8/8.12.8) with SMTP id j93MCLke029=
763;
>         Tue, 4 Oct 2005 11:12:21 +1300 (NZDT)
> Date: Tue, 4 Oct 2005 11:12:20 +1300
> From: Hamish <hamish_nospam@yahoo.com>
> To: grass5@grass.itc.it
> Cc: grass-bugs@intevation.de
> Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a li=
ne
>  in the monitor history
> Message-Id: <20051004111220.53c04d65.hamish_nospam@yahoo.com>
> In-Reply-To: <20051003182724.08949f1f.hamish_nospam@yahoo.com>
> References: <20050930180020.1C29B101FB2@lists.intevation.de>
>         <20051003182724.08949f1f.hamish_nospam@yahoo.com>
> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
> X-Face: M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=3DT|rbBL'e1/CQ9;/1g\BU3&!=3Dy8ria=
$2Uk!HT&BB
>  8i?|X_+7~1jsy}F~g$2va%3fV`*=3DL(*cem[@3\yg,G,@rg6/QMJ
> Mime-Version: 1.0
> Content-Type: text/plain; charset=3DUS-ASCII
> Content-Transfer-Encoding: 7bit
> X-Spam-Status: No, hits=3D-4.0 tagged_above=3D-999.0 required=3D3.0 tests=
=3DBAYES_00,
>         FORGED_YAHOO_RCVD
> X-Spam-Level:
>
> -------------------------------------------- Managed by Request Tracker
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays


Wed, Oct 5 2005 08:35:21    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 04 Oct 2005 23:34:57 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
In-reply-to <20051003182724.08949f1f.hamish_nospam@yahoo.com>
To Hamish <hamish_nospam@yahoo.com>, Paolo Cavallini via RT <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Message-id <BF68C221.3641%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.0.050811
Thread-Topic [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Thread-Index AcXJducSJZGZzDVqEdqSNgAKlW/i4A==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Hamish,

Can you (or someone) add this to d.rast.arrow and d.rast.num so that a
display with these features can be output to a graphics file using
d.out.file? Are there any more commands (excluding mouse placement) that
need this?

With regard to mouse placement, it would be nice if when placing something
with a mouse (e.g. A scalebar), the coordinates could be read on the mouse
click and pasted into the coordinate field so that the feature could be
saved.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish <hamish_nospam@yahoo.com>
> Date: Mon, 3 Oct 2005 18:27:24 +1300
> To: Request Tracker <grass-bugs@intevation.de>
> Cc: <grass5@grass.itc.it>
> Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line
in
> the monitor history
> 
>> this bug's URL: http://intevation.de/rt/webrt?serial_num=3704
>> ---------------------------------------------------------------------
>> 
>> Subject: d.rast.arrow does not save a line in the monitor history
> ..
>> GRASS Version: GRASS 6.1.cvs (2005)
>> 
>> Name: David Finlayson
>> 
>> d.rast.arrow does not appear to write a line in the monitor history.
>> As a result, d.save, d.out.png (what else?) do not put the arrow
>> command in their output.
>> 
>> I wonder if this is the reson that d.zoom does not work with
>> d.rast.arrow? There is another bug (Tracking ID 2012) that may be
>> related.
> 
> d.rast.arrow isn't saved to the command history. Easy enough to add this
> by putting this:
> 
> D_add_to_list(G_recreate_command());
> 
> towards the end of the main{} function in arrow.c.
> 
> Same with d.rast.num.
> 
> 
> Any d.redraw type command depends on what is saved to the window's
> command history list (see d.save). Sometimes this isn't what was entered
> on the command line (eg d.text and d.barscale -m).
> 
> 
> Another question:
> 
> Do the default fonts (romans et. al) have an arrow char built in?
> (distant memory that they did?) If so we could use it with
> R_text_rotation() to improve to a 360 degree resolution arrow drawing
> for standard GRASS aspect maps and ANSWERS aspect maps instead of the
> current 8-way ones... maybe freetype same-char compatibility issues.
> 
> 
> 
> Hamish
> 


Wed, Oct 5 2005 09:37:50    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 5 Oct 2005 20:37:22 +1300
From Hamish <hamish_nospam@yahoo.com>
To Michael Barton <michael.barton@asu.edu>
Cc grass-bugs@intevation.de, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Message-Id <20051005203722.176cfd46.hamish_nospam@yahoo.com>
In-Reply-To <BF68C221.3641%michael.barton@asu.edu>
References <20051003182724.08949f1f.hamish_nospam@yahoo.com> <BF68C221.3641%michael.barton@asu.edu>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> Can you (or someone) add this to d.rast.arrow and d.rast.num so that a
> display with these features can be output to a graphics file using
> d.out.file?

Yes (eventually).

> Are there any more commands (excluding mouse placement) that need
> this?

Probably. I'm a bit conservative about going around giving every module
every feature just because we can.. I like to convince myself that it
wasn't written that way on purpose.
 
> With regard to mouse placement, it would be nice if when placing
> something with a mouse (e.g. A scalebar), the coordinates could be
> read on the mouse click and pasted into the coordinate field so that
> the feature could be saved.

d.barscale already does this. Try 'd.barscale -m' and then use d.save to
look at what was saved to the window command list.

Also the superior mouse placement code from d.barscale needs to be
ported to other modules, e.g. d.text.freetype.


Hamish


Fri, Oct 7 2005 02:38:27    Status changed to resolved by hbowman  
Fri, Oct 7 2005 02:38:27    Mail sent by hbowman  
Ok, d.rast.arrow and d.rast.num are now added to the display monitor history
list and should survive redraw, PNG export, zoom, etc.


Also for d.rast.arrow I've added support for compass based aspect maps
(degrees clockwise from north) and 360 degree resolution instead of D8 (where
applicable).

i.e.
 grass aspect maps:    1 deg resolution
 compass aspect maps:  1 deg resolution
 AGNPS aspect maps:    D8 resolution (45 degrees)
 ANSWERS aspect maps:  15 degree resolution


Two things to think about:
- How to visualize MDF directional flow created by r.terraflow?

- With a little more effort, arrow size (magnitude) could be read
  from a second raster map, perhaps with a default scaling factor which
  could take the max of the raster range to be 10x the cell width.
  i.e. Eulerian velocity fields!


screenshot:
  http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_360.png



enjoy,
Hamish
Fri, Oct 7 2005 02:51:06    Mail sent by david.p.finlayson@gmail.com  
Return-Path <david.p.finlayson@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sZUU8v47zWYRhgTdWrP7VXtcQd/DajGb6H+XjDo1bTePdM5vKkF4qB//yF9l4bwPgszlVHXLR5wqyMenef7TCQdFcXly7Ve8RI9ixqE9itTjxz/qBgnEyXHqrjVAAvHL35N5L/uTqLGqTDLOmSdXu0JaIyJKwlrzA22bNbbSIBo=
Message-ID <be6d1720510061751w62d31480qf4bfe67f8c78119e@mail.gmail.com>
Date Thu, 6 Oct 2005 17:51:02 -0700
From David Finlayson <david.p.finlayson@gmail.com>
Reply-To David Finlayson <david.p.finlayson@gmail.com>
To Harmish Bowman via RT <grass-bugs@intevation.de>
Subject Re: [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Cc grass5@grass.itc.it
In-Reply-To <20051007003827.32F211005DF@lists.intevation.de>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Content-Disposition inline
References <20051007003827.32F211005DF@lists.intevation.de>
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Very Nice!

As for vector plots, wouldn't it (also) make sense to take two rasters
U and V where the arrow direction:

dir =3D atan2(u, v)
mag =3D sqrt(u^2 + v^2)

David

On 10/6/05, Harmish Bowman via RT <grass-bugs@intevation.de> wrote:
> Ok, d.rast.arrow and d.rast.num are now added to the display monitor hist=
ory
>
> list and should survive redraw, PNG export, zoom, etc.
>
>
>
>
>
> Also for d.rast.arrow I've added support for compass based aspect maps
>
> (degrees clockwise from north) and 360 degree resolution instead of D8 (w=
here
>
> applicable).
>
>
>
> i.e.
>
>  grass aspect maps:    1 deg resolution
>
>  compass aspect maps:  1 deg resolution
>
>  AGNPS aspect maps:    D8 resolution (45 degrees)
>
>  ANSWERS aspect maps:  15 degree resolution
>
>
>
>
>
> Two things to think about:
>
> - How to visualize MDF directional flow created by r.terraflow?
>
>
>
> - With a little more effort, arrow size (magnitude) could be read
>
>   from a second raster map, perhaps with a default scaling factor which
>
>   could take the max of the raster range to be 10x the cell width.
>
>   i.e. Eulerian velocity fields!
>
>
>
>
>
> screenshot:
>
>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_360.png
>
>
>
>
>
>
>
> enjoy,
>
> Hamish
>
>
>
> -------------------------------------------- Managed by Request Tracker
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays


Fri, Oct 7 2005 02:51:06    Status changed to open by _rt_system  
Fri, Oct 7 2005 06:13:34    Area changed to wish6 by hbowman  
Fri, Oct 7 2005 06:14:11    Subject changed to d.rast.arrow: magnitude vector sets arrow length by hbowman  
Fri, Oct 7 2005 06:39:44    Mail sent by hbowman  
> Someday I would like to see a general raster vector display tool in
> GRASS. Something like grdvector in GMT. 

At some point it is better to let GMT do the job of cartography versus 
duplicating the effort within GRASS. Each to our own strengths.
(As long as we make it easy to im|export GRASS maps to GMT, Matlab, et al.)
> What's the MATLAB equivalent pswiggle or something like that?

quiver.  I'm not familiar with anything like "pswiggle".


> Anyway, something that can handle direction and magnitude from either 
> U and V components, or a single grid with bearing/angle.
[..]
> As for vector plots, wouldn't it (also) make sense to take two rasters
> U and V where the arrow direction:
>  dir =3D atan2(u, v)
>  mag =3D sqrt(u^2 + v^2)

I prefer magnitude,direction maps to U,V maps as GRASS already works with 
direction maps. Converting U,V to theta,r maps is only a r.mapcalc away.


> It should also probably handle both Cartesian and Nautical conventions 
> for representing angles 

[done]

> and both Atmospheric and Oceanographic conventions for plotting the 
> arrows (currents coming from or currents going to).

Again, I prefer to keep the module simple and let the user use r.mapcalc if
they want the other convention. This makes us all think about it a bit more?
d.rast.arrow expects aspect maps to point downslope, ie "going to".


Hamish
Fri, Oct 7 2005 06:40:08    Subject changed to d.rast.arrow: magnitude raster map sets arrow length by hbowman  
Fri, Oct 7 2005 08:02:54    Mail sent by dfinlays@u.washington.edu  
Return-Path <david.p.finlayson@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UngQtDTqNTE658RvkVej0KFjlsxnKJyuMBQNyynt05j371xMBU/d2QlcpLjpedy1uM2Hzj1+GsZHN0y9UQHX7wiHE3CjMooU+5fHtKdCiHopGReGH8Haw12BU848pXdr52GYLP+vbiZS1OAjrx8Yg8OP4Qi3p2J2wIjue6uUJos=
Message-ID <be6d1720510062302i151fa8b9jc634f7433bc1b372@mail.gmail.com>
Date Thu, 6 Oct 2005 23:02:50 -0700
From David Finlayson <dfinlays@u.washington.edu>
Reply-To dfinlays@u.washington.edu
Sender david.p.finlayson@gmail.com
To Harmish Bowman via RT <grass-bugs@intevation.de>
Subject Re: [bug #3704] (grass) d.rast.arrow: magnitude raster map sets arrow length
In-Reply-To <20051007043944.BC6831006CF@lists.intevation.de>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Content-Disposition inline
References <20051007043944.BC6831006CF@lists.intevation.de>
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Fair enough. Thank you for your effort on this. I can use the
modifications immediately.

David

On 10/6/05, Harmish Bowman via RT <grass-bugs@intevation.de> wrote:
> > Someday I would like to see a general raster vector display tool in
>
> > GRASS. Something like grdvector in GMT.
>
>
>
> At some point it is better to let GMT do the job of cartography versus
>
> duplicating the effort within GRASS. Each to our own strengths.
>
> (As long as we make it easy to im|export GRASS maps to GMT, Matlab, et al=
.)
>
>
>
> > What's the MATLAB equivalent pswiggle or something like that?
>
>
>
> quiver.  I'm not familiar with anything like "pswiggle".
>
>
>
>
>
> > Anyway, something that can handle direction and magnitude from either
>
> > U and V components, or a single grid with bearing/angle.
>
> [..]
>
> > As for vector plots, wouldn't it (also) make sense to take two rasters
>
> > U and V where the arrow direction:
>
> >  dir =3D3D atan2(u, v)
>
> >  mag =3D3D sqrt(u^2 + v^2)
>
>
>
> I prefer magnitude,direction maps to U,V maps as GRASS already works with
>
> direction maps. Converting U,V to theta,r maps is only a r.mapcalc away.
>
>
>
>
>
> > It should also probably handle both Cartesian and Nautical conventions
>
> > for representing angles
>
>
>
> [done]
>
>
>
> > and both Atmospheric and Oceanographic conventions for plotting the
>
> > arrows (currents coming from or currents going to).
>
>
>
> Again, I prefer to keep the module simple and let the user use r.mapcalc =
if
>
> they want the other convention. This makes us all think about it a bit mo=
re?
>
> d.rast.arrow expects aspect maps to point downslope, ie "going to".
>
>
>
>
>
> Hamish
>
>
>
> -------------------------------------------- Managed by Request Tracker
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays


Fri, Oct 7 2005 23:40:01    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Fri, 07 Oct 2005 14:39:38 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
In-reply-to <20051007003827.32F211005DF@lists.intevation.de>
To Paolo Cavallini via RT <grass-bugs@intevation.de>, david.p.finlayson@gmail.com
Cc grass5@grass.itc.it
Message-id <BF6C392A.1ADDD%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.0.050811
Thread-Topic [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Thread-Index AcXLh53l3CvBMDd6EdqCvAAKlZU4cA==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
This is great. Thanks much. Following up on the rest of the thread (not
reproduced here), this is moving toward a very useful new visualization
tool, especially if arrow magnitude (width or length, but maybe width is
better because of length limits imposed by grid sizes) can be read from
another map.

Currently, the arrows fill grid cells, set by the region resolution.
However, to be useful in a wider variety of uses (e.g., wind directions,
cost surface/travel visualization, animal movements/migration modeling, flow
intensities across channels, etc.) it would be useful to be able to drape a
map of arrows at a coarse resolution over a relief map (or nviz topography)
at a much higher resolution. I can't think of any way to do this, but maybe
someone out there can.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Harmish Bowman via RT <grass-bugs@intevation.de>
> Reply-To: Harmish Bowman via RT <grass-bugs@intevation.de>
> Date: Fri,  7 Oct 2005 02:38:27 +0200 (CEST)
> To: <david.p.finlayson@gmail.com>
> Cc: <grass5@grass.itc.it>
> Subject: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in
the
> monitor history
> 
> Ok, d.rast.arrow and d.rast.num are now added to the display monitor history
> list and should survive redraw, PNG export, zoom, etc.
> 
> 
> Also for d.rast.arrow I've added support for compass based aspect maps
> (degrees clockwise from north) and 360 degree resolution instead of D8 (where
> applicable).
> 
> i.e.
>  grass aspect maps:    1 deg resolution
>  compass aspect maps:  1 deg resolution
>  AGNPS aspect maps:    D8 resolution (45 degrees)
>  ANSWERS aspect maps:  15 degree resolution
> 
> 
> Two things to think about:
> - How to visualize MDF directional flow created by r.terraflow?
> 
> - With a little more effort, arrow size (magnitude) could be read
>   from a second raster map, perhaps with a default scaling factor which
>   could take the max of the raster range to be 10x the cell width.
>   i.e. Eulerian velocity fields!
> 
> 
> screenshot:
>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_360.png
> 
> 
> 
> enjoy,
> Hamish
> 
> 
> -------------------------------------------- Managed by Request Tracker
> 


Mon, Oct 10 2005 02:00:24    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Mon, 10 Oct 2005 13:00:04 +1300
From Hamish <hamish_nospam@yahoo.com>
To Michael Barton <michael.barton@asu.edu>
Cc grass-bugs@intevation.de, david.p.finlayson@gmail.com, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Message-Id <20051010130004.7b8d3e24.hamish_nospam@yahoo.com>
In-Reply-To <BF6C392A.1ADDD%michael.barton@asu.edu>
References <20051007003827.32F211005DF@lists.intevation.de> <BF6C392A.1ADDD%michael.barton@asu.edu>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> This is great. Thanks much. Following up on the rest of the thread
> (not reproduced here), this is moving toward a very useful new
> visualization tool, especially if arrow magnitude (width or length,
> but maybe width is better because of length limits imposed by grid
> sizes) can be read from another map.

Changing the arrow size based on magnitude is the common convention.
Scaling both length & width is an option (be it more work) after the
simple line case is working. There is no limit to fitting the arrow
within the cell, that's just how it has been programmed so far.

The new function would place the center of the arrow's tail in the
center of the source cell, then rotate and scale the arrow size based on
the magnitude raster. A scale factor option would be given on the
command line, but the the default would be to make the longest arrow 10x
the grid size or so.

I have started on this, but with no great haste.

 
> Currently, the arrows fill grid cells, set by the region resolution.
> However, to be useful in a wider variety of uses (e.g., wind
> directions, cost surface/travel visualization, animal
> movements/migration modeling, flow intensities across channels, etc.)
> it would be useful to be able to drape a map of arrows at a coarse
> resolution over a relief map (or nviz topography) at a much higher
> resolution. I can't think of any way to do this, but maybe someone out
> there can.

g.region rast=source_map
d.rast source_map
g.region res=  (res * 16)
d.rast.arrow ...

perhaps that leads to aliasing problems?


Hamish


Mon, Oct 10 2005 08:15:14    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Sun, 09 Oct 2005 23:15:16 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
In-reply-to <20051010130004.7b8d3e24.hamish_nospam@yahoo.com>
To Hamish <hamish_nospam@yahoo.com>
Cc Paolo Cavallini via RT <grass-bugs@intevation.de>, david.p.finlayson@gmail.com, grass5 <grass5@grass.itc.it>
Message-id <BF6F5504.3757%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.0.050811
Thread-Topic [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Thread-Index AcXNYfs0ObRWzTlVEdqz7wAKlW/i4A==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
This seems to work, but it is clunky. I could of course script a way to
change resolution, display arrows, and change it back again. However, I
wonder if this is desirable enough, when you make your improvements to
d.rast.arrow, that it is worthwhile to include a (temporary) resolution
setting in the module itself?

E.g., "set 2D resolution for arrow display (default is resolution of current
region): "


Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish <hamish_nospam@yahoo.com>
> Date: Mon, 10 Oct 2005 13:00:04 +1300
> To: Michael Barton <michael.barton@asu.edu>
> Cc: <grass-bugs@intevation.de>, <david.p.finlayson@gmail.com>,
> <grass5@grass.itc.it>
> Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line
in
> the monitor history
> 
> 
> g.region rast=source_map
> d.rast source_map
> g.region res=  (res * 16)
> d.rast.arrow ...
> 
> perhaps that leads to aliasing problems?
> 


Wed, Oct 12 2005 08:11:25    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 12 Oct 2005 19:05:02 +1300
From Hamish <hamish_nospam@yahoo.com>
To Michael Barton <michael.barton@asu.edu>
Cc grass-bugs@intevation.de, david.p.finlayson@gmail.com, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Message-Id <20051012190502.7e85cb70.hamish_nospam@yahoo.com>
In-Reply-To <BF6F5504.3757%michael.barton@asu.edu>
References <20051010130004.7b8d3e24.hamish_nospam@yahoo.com> <BF6F5504.3757%michael.barton@asu.edu>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
[d.rast.arrow too cluttered to be useful]

> > g.region rast=source_map
> > d.rast source_map
> > g.region res=  (res * 16)
> > d.rast.arrow ...
> > 
> > perhaps that leads to aliasing problems?
>
> This seems to work, but it is clunky. I could of course script a way
> to change resolution, display arrows, and change it back again.
> However, I wonder if this is desirable enough, when you make your
> improvements to d.rast.arrow, that it is worthwhile to include a
> (temporary) resolution setting in the module itself?

Done & in CVS.

d.rast.arrow now can take a raster map for arrow magnitude and there is
a new skip option to only draw arrows every Nth cell.

screenshot showing raster elevation level, with arrow direction and size
controlled by aspect and slope maps (created with r.slope.aspect); skip
factor set to only draw every third cell; and grid color set to "none":

  http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png


The question remains what to do if fed negative magnitudes. Right now I
have it skipping over that arrow (as it does for NULL values), but it
could take the absolute value or rotate the arrow 180 degrees.


enjoy,
Hamish


Wed, Oct 12 2005 08:28:09    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 11 Oct 2005 23:27:00 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
In-reply-to <20051012190502.7e85cb70.hamish_nospam@yahoo.com>
To Hamish <hamish_nospam@yahoo.com>
Cc Paolo Cavallini via RT <grass-bugs@intevation.de>, david.p.finlayson@gmail.com, grass5@grass.itc.it
Message-id <BF71FAC4.385D%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.0.050811
Thread-Topic [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Thread-Index AcXO9fOmMjSczDrpEdqhNAAKlW/i4A==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Hamish,

This looks great. I could have really used this in a paper on modeling
Viking seafaring last year. But we are going to do another one soon, so I'll
have a chance to try this out.

With respect to negative magnitudes, I like your idea. It would accurately
visually indicate the data. An alternate color would make it stand out even
more, but that probably complicates things too much.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish <hamish_nospam@yahoo.com>
> Date: Wed, 12 Oct 2005 19:05:02 +1300
> To: Michael Barton <michael.barton@asu.edu>
> Cc: <grass-bugs@intevation.de>, <david.p.finlayson@gmail.com>,
> <grass5@grass.itc.it>
> Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line
in
> the monitor history
> 
> [d.rast.arrow too cluttered to be useful]
> 
>>> g.region rast=source_map
>>> d.rast source_map
>>> g.region res=  (res * 16)
>>> d.rast.arrow ...
>>> 
>>> perhaps that leads to aliasing problems?
>> 
>> This seems to work, but it is clunky. I could of course script a way
>> to change resolution, display arrows, and change it back again.
>> However, I wonder if this is desirable enough, when you make your
>> improvements to d.rast.arrow, that it is worthwhile to include a
>> (temporary) resolution setting in the module itself?
> 
> Done & in CVS.
> 
> d.rast.arrow now can take a raster map for arrow magnitude and there is
> a new skip option to only draw arrows every Nth cell.
> 
> screenshot showing raster elevation level, with arrow direction and size
> controlled by aspect and slope maps (created with r.slope.aspect); skip
> factor set to only draw every third cell; and grid color set to "none":
> 
>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png
> 
> 
> The question remains what to do if fed negative magnitudes. Right now I
> have it skipping over that arrow (as it does for NULL values), but it
> could take the absolute value or rotate the arrow 180 degrees.
> 
> 
> enjoy,
> Hamish


Wed, Oct 12 2005 17:06:08    Mail sent by daniel.calvelo@minag.gob.pe  
Return-Path <dcalvelo@minag.gob.pe>
Delivered-To grass-bugs@lists.intevation.de
From "Daniel Calvelo Aros" <dcalvelo@minag.gob.pe>
To Hamish <hamish_nospam@yahoo.com>, Michael Barton <michael.barton@asu.edu>
Cc grass-bugs@intevation.de, david.p.finlayson@gmail.com, grass5@grass.itc.it
Reply-To daniel.calvelo@minag.gob.pe
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Date Wed, 12 Oct 2005 10:02:02 -0500
Message-Id <20051012145843.M10280@minag.gob.pe>
In-Reply-To <20051012190502.7e85cb70.hamish_nospam@yahoo.com>
References <20051010130004.7b8d3e24.hamish_nospam@yahoo.com> <BF6F5504.3757%michael.barton@asu.edu> <20051012190502.7e85cb70.hamish_nospam@yahoo.com>
X-Mailer Open WebMail 2.41 20040926
X-OriginatingIP 200.60.220.18 (dcalvelo)
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
From: Hamish <hamish_nospam@yahoo.com>
Sent: Wed, 12 Oct 2005 19:05:02 +1300
> 
> Done & in CVS.
> 
> d.rast.arrow now can take a raster map for arrow magnitude and there 
> is a new skip option to only draw arrows every Nth cell.
> 
> screenshot showing raster elevation level, with arrow direction and size
> controlled by aspect and slope maps (created with r.slope.aspect); skip
> factor set to only draw every third cell; and grid color set to "none":
> 
>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png
> 
> The question remains what to do if fed negative magnitudes. Right 
> now I have it skipping over that arrow (as it does for NULL values), 
> but it could take the absolute value or rotate the arrow 180 degrees.

I'd say keep the current skip, but issue a warning; whatever the cartographer
needs to do he can using r.mapcalc (tell him in the warning and the docs).

The other possibility is to add an option, but I've the impression it somehow
reduces flexibility...

Daniel.


Wed, Oct 12 2005 17:53:12    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 12 Oct 2005 08:49:47 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
In-reply-to <20051012145843.M10280@minag.gob.pe>
To daniel.calvelo@minag.gob.pe, Hamish <hamish_nospam@yahoo.com>
Cc Paolo Cavallini via RT <grass-bugs@intevation.de>, david.p.finlayson@gmail.com, grass5@grass.itc.it
Message-id <BF727EAB.386E%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.0.050811
Thread-Topic [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Thread-Index AcXPRJJZ0QwvkDs3EdqUaAAKlW/i4A==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
A negative magnitude is not necessarily an error, but could have real
meaning.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Daniel Calvelo Aros <dcalvelo@minag.gob.pe>
> Reply-To: <daniel.calvelo@minag.gob.pe>
> Date: Wed, 12 Oct 2005 10:02:02 -0500
> To: Hamish <hamish_nospam@yahoo.com>, Michael Barton <michael.barton@asu.edu>
> Cc: <grass-bugs@intevation.de>, <david.p.finlayson@gmail.com>,
> <grass5@grass.itc.it>
> Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line
in
> the monitor history
> 
> From: Hamish <hamish_nospam@yahoo.com>
> Sent: Wed, 12 Oct 2005 19:05:02 +1300
>> 
>> Done & in CVS.
>> 
>> d.rast.arrow now can take a raster map for arrow magnitude and there
>> is a new skip option to only draw arrows every Nth cell.
>> 
>> screenshot showing raster elevation level, with arrow direction and size
>> controlled by aspect and slope maps (created with r.slope.aspect); skip
>> factor set to only draw every third cell; and grid color set to "none":
>> 
>>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png
>> 
>> The question remains what to do if fed negative magnitudes. Right
>> now I have it skipping over that arrow (as it does for NULL values),
>> but it could take the absolute value or rotate the arrow 180 degrees.
> 
> I'd say keep the current skip, but issue a warning; whatever the cartographer
> needs to do he can using r.mapcalc (tell him in the warning and the docs).
> 
> The other possibility is to add an option, but I've the impression it somehow
> reduces flexibility...
> 
> Daniel.


Wed, Oct 12 2005 18:32:24    Mail sent by dfinlays@u.washington.edu  
Return-Path <david.p.finlayson@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XYlN3GDas0AJ2Vdc1fOEgw/E/DVTAoHBNcztnV3mjxIqk1dsKUKO5BzA2DR3pgS8j4TghwvEi4DT4yP19fAjcg1VunI+i4gT3oHUxzIeiq3IXWkLxbwMrCfx14PSCizMWiR7jZDZxd3C3viVwMG6tSvVPiTOX83whxxuhIol4ss=
Message-ID <be6d1720510120930x3079364fke482ab7236c97d8@mail.gmail.com>
Date Wed, 12 Oct 2005 09:30:11 -0700
From David Finlayson <dfinlays@u.washington.edu>
Reply-To dfinlays@u.washington.edu
Sender david.p.finlayson@gmail.com
To Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Cc daniel.calvelo@minag.gob.pe, Hamish <hamish_nospam@yahoo.com>, Paolo Cavallini via RT <grass-bugs@intevation.de>, grass5@grass.itc.it
In-Reply-To <BF727EAB.386E%michael.barton@asu.edu>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Content-Disposition inline
References <20051012145843.M10280@minag.gob.pe> <BF727EAB.386E%michael.barton@asu.edu>
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Negative magnitudes are valid data. For example, one convention for
identifying direction (not used in d.rast.arrow) is to list only the
magnitudes U and V (x and y directions respectively). In this
convention, arrow direction is found by taking the arctangent of V/U.
In this case negative magnitudes are essential.

In the (direction, magnitude) convention adopted here for
d.rast.arrow, negative magnitudes are unnecessary, but they don't
violate any mathematical or logical rules that I am aware of. I would
leave them in and make a note in the manual how they are handled.

David



On 10/12/05, Michael Barton <michael.barton@asu.edu> wrote:
> A negative magnitude is not necessarily an error, but could have real
> meaning.
>
> Michael
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution and Social Change
> Arizona State University
> Tempe, AZ 85287-2402
>
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
>
>
>
> > From: Daniel Calvelo Aros <dcalvelo@minag.gob.pe>
> > Reply-To: <daniel.calvelo@minag.gob.pe>
> > Date: Wed, 12 Oct 2005 10:02:02 -0500
> > To: Hamish <hamish_nospam@yahoo.com>, Michael Barton <michael.barton@as=
u.edu>
> > Cc: <grass-bugs@intevation.de>, <david.p.finlayson@gmail.com>,
> > <grass5@grass.itc.it>
> > Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a =
line in
> > the monitor history
> >
> > From: Hamish <hamish_nospam@yahoo.com>
> > Sent: Wed, 12 Oct 2005 19:05:02 +1300
> >>
> >> Done & in CVS.
> >>
> >> d.rast.arrow now can take a raster map for arrow magnitude and there
> >> is a new skip option to only draw arrows every Nth cell.
> >>
> >> screenshot showing raster elevation level, with arrow direction and si=
ze
> >> controlled by aspect and slope maps (created with r.slope.aspect); ski=
p
> >> factor set to only draw every third cell; and grid color set to "none"=
:
> >>
> >>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png
> >>
> >> The question remains what to do if fed negative magnitudes. Right
> >> now I have it skipping over that arrow (as it does for NULL values),
> >> but it could take the absolute value or rotate the arrow 180 degrees.
> >
> > I'd say keep the current skip, but issue a warning; whatever the cartog=
rapher
> > needs to do he can using r.mapcalc (tell him in the warning and the doc=
s).
> >
> > The other possibility is to add an option, but I've the impression it s=
omehow
> > reduces flexibility...
> >
> > Daniel.
>
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays


Wed, Oct 12 2005 18:38:34    Mail sent by dfinlays@u.washington.edu  
Return-Path <david.p.finlayson@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JQJ76Jvjho4szwcAAl7LoIIX6iyZWoscookAJ763wWZVIgv7fcF0pq50gzbjeJg+mPTV8vJj4610w9DnlubGp4tXRPf0Z0z8+y6KuyN/CAJNDvQAYBOfM/ddzLdIKV9kka8nUPNUOdzXRKmjUz2XARbEZG3HH3drTTWbfhOkfjI=
Message-ID <be6d1720510120936x72156eaewa5894d64a3768247@mail.gmail.com>
Date Wed, 12 Oct 2005 09:36:16 -0700
From David Finlayson <dfinlays@u.washington.edu>
Reply-To dfinlays@u.washington.edu
Sender david.p.finlayson@gmail.com
To Michael Barton <michael.barton@asu.edu>
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Cc daniel.calvelo@minag.gob.pe, Hamish <hamish_nospam@yahoo.com>, Paolo Cavallini via RT <grass-bugs@intevation.de>, grass5@grass.itc.it
In-Reply-To <be6d1720510120930x3079364fke482ab7236c97d8@mail.gmail.com>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Content-Disposition inline
References <20051012145843.M10280@minag.gob.pe> <BF727EAB.386E%michael.barton@asu.edu> <be6d1720510120930x3079364fke482ab7236c97d8@mail.gmail.com>
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Curious, how does d.rast.arrow handle angles larger than 360 or less than 0=
?

I usually include this line in my direction code to reduce the angle
to 0 < angle <=3D 360:

newangle =3D oldangle % 360.0

For example:

270.0 =3D -450.0 % 360.0

(% is the modulus operator) As you can see, it should work even for
negative angles.

David



On 10/12/05, David Finlayson <dfinlays@u.washington.edu> wrote:
> Negative magnitudes are valid data. For example, one convention for
> identifying direction (not used in d.rast.arrow) is to list only the
> magnitudes U and V (x and y directions respectively). In this
> convention, arrow direction is found by taking the arctangent of V/U.
> In this case negative magnitudes are essential.
>
> In the (direction, magnitude) convention adopted here for
> d.rast.arrow, negative magnitudes are unnecessary, but they don't
> violate any mathematical or logical rules that I am aware of. I would
> leave them in and make a note in the manual how they are handled.
>
> David
>
>
>
> On 10/12/05, Michael Barton <michael.barton@asu.edu> wrote:
> > A negative magnitude is not necessarily an error, but could have real
> > meaning.
> >
> > Michael
> > __________________________________________
> > Michael Barton, Professor of Anthropology
> > School of Human Evolution and Social Change
> > Arizona State University
> > Tempe, AZ 85287-2402
> >
> > phone: 480-965-6213
> > fax: 480-965-7671
> > www: http://www.public.asu.edu/~cmbarton
> >
> >
> >
> > > From: Daniel Calvelo Aros <dcalvelo@minag.gob.pe>
> > > Reply-To: <daniel.calvelo@minag.gob.pe>
> > > Date: Wed, 12 Oct 2005 10:02:02 -0500
> > > To: Hamish <hamish_nospam@yahoo.com>, Michael Barton <michael.barton@=
asu.edu>
> > > Cc: <grass-bugs@intevation.de>, <david.p.finlayson@gmail.com>,
> > > <grass5@grass.itc.it>
> > > Subject: Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save =
a line in
> > > the monitor history
> > >
> > > From: Hamish <hamish_nospam@yahoo.com>
> > > Sent: Wed, 12 Oct 2005 19:05:02 +1300
> > >>
> > >> Done & in CVS.
> > >>
> > >> d.rast.arrow now can take a raster map for arrow magnitude and there
> > >> is a new skip option to only draw arrows every Nth cell.
> > >>
> > >> screenshot showing raster elevation level, with arrow direction and =
size
> > >> controlled by aspect and slope maps (created with r.slope.aspect); s=
kip
> > >> factor set to only draw every third cell; and grid color set to "non=
e":
> > >>
> > >>   http://bambi.otago.ac.nz/hamish/grass/d_rast_arrow_magnitude.png
> > >>
> > >> The question remains what to do if fed negative magnitudes. Right
> > >> now I have it skipping over that arrow (as it does for NULL values),
> > >> but it could take the absolute value or rotate the arrow 180 degrees=
.
> > >
> > > I'd say keep the current skip, but issue a warning; whatever the cart=
ographer
> > > needs to do he can using r.mapcalc (tell him in the warning and the d=
ocs).
> > >
> > > The other possibility is to add an option, but I've the impression it=
somehow
> > > reduces flexibility...
> > >
> > > Daniel.
> >
> >
>
>
> --
> David Finlayson
> Marine Geology & Geophysics
> School of Oceanography
> Box 357940
> University of Washington
> Seattle, WA  98195-7940
> USA
>
> Office: Marine Sciences Building, Room 112
> Phone: (206) 616-9407
> Web: http://students.washington.edu/dfinlays
>


--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays


Wed, Oct 12 2005 22:26:00    Mail sent by daniel.calvelo@minag.gob.pe  
Return-Path <dcalvelo@minag.gob.pe>
Delivered-To grass-bugs@lists.intevation.de
From "Daniel Calvelo Aros" <dcalvelo@minag.gob.pe>
To dfinlays@u.washington.edu, Michael Barton <michael.barton@asu.edu>
Cc Hamish <hamish_nospam@yahoo.com>, Paolo Cavallini via RT <grass-bugs@intevation.de>, grass5@grass.itc.it
Reply-To daniel.calvelo@minag.gob.pe
Subject Re: [GRASS5] [bug #3704] (grass) d.rast.arrow does not save a line in the monitor history
Date Wed, 12 Oct 2005 15:22:12 -0500
Message-Id <20051012200904.M53580@minag.gob.pe>
In-Reply-To <be6d1720510120930x3079364fke482ab7236c97d8@mail.gmail.com>
References <20051012145843.M10280@minag.gob.pe> <BF727EAB.386E%michael.barton@asu.edu> <be6d1720510120930x3079364fke482ab7236c97d8@mail.gmail.com>
X-Mailer Open WebMail 2.41 20040926
X-OriginatingIP 200.106.28.120 (dcalvelo)
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
From: David Finlayson <dfinlays@u.washington.edu>
Sent: Wed, 12 Oct 2005 09:30:11 -0700
>
> Negative magnitudes are valid data. For example, one convention for
> identifying direction (not used in d.rast.arrow) is to list only the
> magnitudes U and V (x and y directions respectively). In this
> convention, arrow direction is found by taking the arctangent of V/U.
> In this case negative magnitudes are essential.
> 
> In the (direction, magnitude) convention adopted here for
> d.rast.arrow, negative magnitudes are unnecessary, but they don't
> violate any mathematical or logical rules that I am aware of. 

Absolutely.

> I would
> leave them in and make a note in the manual how they are handled.

In that case, color them differently by default, and *optionally* have them
follow the (dir,mag) == (dir + pi mod pi, -mag) identity in the same color.
I'm sure there are applications where (45deg,1) doesn't mean the same as
(225deg,-1), and the original application insisted on positive magnitudes.

Then you don't need a warning (or maybe you do for scripting purposes) but the
user has a visual cue about the presence of negative values in her data. And
mentioning that in the docs pointing to r.mapcalc options I think is consensus
so far.

Daniel.


Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request