|
@@ -2,6 +2,11 @@ import numpy as np
|
2
|
2
|
import matplotlib.pyplot as plt
|
3
|
3
|
import sys
|
4
|
4
|
from pylab import meshgrid
|
|
5
|
+from matplotlib.colors import LightSource
|
|
6
|
+from matplotlib.ticker import ScalarFormatter
|
|
7
|
+from matplotlib.ticker import MaxNLocator
|
|
8
|
+from matplotlib.ticker import AutoMinorLocator
|
|
9
|
+from matplotlib.ticker import LogLocator
|
5
|
10
|
|
6
|
11
|
kf = open(sys.argv[1])
|
7
|
12
|
ifaces = np.array( kf.readline().split(), dtype=np.float )
|
|
@@ -9,41 +14,39 @@ q = np.array( kf.readline().split(), dtype=np.float )
|
9
|
14
|
q = np.append( q, (q[-1]+q[-2]) ) # for pcolor mesh
|
10
|
15
|
Y,X = meshgrid( ifaces, q )
|
11
|
16
|
|
12
|
|
-K = np.loadtxt(sys.argv[1], comments="#", skiprows=2)
|
|
17
|
+K = 1e9*np.loadtxt(sys.argv[1], comments="#", skiprows=2)
|
13
|
18
|
nx, ny = np.shape(K)
|
14
|
19
|
|
15
|
20
|
fig = plt.figure( )
|
16
|
|
-ax1 = fig.add_axes( [.10,.10,.35,.80] )
|
17
|
|
-ax2 = fig.add_axes( [.5,.10,.35,.80], sharex=ax1, sharey=ax1 )
|
18
|
|
-axcb = fig.add_axes( [.9,.10,.05,.80] )
|
|
21
|
+ax1 = fig.add_axes( [.100,.125,.335,.775] )
|
|
22
|
+ax2 = fig.add_axes( [.465,.125,.335,.775] , sharex=ax1, sharey=ax1 )
|
|
23
|
+axcb = fig.add_axes( [.835,.125,.040,.775] )
|
|
24
|
+
|
|
25
|
+ccmap = "seismic" # RdBu
|
19
|
26
|
|
20
|
27
|
# Real plot
|
21
|
|
-ax1.pcolormesh(X, Y, K[0:nx//2].T , cmap="RdBu", vmin=-np.max(np.abs(K)), vmax=np.max(np.abs(K)) )
|
|
28
|
+ax1.pcolormesh(X, Y, K[0:nx//2].T, cmap=ccmap, vmin=-np.max(np.abs(K)), vmax=np.max(np.abs(K)))
|
22
|
29
|
ax1.set_ylim( ifaces[-1], ifaces[0] )
|
23
|
30
|
ax1.set_xlim( q[-1], q[0] )
|
24
|
31
|
ax1.set_xscale("log", nonposx='clip')
|
25
|
|
-#plt.colorbar()
|
|
32
|
+ax1.minorticks_off()
|
|
33
|
+ax1.set_title(r"$\mathrm{Re} \left( \mathcal{K}_N^{1D} \right)$")
|
|
34
|
+
|
|
35
|
+ax1.xaxis.set_major_locator(LogLocator(base = 2.0))
|
|
36
|
+ax1.get_xaxis().set_major_formatter(ScalarFormatter())
|
26
|
37
|
|
27
|
38
|
# imaginary
|
28
|
|
-im = ax2.pcolormesh(X, Y, K[nx//2:].T , cmap="RdBu", vmin=-np.max(np.abs(K)), vmax=np.max(np.abs(K)) )
|
|
39
|
+im = ax2.pcolormesh(X, Y, K[nx//2:].T, cmap=ccmap, vmin=-np.max(np.abs(K)), vmax=np.max(np.abs(K)))
|
29
|
40
|
plt.setp(ax2.get_yticklabels(), visible=False)
|
30
|
|
-plt.colorbar(im, axcb)
|
|
41
|
+cb = plt.colorbar(im, axcb)
|
|
42
|
+cb.set_label(r"$\overline{V}^{\left(0\right)}_N$ (nV)")
|
31
|
43
|
|
32
|
44
|
ax1.set_ylabel("Depth (m)")
|
33
|
|
-ax1.set_xlabel("Pulse moment (A$\cdot$s)")
|
34
|
|
-ax2.set_xlabel("Pulse moment (A$\cdot$s)")
|
35
|
|
-
|
36
|
|
-plt.show()
|
37
|
|
-exit()
|
38
|
|
-
|
|
45
|
+ax1.set_xlabel(r"Pulse moment (A$\cdot$s)")
|
|
46
|
+ax2.set_xlabel(r"Pulse moment (A$\cdot$s)")
|
|
47
|
+ax2.set_title(r"$\mathrm{Im} \left( \mathcal{K}_N^{1D} \right)$")
|
39
|
48
|
|
40
|
|
-plt.matshow(K[0:nx//2])
|
41
|
|
-plt.colorbar()
|
|
49
|
+plt.suptitle("exp 0")
|
42
|
50
|
|
43
|
|
-plt.matshow(K[nx//2:])
|
44
|
|
-plt.colorbar()
|
45
|
|
-
|
46
|
|
-KA = np.abs(K[0:nx//2] + 1j*K[nx//2:])
|
47
|
|
-plt.matshow(1e9*KA, cmap='viridis')
|
48
|
|
-plt.colorbar()
|
49
|
51
|
plt.show()
|
|
52
|
+exit()
|