pygmt.grdhisteq
- class pygmt.grdhisteq[source]
Perform histogram equalization for a grid.
Two common use cases of
pygmt.grdhisteq
are to find data values that divide a grid into patches of equal area (pygmt.grdhisteq.compute_bins
) or to write a grid with statistics based on some kind of cumulative distribution function (pygmt.grdhisteq.equalize_grid
).Histogram equalization provides a way to highlight data that has most values clustered in a small portion of the dynamic range, such as a grid of flat topography with a mountain in the middle. Ordinary gray shading of this grid (using
pygmt.Figure.grdimage
orpygmt.Figure.grdview
) with a linear mapping from topography to graytone will result in most of the image being very dark gray, with the mountain being almost white.pygmt.grdhisteq.compute_bins
can provide a list of data values that divide the data range into divisions which have an equal area in the image [Default is 16 ifdivisions
is not set]. Thepandas.DataFrame
or ASCII file output can be used to make a colormap withpygmt.makecpt
and an image withpygmt.Figure.grdimage
that has all levels of gray occurring equally.pygmt.grdhisteq.equalize_grid
provides a way to write a grid with statistics based on a cumulative distribution function. In this application, theoutgrid
has relative highs and lows in the same (x,y) locations as thegrid
, but the values are changed to reflect their place in the cumulative distribution.
Methods Summary
|
Perform histogram equalization for a grid. |
|
Perform histogram equalization for a grid. |