pygmi.raster.anaglyph#
Anaglyph routine.
This module allows for the creation of anaglyphs - which can then be used for feature detection and interpretation.
Classes#
Anaglyph GUI Graph Window. |
Functions#
|
Perform Sunshading on data. |
|
Colour Anaglyph. |
|
Rotate and clean rotated data for 2d view. |
Module Contents#
- class pygmi.raster.anaglyph.PlotAnaglyph(parent=None)#
Bases:
pygmi.misc.ContextModuleAnaglyph GUI Graph Window.
- Parameters:
parent – Reference to the parent routine. The default is None.
- change_all()#
Update from all combos.
- change_colors()#
Update colour bar.
- change_atype()#
Update anaglyph type.
- change_contours()#
Update contours.
- change_image()#
Change Image, setting defaults.
- run()#
Entry point into the routine, used to run context menu item.
- update_contours(data1, scale=7, rotang=10)#
Update the contour plot.
- Parameters:
data1 (pygmi.raster.datatypes.Data) – raster dataset to be used in contouring.
scale (float) – Scale. The default is 7.
rotang (float) – Rotation in degrees. The default is 10.
- update_raster(data1, *, scale=7, rotang=10, atype='dubois', cmap=colormaps['jet'], shade=False)#
Update the raster plot.
- Parameters:
data1 (pygmi.raster.datatypes.Data) – Raster dataset to be used in contouring
scale (float) – Scale. The default is 7.
rotang (float) – Rotation in degrees. The default is 10.
atype (str) – Anaglyph type. The default is ‘dubois’.
cmap (matplotlib.colors.LinearSegmentedColormap) – Matplotlib colormap. The default is jet.
shade (bool) – Option to choose sunshading. The default is False.
- update_colors(doshade=False, cmap=colormaps['jet'], atype='dubois')#
Update colors.
- Parameters:
doshade (bool) – Option to choose sunshading. The default is False.
cmap (matplotlib.colors.LinearSegmentedColormap) – Matplotlib colormap. The default is jet.
atype (str) – Anaglyph type. The default is ‘dubois’.
- update_atype(atype='dubois')#
Update anaglyph type.
- Parameters:
atype (str) – Anaglyph type. The default is ‘dubois’.
- pygmi.raster.anaglyph.sunshade(data, *, azim=-np.pi / 4.0, elev=np.pi / 4.0, alpha=1, cell=100, cmap=colormaps['terrain'])#
Perform Sunshading on data.
- Parameters:
data (numpy.ma.MaskedArray) – input MxN data to be imaged.
azim (float) – Sun azimuth. The default is -np.pi/4..
elev (float) – Sun elevation. The default is np.pi/4..
alpha (float) – how much incident light is reflected (0 to 1). The default is 1.
cell (float) – between 1 and 100 - controls sunshade detail. The default is 100.
cmap (matplotlib.colors.LinearSegmentedColormap) – Matplotlib colormap.
- Returns:
Output colour mapped array (MxNx4).
- Return type:
ndarray
- pygmi.raster.anaglyph.anaglyph(red, blue, atype='dubois')#
Colour Anaglyph.
- Parameters:
red (numpy.typing.NDArray) – Dataset for red channel.
blue (numpy.typing.NDArray) – Dataset for blue channel.
atype (str) – Anaglyph type. The default is ‘dubois’.
- Returns:
Output dataset.
- Return type:
ndarray
- pygmi.raster.anaglyph.rot_and_clean(x, y, z, rotang=5, rtype='red')#
Rotate and clean rotated data for 2d view.
- Parameters:
x (numpy.typing.NDArray) – X coordinates.
y (numpy.typing.NDArray) – Y coordinates.
z (numpy.typing.NDArray) – Z coordinates (or data values).
rotang (float) – Rotation angle. The default is 5.
rtype (str) – Rotation type. The default is ‘red’.
- Returns:
Output data.
- Return type:
ndarray