GRDGRADIENT

Section: Misc. Reference Manual Pages (l)
Updated: DATE
Index Return to Main Contents
 

NAME

grdgradient - Compute directional gradients from 2-D grd files  

SYNOPSIS

grdgradient in_grdfile -Aazim -Gout_grdfile [ -M ] [ -N[t][norm] ] [ -V ]  

DESCRIPTION

grdgradient may be used to compute the directional derivative of a grdfile representing z(x,y). The program finds -[dz/dx*sin(azim) + dz/dy* cos(azim)], where azim is an angle (in degrees) in the x,y plane measured positive clockwise from north (the y axis) toward east (the x axis). The derivative is negated so that grdgradient will give positive values when the slope of z(x,y) is downhill in the azim direction. The reason for this is that most applications for grdgradient are in shading the illumination of an image (see grdimage and grdview), and if we take the light source to be above the x,y plane then slopes which are downhill toward the light source are bright (positive) while slopes which are uphill toward the light source are dark (negative).
       No space between the option flag and the associated arguments. Use upper case for the
option flags and lower case for modifiers.
in_grdfile
2-D grd file from which to compute directional derivative.
-A
Azimuthal direction. azim is the angle (in degrees) in the x,y plane measured positive clockwise from north (the y axis) toward east (the x axis).
-G
Name of the output grdfile with directional derivative.

 

OPTIONS

-M
By default the units of grdgradient are in units_of_z/units_of_dx_and_dy. However, the user may choose this option to convert dx,dy in degrees of longitude,latitude into meters, so that the units of grdgradient are in z_units/meter.
-N
This option will scale and offset all the actual gradient values by a constant scale and offset so that the maximum absolute value of the output is norm. By default, no normalization is done. If -N or -Nt is chosen without setting the value of norm, then the gradients are normalized to 1.0. If -Nt is chosen, then the gradients are adjusted to be (2 * norm / PI) * atan( (g - m)/s), where g is the gradient, m is the mean gradient and s the standard deviation. This is often a good first choice for an intensity file to be used with grdimage or grdview. Further adjustments to gradients for intensities may be made with grdmath or grdhisteq. #include "explain_-V.txt"
 

EXAMPLES

To find the atan-normalized directional derivative of the file geoid.grd in the north direction, do

grdgradient geoid.grd -A0 -Ggradients.grd -Nt -V

To get the gradient of the scalar field z.grd we take the gradient in the negative x- and y-directions (because of the sign convention above) and obtain the two components of grad (z) which can be plotted with grdvector:

grdgradient z.grd -A270 -Gdzdx.grd
grdgradient z.grd -A180 -Gdzdy.grd
 

SEE ALSO

gmt, gmtdefaults, grdhisteq, grdimage, grdview, grdvector #include "refs.i"


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 01:25:40 GMT, February 16, 2023