Browse Source

1.4.5 release, tweak of DOI measure

tags/1.6.1
Trevor Irons 5 years ago
parent
commit
f2301ec872
2 changed files with 22 additions and 8 deletions
  1. 21
    7
      akvo/tressel/invertTA.py
  2. 1
    1
      setup.py

+ 21
- 7
akvo/tressel/invertTA.py View File

@@ -132,18 +132,32 @@ def main():
132 132
         K0[0] = np.concatenate( (K0[0].T, K0[ik].T) ).T
133 133
     K0 = K0[0]
134 134
     #plt.matshow(K0)
135
+
136
+    ###################    
137
+    # VERY Simple DOI #
138
+    maxq = np.argmax(K0, axis=1)
139
+    maxK = .1 *  K0[ np.arange(0,len(ifaces)-1), maxq ] # 10% water is arbitrary  
135 140
     
136
-    # VERY Simple DOI
137
-    SNR = np.sum(.01*K0, axis=1) / VS[0][0]
138
-    SNR[SNR>1] = 1
139
-    SNRidx = 0 
140
-    while SNR[SNRidx] >= 1:
141
-        SNRidx += 1
142
-    #print(SNR)
141
+    SNR = maxK / (VS[0][0])
142
+    #SNR[SNR>1] = 1
143
+    SNRidx = len(ifaces)-2 
144
+    while SNR[SNRidx] < 1:
145
+        SNRidx -= 1
146
+
147
+    #print("IDX", SNRidx)
143 148
     #plt.plot(ifaces[0:-1], SNR)
149
+    #plt.plot(ifaces[0:-1][SNRidx], SNR[SNRidx], '.',markersize=12)
144 150
     #plt.gca().axhline(y=VS[0][0], xmin=0, xmax=ifaces[-1], color='r')
145 151
     #plt.gca().axhline(y=1, xmin=0, xmax=ifaces[-1], color='r')
152
+    #K0T = np.dot(K0, K0.T) 
153
+    #K0T = np.dot(K0, np.dot( VS[0][0]* np.eye(len(ifaces)-1,1), K0.T) )
154
+    #K0T = np.dot(K0, np.dot( 1/(VS[0][0]**2) * np.eye(np.shape(K0)[1]), K0.T) )
155
+    #plt.matshow(0.05 * np.sqrt(K0T))
156
+    #plt.colorbar()
157
+    #plt.plot(ifaces[0:-1], np.diag( 0.01* np.sqrt(K0T))) 
158
+    #print(np.shape(K0T), len(ifaces)-1)
146 159
     #plt.show()
160
+    #exit()
147 161
 
148 162
     ###############################################
149 163
     # Build full kernel

+ 1
- 1
setup.py View File

@@ -21,7 +21,7 @@ with open("README.md", "r") as fh:
21 21
     long_description = fh.read()
22 22
 
23 23
 setup(name='Akvo',
24
-      version='1.4.4',
24
+      version='1.4.5',
25 25
       python_requires='>3.7.0', # due to pyLemma
26 26
       description='Surface nuclear magnetic resonance workbench',
27 27
       long_description=long_description,

Loading…
Cancel
Save