Преглед на файлове

Final tweaks before pushing to Pypi

tags/1.6.1
Trevor Irons преди 3 години
родител
ревизия
1fa08aee43
променени са 1 файла, в които са добавени 25 реда и са изтрити 11 реда
  1. 25
    11
      akvo/tressel/invertTA.py

+ 25
- 11
akvo/tressel/invertTA.py Целия файл

@@ -234,13 +234,13 @@ def main():
234 234
         mmax = np.max(np.abs(VV))
235 235
         mmin = np.min(VV)
236 236
 
237
-        obs = ax1.pcolor(TT, QQQ, VV, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax)
237
+        obs = ax1.pcolor(TT, QQQ, VV, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax, shading='nearest')  # pcolor edge not defined 
238 238
         ax1.set_title("observed")
239 239
  
240 240
         pre = np.dot(KQT[ich*ntq:(ich+1)*ntq,:], inv)
241 241
  
242 242
         PRE = np.reshape( pre, np.shape(VV)  )
243
-        prem = ax2.pcolor(TT, QQQ, PRE, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax )
243
+        prem = ax2.pcolor(TT, QQQ, PRE, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax,shading='nearest' )
244 244
         ax2.set_title("predicted")
245 245
 
246 246
         cbar = plt.colorbar(prem, axc1)
@@ -250,7 +250,7 @@ def main():
250 250
 
251 251
         DIFF = (PRE-VV) / VVS
252 252
         md = np.max(np.abs(DIFF))
253
-        dim = ax3.pcolor(TT, QQQ, DIFF, cmap=cmocean.cm.balance, vmin=-md, vmax=md)
253
+        dim = ax3.pcolor(TT, QQQ, DIFF, cmap=cmocean.cm.balance, vmin=-md, vmax=md, shading='nearest')
254 254
         ax3.set_title("misfit / $\widehat{\sigma}$")
255 255
     
256 256
         cbar2 = plt.colorbar(dim, axc2)
@@ -357,14 +357,14 @@ def main():
357 357
             mmax = np.max(np.abs(VV))
358 358
             mmin = np.min(VV)
359 359
 
360
-            obs = ax1.pcolor(TT, QQQ, VV, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax)
360
+            obs = ax1.pcolor(TT, QQQ, VV, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax, shading='nearest')
361 361
             ax1.set_title("observed")
362 362
 
363 363
             ## Here neds to change  
364 364
             pre = np.abs(np.dot(KQTc[ich*ntq:(ich+1)*ntq,:], inv))
365 365
  
366 366
             PRE = np.reshape( pre, np.shape(VV)  )
367
-            prem = ax2.pcolor(TT, QQQ, PRE, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax )
367
+            prem = ax2.pcolor(TT, QQQ, PRE, cmap=cmocean.cm.curl_r, vmin=-mmax, vmax=mmax, shading='nearest' )
368 368
             ax2.set_title("predicted")
369 369
 
370 370
             cbar = plt.colorbar(prem, axc1)
@@ -374,7 +374,7 @@ def main():
374 374
 
375 375
             DIFF = (PRE-VV) / VVS
376 376
             md = np.max(np.abs(DIFF))
377
-            dim = ax3.pcolor(TT, QQQ, DIFF, cmap=cmocean.cm.balance, vmin=-md, vmax=md)
377
+            dim = ax3.pcolor(TT, QQQ, DIFF, cmap=cmocean.cm.balance, vmin=-md, vmax=md, shading='nearest')
378 378
             ax3.set_title("misfit / $\widehat{\sigma}$")
379 379
     
380 380
             cbar2 = plt.colorbar(dim, axc2)
@@ -487,7 +487,7 @@ def main():
487 487
     ax1 = fig.add_axes( [.2,.15,.6,.7] )
488 488
     im = ax1.pcolor(X, Y, INV.T, cmap=cmocean.cm.tempo) #cmap='viridis')
489 489
     im.set_edgecolor('face')
490
-    ax1.set_xlim( T2Bins[0], T2Bins2[-1] )
490
+    ax1.set_xlim( T2Bins[0], T2Bins[-1] )
491 491
     ax1.set_ylim( ifaces[-1], ifaces[0] )
492 492
     cb = plt.colorbar(im, label = u"PWC (m$^3$/m$^3$)") #, format='%1.1f')
493 493
     cb.locator = MaxNLocator( nbins = 4)
@@ -540,7 +540,14 @@ def main():
540 540
     #ax.axhline( y=ifaces[SNRidx], xmin=0, xmax=1, color='black', linestyle='dashed'  )
541 541
     if CalcDOI:
542 542
         ax.axhline( y=DOI, xmin=0, xmax=1, color='black', linestyle='dashed'  )
543
-    
543
+
544
+    # Hide the right and top spines
545
+    ax.spines['right'].set_visible(False)
546
+    ax.spines['top'].set_visible(False)
547
+    # Only show ticks on the left and bottom spines
548
+    ax.yaxis.set_ticks_position('left')
549
+    ax.xaxis.set_ticks_position('bottom')   
550
+ 
544 551
     plt.savefig("akvoInversionWC.pdf")
545 552
     plt.legend()  
546 553
     
@@ -559,7 +566,7 @@ def main():
559 566
     ##############  NONLINEAR RESULT   ##########################
560 567
 
561 568
     if nonLinearRefinement: 
562
-        Y,X = meshgrid( ifaces, T2Bins )
569
+        Y,X = meshgrid( ifaces, T2Bins2 )
563 570
         fig = plt.figure( figsize=(pc2in(20.0),pc2in(22.)) )
564 571
         ax1 = fig.add_axes( [.2,.15,.6,.7] )
565 572
         im = ax1.pcolor(X, Y, INVc.T, cmap=cmocean.cm.tempo) #cmap='viridis')
@@ -595,7 +602,7 @@ def main():
595 602
         if CalcDOI:
596 603
             ax2.axhline( y=DOI, xmin=0, xmax=1, color='black', linestyle='dashed'  )
597 604
         #ax2.xaxis.set_label_position('bottom') 
598
-        fig.suptitle("Non linear inversion")
605
+        #fig.suptitle("Non linear inversion")
599 606
         plt.savefig("akvoInversionNL.pdf")
600 607
 
601 608
 
@@ -627,7 +634,14 @@ def main():
627 634
         if CalcDOI:
628 635
             ax.axhline( y=DOI, xmin=0, xmax=1, color='black', linestyle='dashed'  )
629 636
     
630
-        plt.savefig("akvoInversionWC.pdf")
637
+        # Hide the right and top spines
638
+        ax.spines['right'].set_visible(False)
639
+        ax.spines['top'].set_visible(False)
640
+        # Only show ticks on the left and bottom spines
641
+        ax.yaxis.set_ticks_position('left')
642
+        ax.xaxis.set_ticks_position('bottom')   
643
+    
644
+        plt.savefig("akvoNLInversionWC.pdf")
631 645
         plt.legend()  
632 646
 
633 647
 

Loading…
Отказ
Запис