pygmi.raster.anaglyph#
Anaglyph routine.
Classes#
Matplotlib canvas widget for the actual plot. |
|
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.MyMplCanvas(parent=None)#
Bases:
matplotlib.backends.backend_qtagg.FigureCanvasQTAgg
Matplotlib canvas widget for the actual plot.
- Parameters:
parent (parent, optional) – Reference to the parent routine. The default is None.
- update_contours(data1, scale=7, rotang=10)#
Update the contour plot.
- Parameters:
data1 (PyGMI raster data.) – raster dataset to be used in contouring.
scale (float, optional) – Scale. The default is 7.
rotang (float, optional) – Rotation in degrees. The default is 10.
- Return type:
None.
- update_raster(data1, *, scale=7, rotang=10, atype='dubois', cmap=colormaps['jet'], shade=False)#
Update the raster plot.
- Parameters:
data1 (PyGMI raster Data) – raster dataset to be used in contouring
scale (float, optional) – Scale. The default is 7.
rotang (float, optional) – Rotation in degrees. The default is 10.
atype (str, optional) – Anaglyph type. The default is ‘dubois’.
cmap (matplotlib.colors.LinearSegmentedColormap, optional) – Matplotlib colormap. The default is jet.
shade (bool, optional) – Option to choose sunshading. The default is False.
- Return type:
None.
- update_colors(doshade=False, cmap=colormaps['jet'], atype='dubois')#
Update colors.
- Parameters:
doshade (bool, optional) – Option to choose sunshading. The default is False.
cmap (matplotlib.colors.LinearSegmentedColormap, optional) – Matplotlib colormap. The default is jet.
atype (str, optional) – Anaglyph type. The default is ‘dubois’.
- Return type:
None.
- update_atype(atype='dubois')#
Update anaglyph type.
- Parameters:
atype (str, optional) – Anaglyph type. The default is ‘dubois’.
- Return type:
None.
- class pygmi.raster.anaglyph.PlotAnaglyph(parent=None)#
Bases:
pygmi.misc.ContextModule
Anaglyph GUI Graph Window.
- Parameters:
parent (parent, optional) – Reference to the parent routine. The default is None.
- change_all()#
Update from all combos.
- Return type:
None.
- change_colors()#
Update colour bar.
- Return type:
None.
- change_atype()#
Update anaglyph type.
- Return type:
None.
- change_contours()#
Update contours.
- Return type:
None.
- change_image()#
Change Image, setting defaults.
- Return type:
None.
- run()#
Entry point into the routine, used to run context menu item.
- Return type:
None.
- 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 array) – input MxN data to be imaged.
azim (float, optional) – Sun azimuth. The default is -np.pi/4..
elev (float, optional) – Sun elevation. The default is np.pi/4..
alpha (float, optional) – how much incident light is reflected (0 to 1). The default is 1.
cell (float, optional) – between 1 and 100 - controls sunshade detail. The default is 100.
cmap (matplotlib.colors.LinearSegmentedColormap, optional) – Matplotlib colormap.
- Returns:
colormap – Output colour mapped array (MxNx4).
- Return type:
numpy array
- pygmi.raster.anaglyph.anaglyph(red, blue, atype='dubois')#
Colour Anaglyph.
- Parameters:
red (numpy array) – Dataset for red channel.
blue (numpy array) – Dataset for blue channel.
atype (str, optional) – Anaglyph type. The default is ‘dubois’.
- Returns:
rgb – Output dataset.
- Return type:
numpy array
- pygmi.raster.anaglyph.rot_and_clean(x, y, z, rotang=5, rtype='red')#
Rotate and clean rotated data for 2d view.
- Parameters:
x (numpy array) – X coordinates.
y (numpy array) – Y coordinates.
z (numpy array) – Z coordinates (or data values).
rotang (float, optional) – Rotation angle. The default is 5.
rtype (str, optional) – Rotation type. The default is ‘red’.
- Returns:
zmap – Output data.
- Return type:
numpy array