Commit 01ff112f authored by Martinez-Carvajal German's avatar Martinez-Carvajal German
Browse files

The figure of the electrical conductivity

was enhanced as for article 2 (spatial representativity
of Xr-CT) we decided to analyze electrical conductivity
and not anymore the relative saturation content.
parent 020c7497
......@@ -151,7 +151,10 @@ def Figure_4(Frame, Filter_num): # 3D SURFACE OF IN-PHASE ALL POINTS
plt.close()
return (X,Y,P)
def Figure_5(Frame, P, Filter_num): # 3D SURFACE OF CONDUCTIVITY NO OUTLIERS
def Figure_5(Frame, P, Filter_num):
# 3D SURFACE OF CONDUCTIVITY NO OUTLIERS
# and map of conductivity
""" Creates 2 figures (3D-surface and Contours) for the mapping
of electric conductivity taking off outliers (see as well the function
Remove_Outliers """
......@@ -159,6 +162,7 @@ def Figure_5(Frame, P, Filter_num): # 3D SURFACE OF CONDUCTIVITY NO OUTLIERS
from matplotlib import cm # color maps
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
plt.close("all")
# Create an interpolated grid with "electric conductity" values
Selection = (Frame["Filtre_#"] == Filter_num)
Frame = Frame[Selection]
......@@ -177,7 +181,32 @@ def Figure_5(Frame, P, Filter_num): # 3D SURFACE OF CONDUCTIVITY NO OUTLIERS
if Filter_num == 1:
Outliers_Y0 = (Y <= 0.5)
C[Outliers_Y0] = np.nan
# Creating a graph to be sure it is working
if Filter_num == 2:
Outliers_anomalie = (Y <= 3) & (X >= 5)
C[Outliers_anomalie] = np.nan
Cond_ref = np.nanmean(C)
print("Cond_ref = ", Cond_ref)
# compting percentage of the surface that is 'homogeneous'
homogeneus_surface_1 = np.count_nonzero((C > Cond_ref-1) & (C < Cond_ref+1))
all_surface = np.count_nonzero(~np.isnan(C))
percentage = homogeneus_surface_1/all_surface
print(percentage)
homogeneus_surface_2 = np.count_nonzero((C > Cond_ref-2) & (C < Cond_ref+2))
all_surface = np.count_nonzero(~np.isnan(C))
percentage = homogeneus_surface_2/all_surface
print(percentage)
homogeneus_surface_3 = np.count_nonzero((C > Cond_ref-3) & (C < Cond_ref+3))
all_surface = np.count_nonzero(~np.isnan(C))
percentage = homogeneus_surface_3/all_surface
print(percentage)
# Creating a graph to be sure it is working
Fig = plt.figure()
Ax = Axes3D(Fig)
Ax.plot_surface(X, Y, C, rstride=1, cstride=1, cmap=cm.viridis)
......@@ -186,26 +215,64 @@ def Figure_5(Frame, P, Filter_num): # 3D SURFACE OF CONDUCTIVITY NO OUTLIERS
Ax.set_zlabel("Conductivuty (mS/m)")
Title = "Electric Conductivity surface without outliers of filter " + str(Filter_num)
Ax.set_title(Title)
Fig_Name = Title + '.png'
Fig_Name = Title + '.png'
chdir("/home/german.martinez-carvajal/Desktop/These/EM_Electromag_multifrequentiel/180329_Montromant_EM/Data_Treatment")
plt.savefig(Fig_Name, dpi = 300)
plt.close()
Fig1, Ax1 = plt.subplots()
N = 5 # number of contour zones
Levels = np.linspace(np.nanmin(C),np.nanmax(C) , N) # for the contour plot
Levels = np.round(Levels, decimals = 1)
CS1 = Ax1.contourf(X,Y,C, Levels, cmap=cm.viridis) # contour filled
CS2 = Ax1.contour (X,Y,C, Levels, colors='k')
l_min = np.round(np.nanmin(C), decimals = 0)
l_max = np.round(np.nanmax(C), decimals = 0)
Levels = np.arange(l_min, l_max + 1 , 1) # for the contour plot
Levels = np.round(Levels, decimals = 0)
CS1 = Ax1.contourf(X,Y,C, Levels, cmap=cm.jet) # contour filled
CS2 = Ax1.contour (X,Y,C, Levels, colors='k', linewidths = 0.3)
Ax1.set_xlabel("X (m)")
Ax1.set_ylabel("Y (m)")
plt.clabel(CS2, colors='k', fontsize=7)
plt.clabel(CS2, colors='k', fontsize=6, fmt = '%1.0f')
cbar= plt.colorbar(CS1) # color bar
cbar.ax.set_ylabel('Conductivity (mS/m)')
Title = "Electric Conductivity map without outliers of filter " + str(Filter_num)
Title = 54*" " + "$\overline{\sigma}\pm\Delta\sigma \Rightarrow $ 74%$_{Filter's surface}$\n"
Title = Title + "$\overline{\sigma} = 15 mS/m$, $\Delta\sigma = 1 mS/m$" + 10*" "+ "$\sigma\pm2\Delta\sigma \Rightarrow $ 95%$_{Filter's surface}$\n"
Title = Title + 52*" " + "$\overline{\sigma}\pm3\Delta\sigma \Rightarrow $ 98%$_{Filter's surface}$"
Ax1.set_title(Title)
Title = "Electric Conductivity map without outliers of filter " + str(Filter_num)
Fig_Name = Title + '.png'
plt.savefig(Fig_Name, dpi = 300)
Ax1.set_xlabel("X (m)")
Ax1.set_ylabel("Y (m)")
Ax1.set_xlim(0,8)
Ax1.set_ylim(0,8)
if Filter_num == 2:
# ading lables of the sampling points
#bbox_props = dict(boxstyle="circle", fc="w", ec="orange", alpha=0.8)
#Ax1.text(4, 2, "Samples\n1A, 1B", ha="center", va="center", size=8, bbox=bbox_props)
#Ax1.text(6, 4, "Samples\n2A, 2B", ha="center", va="center", size=8, bbox=bbox_props)
#Ax1.text(4, 7, "Samples\n3A, 3B", ha="center", va="center", size=8, bbox=bbox_props)
bbox_props = dict(boxstyle="round", fc="w", ec='w')
Ax1.text(0.5, 4, "Border artefact exclusion", ha="center", va="center", size=10, bbox=bbox_props, rotation=90)
Ax1.text(7.5, 4, "Border artefact exclusion", ha="center", va="center", size=10, bbox=bbox_props, rotation=270)
Ax1.text(6.5, 1.0, "Influence zone of \nmetallic water collector ", ha="center", va="center", size=8, bbox=bbox_props, rotation=0)
bbox_props = dict(boxstyle="circle", fc="black", alpha = 1, ec="black")
Ax1.text(2, 2.0, "FP", ha="center", va="center", size=8, bbox=bbox_props, zorder = 1, alpha = 1.0, color = 'w', weight = "bold")
Ax1.text(2, 6.5, "FP", ha="center", va="center", size=8, bbox=bbox_props, zorder = 1, alpha = 1.0, color = 'w', weight = "bold")
Ax1.text(6, 6.5, "FP", ha="center", va="center", size=8, bbox=bbox_props, zorder = 1, alpha = 1.0, color = 'w', weight = "bold")
Ax1.text(6, 2.0, "FP", ha="center", va="center", size=8, bbox=bbox_props, zorder = 1, alpha = 1.0, color = 'w', weight = "bold")
if Filter_num == 2:
# ading lables of the sampling points
bbox_props = dict(boxstyle="circle", fc="w", ec="orange", alpha=0.9)
Ax1.text(4, 2, "Samples\n1A, 1B", ha="center", va="center", size=8, bbox=bbox_props)
Ax1.text(6, 4, "Samples\n2A, 2B", ha="center", va="center", size=8, bbox=bbox_props)
Ax1.text(4, 7, "Samples\n3A, 3B", ha="center", va="center", size=8, bbox=bbox_props)
chdir("/home/german.martinez-carvajal/Desktop/These/EM_Electromag_multifrequentiel/180329_Montromant_EM/Data_Treatment")
Fig1.set_size_inches(20/2.54, 16/2.54)
Fig1.savefig(Fig_Name, dpi = 300)
plt.close()
return (X,Y,C)
def Figure_6(X,Y,C, Filter_num):
......@@ -218,6 +285,7 @@ def Figure_6(X,Y,C, Filter_num):
import numpy as np
Cond_ref = np.nanmean(C)
print("Cond_ref = ", Cond_ref)
d = 2 # saturation inndex for consolidated rocks
global HVR # Humidity variation
HVR = (C/Cond_ref)**(1/d)
......@@ -233,7 +301,7 @@ def Figure_6(X,Y,C, Filter_num):
CS1 = Ax1.contourf(X,Y,HVR, Levels, cmap=cm.viridis, extend = 'both') # contour filled
if N <= 10:
CS2 = Ax1.contour (X,Y,HVR, Levels, colors='k')
plt.clabel(CS2, colors='k', fontsize=7)
plt.clabel(CS2, colors='k', fontsize=7, fmt = '%1.1f')
cbar= plt.colorbar(CS1) # color bar
if N >= 10:
......@@ -329,17 +397,17 @@ def create_2D_arrays(X,Y,Z, interpolation):
## Figure 4 - Surface plots of in-phase (phase of the EM map) (all points)
#X1,Y1,P1 = Figure_4(Frame_EM_DH, Filter_num = 1) # P means inPhase
#X2,Y2,P2 = Figure_4(Frame_EM_DH, Filter_num = 2)
#
## Figure 5 - Surface plots of electric conductivity without outliers
##X1,Y1,C1 = Figure_5(Frame_EM_DH_Good , P1, Filter_num = 1 ) # C means conductivity
#X2,Y2,C2 = Figure_5(Frame_EM_DH_Good , P2, Filter_num = 2 )
## Figure - Mapping humidity variation
# Figure 5 - Surface plots of electric conductivity without outliers
#X1,Y1,C1 = Figure_5(Frame_EM_DH_Good , P1, Filter_num = 1 ) # C means conductivity
X2,Y2,C2 = Figure_5(Frame_EM_DH_Good , P2, Filter_num = 2 )
# Figure - Mapping humidity variation
File_Path = '/home/german.martinez-carvajal/Desktop/These/EM_Electromag_multifrequentiel/180329_Montromant_EM/Data_Treatment'
chdir (File_Path)
#Figure_6(X1,Y1,C1,Filter_num = 1)
Figure_6(X2,Y2,C2,Filter_num = 2)
##plt.close('all')
#plt.close('all')
print('finished')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment