-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconcavity_tectonics.py
60 lines (40 loc) · 2.22 KB
/
concavity_tectonics.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
#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']
fig = plt.figure(1, figsize=(12,8))
ax = fig.add_subplot(111)
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['second_inv'].tolist()
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
#ax.hist2d(x_Series,y_Series,bins=(100,18),range=((0,2),(0,1)))
#plt.colorbar()
h = ax.hist2d(x_list,y_list,bins=(100,[0.075,0.125,0.175,0.225,0.275,0.325,0.375,0.425,0.475,0.525,0.575,0.625,0.675,0.725,0.775,0.825,0.875,0.925,0.975]),range=((0,200),(0.025,1)))
plt.yticks(y_ticks)
#plt.xticks([1,2,3,4],['Sub Himalaya','Lesser Himalaya','Greater Himalaya','Tethyan Himalaya'])
plt.ylabel("Concavity")
plt.xlabel("Strain")
plt.colorbar(h[3], ax=ax)
#ax.scatter(x_list,y_list,marker='.')
fig.savefig('../concavity-strain.png', bbox_inches='tight')