-
Notifications
You must be signed in to change notification settings - Fork 0
/
ksn_full_fig.py
114 lines (82 loc) · 3.86 KB
/
ksn_full_fig.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#hist2d of concavity/distance from mountian front.
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt
import pandas as pd
import sys
target = '/exports/csce/datastore/geos/users/s1134744/LSDTopoTools/Topographic_projects/full_himalaya_5000/'
source_list = ['0_1_ex_MChiSegmented_burned.csv','0_15_ex_MChiSegmented_burned.csv','0_2_ex_MChiSegmented_burned.csv',
'0_25_ex_MChiSegmented_burned.csv','0_3_ex_MChiSegmented_burned.csv','0_35_ex_MChiSegmented_burned.csv',
'0_4_ex_MChiSegmented_burned.csv','0_45_ex_MChiSegmented_burned.csv','0_5_ex_MChiSegmented_burned.csv',
'0_55_ex_MChiSegmented_burned.csv','0_6_ex_MChiSegmented_burned.csv','0_65_ex_MChiSegmented_burned.csv',
'0_7_ex_MChiSegmented_burned.csv','0_75_ex_MChiSegmented_burned.csv','0_8_ex_MChiSegmented_burned.csv',
'0_85_ex_MChiSegmented_burned.csv','0_9_ex_MChiSegmented_burned.csv','0_95_ex_MChiSegmented_burned.csv']
source_list = ['0_5_ex_MChiSegmented_burned.csv']
fig = plt.figure(1, figsize=(18,20))
def getAxis(column):
x_list = []
y_list = []
y_ticks = []
for source in source_list:
with open(target+source,'r') as csvfile:
df = pd.read_csv(csvfile,delimiter=',')
x_Series = df[column].tolist()
y_Series = df['m_chi'].tolist()
print y_Series
#key = source.replace('_ex_MChiSegmented_burned.csv','')
#key = key.replace('_','.')
#key = float(key)
#y_ticks.append(key)
#length = len(x_Series)
#y_Series = [key]*length
#x_list = x_list + x_Series
#y_list = y_list + y_Series
return x_Series,y_Series#,y_ticks
ax = fig.add_subplot(321)
x_list,y_list = getAxis('distance')
h = ax.hist2d(x_list,y_list,bins=(100,100),range=((0,2),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Distance from Mountain Front (decimal degrees)")
ax = fig.add_subplot(322)
x_list,y_list = getAxis('segmented_elevation')
h = ax.hist2d(x_list,y_list,bins=(100,100),range=((350,5000),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Elevation (m)")
ax = fig.add_subplot(323)
x_list,y_list = getAxis('secondary_burned_data')
h = ax.hist2d(x_list,y_list,bins=(100,100),range=((0,6000),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Precipitation (mm/year)")
ax = fig.add_subplot(324)
x_list,y_list = getAxis('second_inv')
h = ax.hist2d(x_list,y_list,bins=(100,100),range=((0,200),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Strain")
ax = fig.add_subplot(325)
x_list,y_list = getAxis('burned_data')
h = ax.hist2d(x_list,y_list,bins=(16,100),range=((0,170000),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Lithology")
ax = fig.add_subplot(326)
x_list,y_list = getAxis('tectonics')
h = ax.hist2d(x_list,y_list,bins=([0.5,1.5,2.5,3.5,4.5],100),range=((0,5),(0,800)))
#plt.yticks(y_ticks)
plt.colorbar(h[3], ax=ax)
plt.ylabel("Ksn")
plt.xlabel("Tectonic Zone")
plt.xticks([1,2,3,4],['Sub Himalaya','Lesser Himalaya','Greater Himalaya','Tethyan Himalaya'])
#plt.ylabel("Concavity")
#plt.xlabel("Elevation (m)")
#plt.colorbar(h[3], ax=ax)
#ax.scatter(x_list,y_list,marker='.')
fig.savefig('../ksn_0.5.png', bbox_inches='tight')