pygmi.raster.graphs#

Plot Raster Data.

This module provides a variety of methods to plot raster data via the context menu. The following are supported:

  • Correlation coefficients

  • Images

  • Surfaces

  • Histograms

  • Scatterplots

Classes#

PlotCCoef

Plot 2D Correlation Coefficients.

PlotRaster

Plot Raster Class.

PlotSurface

Plot Surface Class.

PlotScatter

Plot Hexbin Class.

PlotHist

Plot Histogram Class.

Functions#

check_bands(data)

Check that band sizes are the same.

corr2d(idat1, idat2)

Calculate the 2D correlation.

Module Contents#

class pygmi.raster.graphs.PlotCCoef(parent=None)#

Bases: pygmi.misc.ContextModule

Plot 2D Correlation Coefficients.

Parameters:

parent – Reference to the parent routine. The default is None.

run()#

Entry point into the routine, used to run context menu item.

update_ccoef(data1, dmat)#

Update the correlation coefficient plot.

Parameters:
  • data1 (pygmi.raster.datatypes.Data) – Raster dataset to be used.

  • dmat (numpy.typing.NDArray) – Dummy matrix of numbers to be plotted using pcolor.

class pygmi.raster.graphs.PlotRaster(parent=None)#

Bases: pygmi.misc.ContextModule

Plot Raster Class.

Parameters:

parent – Reference to the parent routine. The default is None.

change_band()#

Combo box to choose band.

format_coord(x, y)#

Set format coordinate for section plot.

Parameters:
  • x (float) – X coordinate.

  • y (float) – Y coordinate.

Returns:

Output string to display.

Return type:

str

run()#

Entry point into the routine, used to run context menu item.

update_raster(data1, cmap, plotlog, aspect=1, interp='none')#

Update the raster plot.

Parameters:
  • data1 (pygmi.raster.datatypes.Data) – Raster dataset to be used in contouring

  • cmap (str) – Matplotlib colormap description

  • plotlog (bool) – Use a logarithmic colour scale.

  • aspect (int) – Aspect ratio of colour bar.

  • interp (str)

class pygmi.raster.graphs.PlotSurface(parent=None)#

Bases: pygmi.misc.ContextModule

Plot Surface Class.

Parameters:

parent – Reference to the parent routine. The default is None.

change_band()#

Combo box to choose band.

closeEvent(event)#

Close event.

run()#

Entry point into the routine, used to run context menu item.

slider()#

Vertical slider used to scale 3D view.

class pygmi.raster.graphs.PlotScatter(parent=None)#

Bases: pygmi.misc.ContextModule

Plot Hexbin Class.

A Hexbin is a type of scatter plot which is raster.

Parameters:

parent – Reference to the parent routine. The default is None.

change_band()#

Combo box to choose band.

run()#

Entry point into the routine, used to run context menu item.

update_hexbin(data1, data2)#

Update the hexbin plot.

Parameters:
class pygmi.raster.graphs.PlotHist(parent=None)#

Bases: pygmi.misc.ContextModule

Plot Histogram Class.

Parameters:

parent – Reference to the parent routine. The default is None.

change_band()#

Combo box to choose band.

run()#

Entry point into the routine, used to run context menu item.

update_hist(data1, ylog, iscum)#

Update the histogram plot.

Parameters:
  • data1 (pygmi.raster.datatypes.Data) – Raster dataset to be used

  • ylog (bool) – Boolean for a log scale on y-axis.

  • iscum (bool) – Boolean for a cumulative distribution.

pygmi.raster.graphs.check_bands(data)#

Check that band sizes are the same.

Parameters:

data (list[pygmi.raster.datatypes.Data]) – PyGMI raster dataset.

Returns:

chk – True if sizes are the same, False otherwise.

Return type:

bool

pygmi.raster.graphs.corr2d(idat1, idat2)#

Calculate the 2D correlation.

Parameters:
  • idat1 (numpy.ma.MaskedArray) – Dataset 1 for use in correlation calculation.

  • idat2 (numpy.ma.MaskedArray) – Dataset 2 for use in correlation calculation.

Returns:

Array of correlation coefficients

Return type:

ndarray