Opened 7 years ago

Last modified 8 months ago

#1726 new enhancement

r.plane: change azimuth option to be CCW from the +x axis

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Python Version: svn-trunk
Keywords: r.plane Cc:
CPU: All Platform: All

Description

Hi,

The r.plane script (all versions) does a bit of a funny thing, it takes as input azimuth as degrees CCW from north.

Which is a bit weird, as it's neither the nautical compass convention (degrees CW from north), nor the mathematical convention that grass usually uses (theta measured CCW from the +x axis).

before I change it, does anyone know why it might intentionally be weird like that?

as with d.barb and some other modules, the updated version would give you the alternate option to work in nautical convention.

    type_opt = G_define_option();
    type_opt->key = "aspect_type";
    type_opt->type = TYPE_STRING;
    type_opt->required = NO;
    type_opt->answer = "cartesian";
    type_opt->options = "cartesian,compass";
    type_opt->description = _("Direction map aspect type");

the test case I'm working with is to make a generalized background trend map by taking some raster data, use r.slope.aspect + r.univar to find the average slope,dx,dy maps, then use atan2(dy,dx) to find the mean azimuth. then use raster map's center x,y,z value as the pivot point for r.plane. (probably should use median(z) instead of center-z for that?) another point of refinement is to take the center-of-gravity center cell as the pivot point not the center of the region, as there may be block of null cells not contributing to the mean. To find the COG there is the v.points.cog addon script, but I suspect the method may be a bit inefficient. any other modules that could do that?

thoughts?

Hamish

Change History (9)

comment:1 Changed 7 years ago by hamish

Summary: r.planer.plane: change azimuth option to be CCW from the +x axis

comment:2 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:3 Changed 3 years ago by martinl

Milestone: 7.0.57.3.0

comment:4 Changed 3 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:5 Changed 23 months ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:6 Changed 18 months ago by neteler

Milestone: 7.4.17.4.2

comment:7 Changed 15 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:8 Changed 11 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:9 Changed 8 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.