Skip to content

d.polar

Draws polar diagram of angle map such as aspect or flow directions

d.polar [-x] map=name [undef=float] [output=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

d.polar map=name

grass.script.run_command("d.polar", map, undef=None, output=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("d.polar", map="name")

Parameters

map=name [required]
    Name of raster angle map
undef=float
    Pixel value to be interpreted as undefined (different from NULL)
output=name
    Name for optional EPS output file
-x
    Plot using Xgraph
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

map : str, required
    Name of raster angle map
    Used as: input, raster, name
undef : float, optional
    Pixel value to be interpreted as undefined (different from NULL)
output : str, optional
    Name for optional EPS output file
    Used as: output, file, name
flags : str, optional
    Allowed values: x
    x
        Plot using Xgraph
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

d.polar calculates and displays a polar diagram of an angle raster map such as aspect, wind direction, or flow. The input angle map orientation must be counter-clockwise (CCW) from east, and the angle map units must be degrees. This refers to the standard orientation of GRASS (e.g., see r.slope.aspect).

The radius of the outer circle is defined by the total number of pixels in the map. If the polar diagram does not reach the outer circle, no data (NULL) pixels were found in the map.

The vector in the diagram indicates a prevailing direction, its length the strength of such direction. In case all angle vectors are oriented along the same direction, the length for the vector is maximal (in fact it is equal to length of the most populated bin of the underlying histogram).

As a side effect, the quality of the angle map can be derived from the diagram. Strong spikes may indicate an over-representation of the related angle(s) which happens in particular if integer maps are used.

NOTES

If the output parameter is used, the diagram is generated as EPS file. If the -x flag is used xgraph is launched. Otherwise d.polar will use d.graph to draw the plot in the current display frame.

If d.polar is used on an aspect map generated by r.slope.aspect, the undef parameter should be set to 0 to distinguish NO DATA (NULL) areas from areas where aspect is undefined (i.e. flat areas).

Polar diagram of aspect map
Polar diagram of aspect map

EXAMPLE

In this example, the polar diagram of the 'aspect' angle map in the North Carolina sample dataset is generated:

g.region raster=aspect -p
d.polar aspect

XGRAPH REQUIREMENT

Xgraph must be installed for the -x flag to function.

SEE ALSO

d.graph, d.histogram, d.rast.arrow, r.slope.aspect

REFERENCES

J. Hofierka, H. Mitasova, and M. Neteler (2009): Terrain parameterization in GRASS. In T. Hengl and H.I. Reuter, editors, Geomorphometry: concepts, software, applications. Elsevier (DOI)

AUTHORS

Markus Neteler, ITC-irst, Italy
Bruno Caprile, ITC-irst, Italy
Hamish Bowman, Otago University, New Zealand

SOURCE CODE

Available at: d.polar source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f