pygmt.grdhisteq
- class pygmt.grdhisteq[source]
Perform histogram equalization for a grid.
Two common use cases of
pygmt.grdhisteqare 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.grdimageorpygmt.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_binscan provide a list of data values that divide the data range into divisions which have an equal area in the image [Default is 16 ifdivisionsis not set]. Thepandas.DataFrameor ASCII file output can be used to make a colormap withpygmt.makecptand an image withpygmt.Figure.grdimagethat has all levels of gray occuring equally.pygmt.grdhisteq.equalize_gridprovides a way to write a grid with statistics based on a cumulative distribution function. In this application, theoutgridhas 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. |