-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03_resistivity_rate
143 lines (110 loc) · 4.96 KB
/
03_resistivity_rate
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 2 15:34:53 2021
@author: lwang19
"""
import numpy as np
import os
import pygimli as pg
import pygimli.meshtools as mt
from pygimli.viewer import showMesh
from pygimli.meshtools import appendTriangleBoundary
import pandas as pd
import matplotlib.cm as cm
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.interpolate import griddata
model = np.loadtxt('./B_Invertresesults/invert_model.vector') #+ '.vector'
paramesh = pg.Mesh('./B_Invertresesults/invert_mesh')
convert_par = pd.Series({'dx':0.5})
Z = 20
X = 144
K_value = 0
x_par = paramesh.cellCenters().array()[:, 0]
z_par = paramesh.cellCenters().array()[:, 1]
x_par = x_par.reshape(Z,X)
z_par = z_par.reshape(Z,X)
Rhoa_grid_frame = pd.DataFrame(model.reshape(x_par.shape),index=z_par[:,0],columns=x_par[0,:])
WL_random = pd.DataFrame(np.zeros((Z,X)),index=z_par[:,0],columns=x_par[0,:])
Rhoa_random = pd.DataFrame(np.zeros((Z,X)),index=z_par[:,0],columns=x_par[0,:])
WaterRise = pd.DataFrame(np.zeros((Z,X)),index=z_par[:,0],columns=x_par[0,:])
for ii in np.arange(0,X): ## [0, 1, , , 14, , , 28)
WL_random.iloc[:,ii] = z_par[:,ii]
for jj in np.arange(0,Z):
Rhoa_random.iloc[jj,ii] = Rhoa_grid_frame.iloc[jj,ii]
WaterRise.iloc[jj,ii] = WL_random.iloc[jj,ii] - 0
K = np.zeros((X,Z-1))
Z_interface = np.zeros(X)
hc = pd.DataFrame(np.zeros((Z,X)),index=z_par[:,0],columns=x_par[0,:])
ho = pd.DataFrame(np.zeros((Z,X)),index=z_par[:,0],columns=x_par[0,:])
for ii in np.arange(X):
K[ii,:]= (Rhoa_random.iloc[1:,ii].values - Rhoa_random.iloc[:-1,ii].values) / (WaterRise.iloc[1:,ii].values -WaterRise.iloc[:-1,ii].values)
if max(K[ii,:])>K_value:
Z_interface[ii] = z_par[1:,ii][K[ii,:]>K_value][0]
hc.iloc[:,ii] = WL_random.iloc[:,ii] - z_par[1:,ii][K[ii,:]>K_value][0]
ho.iloc[:,ii] = WL_random.iloc[:,ii] - 0
#%%
fig5 = plt.figure(figsize=(8,6))
ax5 = fig5.add_subplot(111)
# for ii in np.linspace(1,len(WaterRise[:,1]),10):
# ax4.plot(WaterRise[int(ii)-1,:], Rhoa_random[int(ii)-1,:])
for ii in np.arange(0,X):
ax5.plot(Rhoa_random.iloc[:,ii],hc.iloc[:,ii])
ax5.grid()
ax5.set_xlabel('Resistivity (ohm∙m)')
ax5.set_ylabel('Height above water leavel (m)')
ax5.set_title('Resistivity vs. Height above water leavel')
# plt.savefig('./22_Archie/' + ' lambda_txt' + fn + 'Resistivity vs water head.png', dpi=600)
plt.show()
fig6 = plt.figure(figsize=(8,6))
ax6 = fig6.add_subplot(111)
# for ii in np.linspace(1,len(WaterRise[:,1]),10):
# ax4.plot(WaterRise[int(ii)-1,:], Rhoa_random[int(ii)-1,:])
for ii in np.arange(0,X):
ax6.plot(Rhoa_random.iloc[:,ii],ho.iloc[:,ii])
# ax6.plot(Rhoa_random.iloc[:,46],ho.iloc[:,46])
ax6.grid()
ax6.set_xlabel('Resistivity (ohm∙m)')
ax6.set_ylabel('Height above NAP (m)')
# ax6.set_title('Resistivity vs. Height above NAP' +' ' + fn)
# plt.savefig('./22_Archie/' + ' lambda_txt' + fn + 'Resistivity vs NAP.png', dpi=600)
plt.show()
# Figure K map
fig1 = plt.figure(figsize=(10,4))
ax = fig1.add_subplot(111)
cmap2 = cm.get_cmap("jet").copy()
cmap2.set_under('k')
# cmap.set_over('b')
# remove negative values under water table
# for ii in range(X):
# for jj in range(Z-1):
# if K[ii,jj]<0.5 and K[ii,jj]>-0.5:
# K[ii,jj] = -6
RhoaPlot2 = ax.pcolormesh(x_par[1:,:], z_par[1:,], K.transpose()
,cmap=cmap2, shading='auto',
vmin=0, vmax=5)
cbar = plt.colorbar(RhoaPlot2,orientation='horizontal',spacing='proportional',extend='both',extendfrac='auto',extendrect='True',
format='%1i')
# cbar.set_ticks(np.logspace(0,2,num=5))
# cbar.set_ticklabels([1.0,3.16,10.0,31.62,100.0])
cbar.set_label('resistivity rate [ohm]')
# con1 = plt.contour(x_par[1:,:], z_par[1:,:], K.transpose(), MM, linewidths=0.75, colors = 'k')
# ax.clabel(con1, inline=True, fontsize=10)
plt.plot(x_par[0,:],Z_interface,'r',label='interface')
# wells water table
# plt.scatter(X_ERTwells, WL_ERTwells, s=100, color = 'gold', edgecolors = 'black', alpha = 0.8, zorder=8,label = 'water level')
# plt.vlines(x=X_ERTwells, ymin=np.array(bottom_ERTwells)+2, ymax=np.ones(len(bottom_ERTwells) )*z_par.max(), colors='green', ls='-', lw=5, label='wells')
# plt.vlines(x=X_ERTwells, ymin=np.array(bottom_ERTwells), ymax=np.array(bottom_ERTwells) + 2, colors='red', ls='-', lw=5, label='filter')
## infiltration lines, ## bottom linear lines
# plt.scatter(X_inf, Z_inf, s=100, color = 'white', edgecolors = 'black', alpha = 0.8, zorder=9,label='infiltration point')
# for ii in range(len(X_bottom)):
# plt.scatter(X_bottom[ii], Z_bottom[ii], s=10, color = 'white', alpha = 0.8, zorder=10)
# plt.plot(X_bottom, Z_bottom, color = 'white', alpha = 0.8, zorder=10)
ax.set_xlabel('Distance (m)')
ax.set_ylabel('Height above NAP (m)')
ax.set_title('Resistivity rate[ohm]_' )
plt.legend(loc='lower left')
# plt.savefig('./22_Archie/lambda_txt'+ 'K.png', dpi=600)
plt.show()