forked from uva-hydroinformatics/wetland_id
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pygeonet_plot.py
60 lines (55 loc) · 2.05 KB
/
pygeonet_plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import pygeonet_defaults as defaults
def raster_plot(Array, title):
if not hasattr(defaults, 'figureNumber'):
defaults.figureNumber = 0
defaults.figureNumber = defaults.figureNumber + 1
plt.figure(defaults.figureNumber)
plt.imshow(Array, cmap=cm.coolwarm)
plt.xlabel('X')
plt.ylabel('Y')
plt.title(title)
plt.colorbar()
if defaults.doPlot==1:
plt.show()
def raster_point_plot(Array, PointsList, title, color=cm.coolwarm, point_style='go'):
if not hasattr(defaults, 'figureNumber'):
defaults.figureNumber = 0
defaults.figureNumber = defaults.figureNumber + 1
plt.figure(defaults.figureNumber)
plt.imshow(Array, cmap=color)
plt.plot(PointsList[1],PointsList[0],point_style)
plt.xlabel('X')
plt.ylabel('Y')
plt.title(title)
plt.colorbar()
if defaults.doPlot==1:
plt.show()
def geodesic_contour_plot(geodesicDistanceArray, title):
if not hasattr(defaults, 'figureNumber'):
defaults.figureNumber = 0
defaults.figureNumber = defaults.figureNumber + 1
plt.figure(defaults.figureNumber)
plt.imshow(np.log10(geodesicDistanceArray),cmap=cm.coolwarm)
plt.contour(geodesicDistanceArray,140,cmap=cm.coolwarm)
plt.title(title)
plt.colorbar()
if defaults.doPlot==1:
plt.show()
def channel_plot(flowDirectionsArray,geodesicPathsCellList,
xx,yy,title,color=cm.coolwarm,
point_style='go',line_style='k-'):
if not hasattr(defaults, 'figureNumber'):
defaults.figureNumber = 0
defaults.figureNumber = defaults.figureNumber + 1
plt.figure(defaults.figureNumber)
plt.imshow(flowDirectionsArray,cmap=color)
for pp in range(0,len(geodesicPathsCellList)):
plt.plot(geodesicPathsCellList[pp][1,:],geodesicPathsCellList[pp][0,:],line_style)
plt.plot(xx,yy,point_style)
plt.title(title)
plt.colorbar()
if defaults.doPlot==1:
plt.show()