Grdgradient: -S output

grdgradient -S says: Name of output grid file with scalar magnitudes of gradient vectors.

Does this mean that output is in radians?

This post was flagged by the community and is temporarily hidden.

No. Gradient magnitude is in z-data-units/horizontal distance.

Thanks Paul.

So in order to get the degree of slope, I could take arctan(z-data-units/horizontal distance) (based on this)?
Are there any gmt-utilities that can do this for me directly, or do I have to use some grdmath RPN magic?

So slope only makes sense for DEMs. For other data types there is no “angle”, just things like mGal/km. If you converted to flat Earth scaling (via -fg) then I think the gradients for a DEM will be in meters/km and you would need to scale it by 0.001 to get dimensionless tangents and then inverse tangent to get the angle.

Try this to get a slope grid in degrees.

    gmt grdmath $GRD ATAND = $SLP

grdgdal says it can do it.

-A prog[+m method +c cpt]

Select which GDAL program to run (currently one of info, dem, grid, rasterize, translate or warp). When program is dem then please append +m method (pick one of hillshade, color-relief, slope, TRI, TPI or roughness)

Thank you all for tips and comments. Will test.