scientimate.plot3dhillshades#
scientimate.plot3dhillshades(x, y, z, plottype)
Description#
Plot hillshades (shaded relief) of x (longitude), y (latitude) and z (elevation) data
Inputs#
- x
- x (longitude) data extracted from xyz fileSet x=[] if it is not availableIt may be 1d or 2d array
- y
- y (latitude) data extracted from xyz fileSet y=[] if it is not availableIt may be 1d or 2d array
- z
z (elevation) data extracted from xyz file
- plottype=’imagesc’
- Plot type‘imagesc’: 2 dimensional plot using imagesc or imshow‘pcolor’: 2 dimensional plot using pcolor‘contour’: 2 dimensional contour plot, number of contour=ncolor‘surface’: 3 dimensional surface plot
Outputs#
Examples#
import scientimate as sm
import numpy as np
x,y=np.meshgrid(np.linspace(-10,10,50),np.linspace(-10,10,50))
r=np.sqrt(x**2+y**2)+1e-10 #Add 1e-10 to prevent divide by 0
z=np.sin(r)/r
sm.plot3dhillshades(x,y,z,'imagesc')
x,y=np.meshgrid(np.linspace(-10,10,21),np.linspace(-10,10,21))
z=(np.sin(x)+np.sin(y))/(x+y+1e-10) #Add 1e-10 to prevent divide by 0
sm.plot3dhillshades(x,y,z,'imagesc')
x=10*np.random.rand(1000)
y=10*np.random.rand(1000)
z=x**2+y**2
sm.plot3dhillshades(x,y,z,'imagesc')
References#
https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/how-hillshade-works.htm
https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/applying-a-z-factor.htm
http://geospatialpython.com/2013/12/python-and-elevation-data-creating.html
ThomasLecocq/geophysique.be-25#20Shaded#20Relief#20Map#20in#20Python.ipynb
https://www.geophysique.be/2014/02/25/shaded-relief-map-in-python/
https://www.mathworks.com/matlabcentral/fileexchange/14863-hillshade