Browse Source

Tweaks for plots in FastTIMES

tags/1.6.1
Trevor Irons 4 years ago
parent
commit
ad0ffb74d4

+ 15
- 14
akvo/gui/akvoGUI.py View File

874
         #INFO["samp"] = self.RAWDataProc.samp
874
         #INFO["samp"] = self.RAWDataProc.samp
875
         INFO["nPulseMoments"] = self.RAWDataProc.nPulseMoments
875
         INFO["nPulseMoments"] = self.RAWDataProc.nPulseMoments
876
         #INFO["deadTime"] = self.RAWDataProc.deadTime
876
         #INFO["deadTime"] = self.RAWDataProc.deadTime
877
-        INFO["processed"] = "Akvo v"  + self.Akvo_VERSION + ", on "  + time.strftime("%d/%m/%Y")
877
+        INFO["processed"] = "Akvo v"  + VERSION + ", on "  + time.strftime("%d/%m/%Y")
878
         # Pulse current info
878
         # Pulse current info
879
         ip = 0
879
         ip = 0
880
         INFO["Pulses"] = {}
880
         INFO["Pulses"] = {}
1425
         self.lock("harmonic noise modelling")
1425
         self.lock("harmonic noise modelling")
1426
         
1426
         
1427
         Harm = OrderedDict()
1427
         Harm = OrderedDict()
1428
-        Harm["STEP"] = "Harmonic modelling"
1428
+        Harm["STEP " + str(len(self.YamlNode.Processing))] = "Harmonic modelling"
1429
         Harm["NF"] = str( self.ui.NHarmonicsFreqsSpin.value() ) 
1429
         Harm["NF"] = str( self.ui.NHarmonicsFreqsSpin.value() ) 
1430
         Harm["Segments"] = str( self.ui.NSegments.value() ) 
1430
         Harm["Segments"] = str( self.ui.NSegments.value() ) 
1431
         Harm["Proc. ref."] = self.ui.harmRef.isChecked() 
1431
         Harm["Proc. ref."] = self.ui.harmRef.isChecked() 
1502
         
1502
         
1503
         # Log processing 
1503
         # Log processing 
1504
         Adapt = OrderedDict()
1504
         Adapt = OrderedDict()
1505
-        Adapt["STEP"] = "TD noise cancellation"
1506
-        print(Adapt) # this locks STEP in as first...
1507
-        Adapt["n_Taps"] = str(self.ui.MTapsSpinBox.value())
1508
-        Adapt["lambda"] = str(self.ui.adaptLambdaSpinBox.value())
1509
-        Adapt["truncate"] = str(self.ui.adaptTruncateSpinBox.value())
1510
-        Adapt["mu"] = str(self.ui.adaptMuSpinBox.value()) 
1511
-        Adapt["PCA"] = str(self.ui.PCAComboBox.currentText())
1512
-        #print(Adapt)
1505
+        Adapt["STEP " + str(len(self.YamlNode.Processing)) ] = "TD noise cancellation"
1506
+        #print(Adapt) # this locks STEP in as first...
1507
+        Adapt["n_Taps"] = self.ui.MTapsSpinBox.value()
1508
+        Adapt["lambda"] = self.ui.adaptLambdaSpinBox.value()
1509
+        Adapt["truncate"] = self.ui.adaptTruncateSpinBox.value()
1510
+        Adapt["mu"] = self.ui.adaptMuSpinBox.value()
1511
+        Adapt["PCA"] = self.ui.PCAComboBox.currentText()
1512
+        #Adapt # this locsk in the dict ordering...
1513
+        #print(Adapt) # this locks in the dict...
1513
         self.YamlNode.Processing.append(Adapt)
1514
         self.YamlNode.Processing.append(Adapt)
1514
         self.Log( )
1515
         self.Log( )
1515
 
1516
 
1526
         self.lock("Summing data channels")
1527
         self.lock("Summing data channels")
1527
         
1528
         
1528
         Sum = OrderedDict()
1529
         Sum = OrderedDict()
1529
-        Sum["STEP"] = "Channel sum"
1530
+        Sum["STEP " + str(len(self.YamlNode.Processing))] = "Channel sum"
1530
         self.YamlNode.Processing.append(Sum)
1531
         self.YamlNode.Processing.append(Sum)
1531
         self.Log( )
1532
         self.Log( )
1532
 
1533
 
1606
         
1607
         
1607
         # Log processing 
1608
         # Log processing 
1608
         Band = OrderedDict()
1609
         Band = OrderedDict()
1609
-        Band["STEP"] = "Bandpass filter"
1610
+        Band["STEP " + str(len(self.YamlNode.Processing))] = "Bandpass filter"
1610
         Band["central_nu"] = str(self.ui.CentralVSpinBox.value())
1611
         Band["central_nu"] = str(self.ui.CentralVSpinBox.value())
1611
         Band["passband"] = str(self.ui.passBandSpinBox.value())
1612
         Band["passband"] = str(self.ui.passBandSpinBox.value())
1612
         Band["stopband"] = str(self.ui.stopBandSpinBox.value()) 
1613
         Band["stopband"] = str(self.ui.stopBandSpinBox.value()) 
1627
 
1628
 
1628
         # Log processing 
1629
         # Log processing 
1629
         Resample = OrderedDict() 
1630
         Resample = OrderedDict() 
1630
-        Resample["STEP"] = "Resample"
1631
+        Resample["STEP "+ str(len(self.YamlNode.Processing))] = "Resample"
1631
         Resample["downsample factor"] = str(self.ui.downSampleSpinBox.value())
1632
         Resample["downsample factor"] = str(self.ui.downSampleSpinBox.value())
1632
         Resample["truncate length"] = str(self.ui.truncateSpinBox.value()) 
1633
         Resample["truncate length"] = str(self.ui.truncateSpinBox.value()) 
1633
         self.YamlNode.Processing.append(Resample)
1634
         self.YamlNode.Processing.append(Resample)
1725
         
1726
         
1726
         # Log processing 
1727
         # Log processing 
1727
         Window = OrderedDict()
1728
         Window = OrderedDict()
1728
-        Window["STEP"] = "Window filter"
1729
+        Window["STEP " + str(len(self.YamlNode.Processing))] = "Window filter"
1729
         Window["type"] = str(self.ui.windowTypeComboBox.currentText()) 
1730
         Window["type"] = str(self.ui.windowTypeComboBox.currentText()) 
1730
         Window["width"] = str(self.ui.windowBandwidthSpinBox.value()) 
1731
         Window["width"] = str(self.ui.windowBandwidthSpinBox.value()) 
1731
         Window["centre"] = str(self.ui.CentralVSpinBox.value() )
1732
         Window["centre"] = str(self.ui.CentralVSpinBox.value() )

+ 40
- 36
akvo/gui/mydynamicmplcanvas.py View File

40
         self.compute_initial_figure()
40
         self.compute_initial_figure()
41
 
41
 
42
     def reAxH(self, num, shx=True, shy=True):
42
     def reAxH(self, num, shx=True, shy=True):
43
-        
43
+        fs = 10
44
+ 
44
         try:
45
         try:
45
             for ax in fig.axes:
46
             for ax in fig.axes:
46
                 self.fig.delaxes(ax)
47
                 self.fig.delaxes(ax)
54
         for n in range(num):
55
         for n in range(num):
55
             if n == 0:
56
             if n == 0:
56
                 self.ax1 = self.fig.add_subplot( 1, num, 1)
57
                 self.ax1 = self.fig.add_subplot( 1, num, 1)
57
-                self.ax1.tick_params(axis='both', which='major', labelsize=8)
58
+                self.ax1.tick_params(axis='both', which='major', labelsize=fs)
58
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
59
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
59
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='x')  
60
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='x')  
60
-                self.ax1.yaxis.get_offset_text().set_size(8) 
61
-                self.ax1.xaxis.get_offset_text().set_size(8) 
61
+                self.ax1.yaxis.get_offset_text().set_size(fs) 
62
+                self.ax1.xaxis.get_offset_text().set_size(fs) 
62
             if n == 1:
63
             if n == 1:
63
                 self.ax2 = self.fig.add_subplot( 1, num, 2)
64
                 self.ax2 = self.fig.add_subplot( 1, num, 2)
64
-                self.ax2.tick_params(axis='both', which='major', labelsize=8)
65
+                self.ax2.tick_params(axis='both', which='major', labelsize=fs)
65
                 self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
66
                 self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
66
-                self.ax2.yaxis.get_offset_text().set_size(8) 
67
+                self.ax2.yaxis.get_offset_text().set_size(fs) 
67
             if n == 2:
68
             if n == 2:
68
                 self.ax3 = self.fig.add_subplot( 1, num, 3) 
69
                 self.ax3 = self.fig.add_subplot( 1, num, 3) 
69
-                self.ax3.tick_params(axis='both', which='major', labelsize=8)
70
+                self.ax3.tick_params(axis='both', which='major', labelsize=fs)
70
                 self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
71
                 self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
71
-                self.ax3.yaxis.get_offset_text().set_size(8) 
72
+                self.ax3.yaxis.get_offset_text().set_size(fs) 
72
             if n == 3:
73
             if n == 3:
73
                 self.ax4 = self.fig.add_subplot( 1, num, 4) 
74
                 self.ax4 = self.fig.add_subplot( 1, num, 4) 
74
-                self.ax4.tick_params(axis='both', which='major', labelsize=8)
75
+                self.ax4.tick_params(axis='both', which='major', labelsize=fs)
75
                 self.ax4.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
76
                 self.ax4.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
76
-                self.ax4.yaxis.get_offset_text().set_size(8) 
77
+                self.ax4.yaxis.get_offset_text().set_size(fs) 
77
     
78
     
78
     def reAxH2(self, num, shx=True, shy=True):
79
     def reAxH2(self, num, shx=True, shy=True):
80
+        fs = 10
79
         try:
81
         try:
80
             for ax in fig.axes:
82
             for ax in fig.axes:
81
                 self.fig.delaxes(ax)
83
                 self.fig.delaxes(ax)
89
         for n in range(num):
91
         for n in range(num):
90
             if n == 0:
92
             if n == 0:
91
                 self.ax1 = self.fig.add_subplot( 2, num, 1)
93
                 self.ax1 = self.fig.add_subplot( 2, num, 1)
92
-                self.ax1.tick_params(axis='both', which='major', labelsize=8)
94
+                self.ax1.tick_params(axis='both', which='major', labelsize=fs)
93
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
95
                 self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
94
-                self.ax1.yaxis.get_offset_text().set_size(8) 
96
+                self.ax1.yaxis.get_offset_text().set_size(fs) 
95
                 self.ax21 = self.fig.add_subplot( 2, num, num+1)
97
                 self.ax21 = self.fig.add_subplot( 2, num, num+1)
96
-                self.ax21.tick_params(axis='both', which='major', labelsize=8)
98
+                self.ax21.tick_params(axis='both', which='major', labelsize=fs)
97
                 self.ax21.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
99
                 self.ax21.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
98
-                self.ax21.yaxis.get_offset_text().set_size(8) 
100
+                self.ax21.yaxis.get_offset_text().set_size(fs) 
99
             if n == 1:
101
             if n == 1:
100
                 self.ax2 = self.fig.add_subplot( 2, num, 2, sharex=self.ax1, sharey=self.ax1)
102
                 self.ax2 = self.fig.add_subplot( 2, num, 2, sharex=self.ax1, sharey=self.ax1)
101
-                self.ax2.tick_params(axis='both', which='major', labelsize=8)
103
+                self.ax2.tick_params(axis='both', which='major', labelsize=fs)
102
                 self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
104
                 self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
103
-                self.ax2.yaxis.get_offset_text().set_size(8) 
105
+                self.ax2.yaxis.get_offset_text().set_size(fs) 
104
                 self.ax22 = self.fig.add_subplot( 2, num, num+2, sharex=self.ax21, sharey=self.ax21)
106
                 self.ax22 = self.fig.add_subplot( 2, num, num+2, sharex=self.ax21, sharey=self.ax21)
105
-                self.ax22.tick_params(axis='both', which='major', labelsize=8)
107
+                self.ax22.tick_params(axis='both', which='major', labelsize=fs)
106
                 self.ax22.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
108
                 self.ax22.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
107
-                self.ax22.yaxis.get_offset_text().set_size(8) 
109
+                self.ax22.yaxis.get_offset_text().set_size(fs) 
108
             if n == 2:
110
             if n == 2:
109
                 self.ax3 = self.fig.add_subplot( 2, num, 3, sharex=self.ax1, sharey=self.ax1)
111
                 self.ax3 = self.fig.add_subplot( 2, num, 3, sharex=self.ax1, sharey=self.ax1)
110
-                self.ax3.tick_params(axis='both', which='major', labelsize=8)
112
+                self.ax3.tick_params(axis='both', which='major', labelsize=fs)
111
                 self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
113
                 self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
112
-                self.ax3.yaxis.get_offset_text().set_size(8) 
114
+                self.ax3.yaxis.get_offset_text().set_size(fs) 
113
                 self.ax23 = self.fig.add_subplot( 2, num, num+3, sharex=self.ax21, sharey=self.ax21)
115
                 self.ax23 = self.fig.add_subplot( 2, num, num+3, sharex=self.ax21, sharey=self.ax21)
114
-                self.ax23.tick_params(axis='both', which='major', labelsize=8)
116
+                self.ax23.tick_params(axis='both', which='major', labelsize=fs)
115
                 self.ax23.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
117
                 self.ax23.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
116
-                self.ax23.yaxis.get_offset_text().set_size(8) 
118
+                self.ax23.yaxis.get_offset_text().set_size(fs) 
117
             if n == 3:
119
             if n == 3:
118
                 self.ax4 = self.fig.add_subplot( 2, num, 4, sharex=self.ax1, sharey=self.ax1 )
120
                 self.ax4 = self.fig.add_subplot( 2, num, 4, sharex=self.ax1, sharey=self.ax1 )
119
-                self.ax4.tick_params(axis='both', which='major', labelsize=8)
121
+                self.ax4.tick_params(axis='both', which='major', labelsize=fs)
120
                 self.ax4.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
122
                 self.ax4.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
121
-                self.ax4.yaxis.get_offset_text().set_size(8) 
123
+                self.ax4.yaxis.get_offset_text().set_size(fs) 
122
                 self.ax24 = self.fig.add_subplot( 2, num, num+4, sharex=self.ax21, sharey=self.ax21 )
124
                 self.ax24 = self.fig.add_subplot( 2, num, num+4, sharex=self.ax21, sharey=self.ax21 )
123
-                self.ax24.tick_params(axis='both', which='major', labelsize=8)
125
+                self.ax24.tick_params(axis='both', which='major', labelsize=fs)
124
                 self.ax24.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
126
                 self.ax24.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
125
-                self.ax24.yaxis.get_offset_text().set_size(8) 
127
+                self.ax24.yaxis.get_offset_text().set_size(fs) 
126
             if n == 4:
128
             if n == 4:
127
                 self.ax5 = self.fig.add_subplot( 2, num, 5, sharex=self.ax1, sharey=self.ax1 )
129
                 self.ax5 = self.fig.add_subplot( 2, num, 5, sharex=self.ax1, sharey=self.ax1 )
128
                 self.ax5.tick_params(axis='both', which='major', labelsize=8)
130
                 self.ax5.tick_params(axis='both', which='major', labelsize=8)
195
         else:
197
         else:
196
             self.ax2 = self.fig.add_subplot(212)
198
             self.ax2 = self.fig.add_subplot(212)
197
 
199
 
198
-        self.ax1.tick_params(axis='both', which='major', labelsize=8)
199
-        self.ax2.tick_params(axis='both', which='major', labelsize=8)
200
+        self.ax1.tick_params(axis='both', which='major', labelsize=10)
201
+        self.ax2.tick_params(axis='both', which='major', labelsize=10)
200
 
202
 
201
         self.ax1.ticklabel_format(style='scientific', scilimits=(0,0), axis='y')  
203
         self.ax1.ticklabel_format(style='scientific', scilimits=(0,0), axis='y')  
202
         self.ax2.ticklabel_format(style='scientific', scilimits=(0,0), axis='y')  
204
         self.ax2.ticklabel_format(style='scientific', scilimits=(0,0), axis='y')  
203
 
205
 
204
-        self.ax1.yaxis.get_offset_text().set_size(8) 
205
-        self.ax2.yaxis.get_offset_text().set_size(8) 
206
+        self.ax1.yaxis.get_offset_text().set_size(10) 
207
+        self.ax2.yaxis.get_offset_text().set_size(10) 
206
     
208
     
207
     def softClear(self):
209
     def softClear(self):
208
         for ax in self.fig.get_axes():
210
         for ax in self.fig.get_axes():
212
 
214
 
213
     def reAx3(self, shx=True, shy=True):
215
     def reAx3(self, shx=True, shy=True):
214
 
216
 
217
+        fs = 10
218
+
215
         try:
219
         try:
216
             self.fig.clear()
220
             self.fig.clear()
217
         except:
221
         except:
257
         #self.fig.set_edgecolor('red')
261
         #self.fig.set_edgecolor('red')
258
         #self.ax1.set_axis_bgcolor('green')
262
         #self.ax1.set_axis_bgcolor('green')
259
 
263
 
260
-        self.ax1.tick_params(axis='both', which='major', labelsize=8)
261
-        self.ax2.tick_params(axis='both', which='major', labelsize=8)
262
-        self.ax3.tick_params(axis='both', which='major', labelsize=8)
264
+        self.ax1.tick_params(axis='both', which='major', labelsize=fs)
265
+        self.ax2.tick_params(axis='both', which='major', labelsize=fs)
266
+        self.ax3.tick_params(axis='both', which='major', labelsize=fs)
263
 
267
 
264
         self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
268
         self.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
265
         self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
269
         self.ax2.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
266
         self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
270
         self.ax3.ticklabel_format(style='sci', scilimits=(0,0), axis='y')  
267
 
271
 
268
-        self.ax1.yaxis.get_offset_text().set_size(8) 
269
-        self.ax2.yaxis.get_offset_text().set_size(8)    
270
-        self.ax3.yaxis.get_offset_text().set_size(8)    
272
+        self.ax1.yaxis.get_offset_text().set_size(fs) 
273
+        self.ax2.yaxis.get_offset_text().set_size(fs)    
274
+        self.ax3.yaxis.get_offset_text().set_size(fs)    
271
  
275
  
272
     def reAx4(self):
276
     def reAx4(self):
273
 
277
 

+ 5
- 3
akvo/terminal/plotKernel.py View File

9
 from matplotlib.ticker import FormatStrFormatter
9
 from matplotlib.ticker import FormatStrFormatter
10
 import numpy as np
10
 import numpy as np
11
 import yaml
11
 import yaml
12
-from  lemma_yaml import *
13
-
12
+from  akvo.tressel.lemma_yaml import *
13
+from akvo.tressel.SlidesPlot import *
14
 import cmocean 
14
 import cmocean 
15
 
15
 
16
 def catLayers(K0):
16
 def catLayers(K0):
29
     K = 1e9*catLayers(K0.K0)
29
     K = 1e9*catLayers(K0.K0)
30
     q = np.array(K0.PulseI.data)* (float)(K0.Taup)
30
     q = np.array(K0.PulseI.data)* (float)(K0.Taup)
31
 
31
 
32
+    fig = plt.figure( figsize=(pc2in(20),pc2in(20)) )
33
+    fig.add_axes((.2,.2,.65,.7))
32
     #plt.pcolor(K0.Interfaces.data, K0.PulseI.data, np.abs(K))
34
     #plt.pcolor(K0.Interfaces.data, K0.PulseI.data, np.abs(K))
33
     #plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.gray_r)
35
     #plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.gray_r)
34
     #plt.contourf(q, K0.Interfaces.data[0:-1], np.abs(K), cmap=cmocean.cm.tempo)
36
     #plt.contourf(q, K0.Interfaces.data[0:-1], np.abs(K), cmap=cmocean.cm.tempo)
35
     plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.tempo)
37
     plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.tempo)
36
-    plt.colorbar()
38
+    plt.colorbar(label=r"$\left| \overline{\mathcal{V}_N}(0) \right|$ (nV)")
37
 
39
 
38
     ax1 = plt.gca()
40
     ax1 = plt.gca()
39
     ax1.set_ylim( ax1.get_ylim()[1], ax1.get_ylim()[0]  )
41
     ax1.set_ylim( ax1.get_ylim()[1], ax1.get_ylim()[0]  )

+ 6
- 4
akvo/tressel/SlidesPlot.py View File

2
 # GJI final pub specs                                                           #
2
 # GJI final pub specs                                                           #
3
 import matplotlib                                                               #
3
 import matplotlib                                                               #
4
 from matplotlib import rc                                                           #
4
 from matplotlib import rc                                                           #
5
-matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{timet,amsmath,amssymb}"]  #
6
-rc('font',**{'family':'sans-serif','serif':['timet']})                                   #
7
-rc('font',**{'size':11})                                                             #
8
-rc('text', usetex=True)                                                             #
5
+
6
+#matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{timet,amsmath,amssymb}"]  #
7
+#rc('font',**{'family':'sans-serif','serif':['timet']})                                   #
8
+#rc('font',**{'size':11})                                                             #
9
+#rc('text', usetex=True)                                                             #
10
+
9
 # converts pc that GJI is defined in to inches                                      # 
11
 # converts pc that GJI is defined in to inches                                      # 
10
 # In GEOPHYSICS \textwidth = 42pc                                               #
12
 # In GEOPHYSICS \textwidth = 42pc                                               #
11
 #        \columnwidth = 20pc                                                    #
13
 #        \columnwidth = 20pc                                                    #

+ 3
- 3
akvo/tressel/decay.py View File

84
 
84
 
85
     #method = ['trf','dogbox','lm'][method_int]
85
     #method = ['trf','dogbox','lm'][method_int]
86
     #loss = ['linear','soft_l1','cauchy','huber'][loss_int] 
86
     #loss = ['linear','soft_l1','cauchy','huber'][loss_int] 
87
-    print ("method", method, 'loss', loss) 
87
+    #print ("method", method, 'loss', loss) 
88
     if x0=="None":
88
     if x0=="None":
89
         if method == 'lm':
89
         if method == 'lm':
90
             x0 = np.array( [50., 0., 0., .200] ) # A0, zeta, df, T2 
90
             x0 = np.array( [50., 0., 0., .200] ) # A0, zeta, df, T2 
94
         else:
94
         else:
95
             x0 = np.array( [50., 0., 0., .200] ) # A0, zeta, df, T2 
95
             x0 = np.array( [50., 0., 0., .200] ) # A0, zeta, df, T2 
96
             res_lsq = least_squares(fun, x0, args=(tt, np.concatenate((X, Y))), loss=loss, f_scale=1.0,\
96
             res_lsq = least_squares(fun, x0, args=(tt, np.concatenate((X, Y))), loss=loss, f_scale=1.0,\
97
-                    bounds=( [5, -np.pi, -5, .001] , [1000., np.pi, 5, .800] ),
97
+                    bounds=( [5, -np.pi, -5, .001] , [5000., np.pi, 5, .800] ),
98
                     method=method 
98
                     method=method 
99
                     )
99
                     )
100
         x = res_lsq.x 
100
         x = res_lsq.x 
101
-        print ("A0={} zeta={} df={} T2={}".format(x[0],x[1],x[2],x[3]))
101
+        #print ("A0={} zeta={} df={} T2={}".format(x[0],x[1],x[2],x[3]))
102
     else:
102
     else:
103
         res_lsq = least_squares(fun, x0, args=(tt, np.concatenate((X, Y))), loss=loss, f_scale=1.0,\
103
         res_lsq = least_squares(fun, x0, args=(tt, np.concatenate((X, Y))), loss=loss, f_scale=1.0,\
104
             #bounds=( [1., -np.pi, -5, .005] , [1000., np.pi, 5, .800] ),
104
             #bounds=( [1., -np.pi, -5, .005] , [1000., np.pi, 5, .800] ),

+ 9
- 24
akvo/tressel/invertTA.py View File

89
 
89
 
90
 def main():
90
 def main():
91
 
91
 
92
-    if (len (sys.argv) < 3):
93
-        print ("python invertTA.py  K0.dat  Data.yaml")
94
-    print (sys.argv[1])
92
+    if (len (sys.argv) < 2):
93
+        print ("akvoQT   invertParameters.yaml")
94
+        exit()
95
+    
95
     with open(sys.argv[1], 'r') as stream:
96
     with open(sys.argv[1], 'r') as stream:
96
         try:
97
         try:
97
             cont = (yaml.load(stream, Loader=yaml.Loader))
98
             cont = (yaml.load(stream, Loader=yaml.Loader))
98
         except yaml.YAMLError as exc:
99
         except yaml.YAMLError as exc:
99
             print(exc)
100
             print(exc)
101
+
100
     ###############################################
102
     ###############################################
101
     # Load in data
103
     # Load in data
102
     ###############################################
104
     ###############################################
114
         VS[0] = np.concatenate( (VS[0], VS[iv]) )
116
         VS[0] = np.concatenate( (VS[0], VS[iv]) )
115
     V = V[0]
117
     V = V[0]
116
     VS = VS[0]
118
     VS = VS[0]
117
-    
118
-    #plt.matshow(V, cmap='RdBu', vmin=-np.max(np.abs(V)), vmax=np.max(np.abs(V)))
119
-    #plt.title("data")
120
-    #plt.colorbar()
121
-    #plt.show()
122
-    #exit()    
123
-
124
-    #plt.matshow(VS, cmap='inferno', vmin=-np.max(np.abs(VS)), vmax=np.max(np.abs(VS)))
125
-    #plt.title("error")
126
-    #plt.colorbar()
127
 
119
 
128
     ###############################################
120
     ###############################################
129
     # Load in kernels
121
     # Load in kernels
142
     ############################################### 
134
     ############################################### 
143
     T2Bins = np.logspace( np.log10(cont["T2Bins"]["low"]), np.log10(cont["T2Bins"]["high"]), cont["T2Bins"]["number"], endpoint=True, base=10)  
135
     T2Bins = np.logspace( np.log10(cont["T2Bins"]["low"]), np.log10(cont["T2Bins"]["high"]), cont["T2Bins"]["number"], endpoint=True, base=10)  
144
     KQT = buildKQT(K0,tg,T2Bins)
136
     KQT = buildKQT(K0,tg,T2Bins)
145
-    #plt.matshow(KQT)
146
 
137
 
147
-    # Chan. 1    reg = 1.5   
148
-    # Chan. 2    reg = 1.35
149
-    # Chan. 4    reg = 1.95  
150
  
138
  
151
     ###############################################
139
     ###############################################
152
     # Invert
140
     # Invert
153
     ############################################### 
141
     ############################################### 
154
     print("Calling inversion", flush=True)
142
     print("Calling inversion", flush=True)
155
-    inv, ibreak, errn, phim, phid, mkappa = logBarrier(KQT, np.ravel(V), T2Bins, "lcurve", MAXITER=150, sigma=np.ravel(VS), alpha=1e6, smooth="Smallest" ) #, smooth=True) # 
156
-                     #logBarrier(A, b, T2Bins, lambdastar, x_0=0, xr=0, alpha=10, mu1=10, mu2=10, smooth=False, MAXITER=70, fignum=1000, sigma=1, callback=None):
157
-    #return x, ibreak, np.sqrt(phid/len(b)), PHIM, PHID/len(b), np.argmax(kappa)
143
+    inv, ibreak, errn, phim, phid, mkappa = logBarrier(KQT, np.ravel(V), T2Bins, "lcurve", MAXITER=150, sigma=np.ravel(VS), alpha=1e6, smooth="Smallest" ) 
158
 
144
 
159
 
145
 
160
     ###############################################
146
     ###############################################
178
 
164
 
179
     T2Bins = np.append( T2Bins, T2Bins[-1] + (T2Bins[-1]-T2Bins[-2]) )
165
     T2Bins = np.append( T2Bins, T2Bins[-1] + (T2Bins[-1]-T2Bins[-2]) )
180
     
166
     
181
-    print( np.shape(inv), len(ifaces)-1,cont["T2Bins"]["number"] )
182
     INV = np.reshape(inv, (len(ifaces)-1,cont["T2Bins"]["number"]) )
167
     INV = np.reshape(inv, (len(ifaces)-1,cont["T2Bins"]["number"]) )
183
     Y,X = meshgrid( ifaces, T2Bins )
168
     Y,X = meshgrid( ifaces, T2Bins )
184
-    fig = plt.figure( figsize=(pc2in(17.0),pc2in(18.)) )
169
+    fig = plt.figure( figsize=(pc2in(20.0),pc2in(22.)) )
185
     ax1 = fig.add_axes( [.2,.15,.6,.7] )
170
     ax1 = fig.add_axes( [.2,.15,.6,.7] )
186
     im = ax1.pcolor(X, Y, INV.T, cmap=cmocean.cm.tempo) #cmap='viridis')
171
     im = ax1.pcolor(X, Y, INV.T, cmap=cmocean.cm.tempo) #cmap='viridis')
187
     im.set_edgecolor('face')
172
     im.set_edgecolor('face')
192
     cb.ax.yaxis.set_offset_position('left')                         
177
     cb.ax.yaxis.set_offset_position('left')                         
193
     cb.update_ticks()
178
     cb.update_ticks()
194
  
179
  
195
-    #ax1.set_xlabel(u"$T_2^*$ (ms)")
196
-    #ax1.set_ylabel(u"depth (m)$")
180
+    ax1.set_xlabel(u"$T_2^*$ (ms)")
181
+    ax1.set_ylabel(u"depth (m)")
197
     
182
     
198
     ax1.get_xaxis().set_major_formatter(FormatStrFormatter('%1.0f'))
183
     ax1.get_xaxis().set_major_formatter(FormatStrFormatter('%1.0f'))
199
     ax1.get_yaxis().set_major_formatter(FormatStrFormatter('%1.0f'))
184
     ax1.get_yaxis().set_major_formatter(FormatStrFormatter('%1.0f'))

+ 18
- 5
akvo/tressel/logbarrier.py View File

8
 
8
 
9
 import matplotlib.pyplot as plt
9
 import matplotlib.pyplot as plt
10
 
10
 
11
+from akvo.tressel.SlidesPlot import * 
12
+
11
 def PhiB(mux, minVal, x):
13
 def PhiB(mux, minVal, x):
12
     phib = mux * np.abs( np.sum(np.log( x-minVal)) )
14
     phib = mux * np.abs( np.sum(np.log( x-minVal)) )
13
     return phib
15
     return phib
247
                 if np.sqrt(phid/len(b)) <= 1:
249
                 if np.sqrt(phid/len(b)) <= 1:
248
                     ibreak=0
250
                     ibreak=0
249
 
251
 
250
-                plt.figure()
252
+                fig = plt.figure( figsize=(pc2in(20.0),pc2in(22.)) )
253
+                ax1 = fig.add_axes( [.2,.15,.6,.7] )
251
                 #plt.plot( (np.array(PHIM)),  np.log(np.array(PHID)/len(b)), '.-')
254
                 #plt.plot( (np.array(PHIM)),  np.log(np.array(PHID)/len(b)), '.-')
252
                 #plt.plot(  ((np.array(PHIM))[np.argmax(kappa)]) , np.log( (np.array(PHID)/len(b))[np.argmax(kappa)] ), '.', markersize=12)
255
                 #plt.plot(  ((np.array(PHIM))[np.argmax(kappa)]) , np.log( (np.array(PHID)/len(b))[np.argmax(kappa)] ), '.', markersize=12)
253
                 #plt.axhline()
256
                 #plt.axhline()
254
-                plt.plot( np.log(np.array(PHIM)),  np.log(np.sqrt(np.array(PHID)/len(b))), '.-')
255
-                plt.plot( np.log(np.array(PHIM))[np.argmax(kappa)], np.log(np.sqrt(np.array(PHID)/len(b))[np.argmax(kappa)]), '.', markersize=12)
257
+                lns1 = plt.plot( np.log(np.array(PHIM)),  np.log(np.sqrt(np.array(PHID)/len(b))), '.-', label="L curve")
258
+                lns2 = plt.plot( np.log(np.array(PHIM))[np.argmax(kappa)], np.log(np.sqrt(np.array(PHID)/len(b))[np.argmax(kappa)]), '.', markersize=12, label="$\lambda^*$")
256
                 ax2 = plt.twinx()
259
                 ax2 = plt.twinx()
257
-                ax2.plot( np.log(np.array(PHIM)), kappa, color='green', label="lcurve" )
258
-                plt.legend()
260
+                lns3 = ax2.plot( np.log(np.array(PHIM)), kappa, color='orange', label="curvature" )
261
+
262
+                # Single legend 
263
+                lns = lns1+lns3
264
+                labs = [l.get_label() for l in lns]
265
+                ax2.legend(lns, labs, loc=0)
266
+
267
+                ax1.set_xlabel("$\phi_m$")
268
+                ax1.set_ylabel("$\phi_d$")
269
+                
270
+                ax2.set_ylabel("curvature")
271
+
259
                 plt.savefig('lcurve.pdf')
272
                 plt.savefig('lcurve.pdf')
260
                 break
273
                 break
261
 
274
 

+ 127
- 84
akvo/tressel/mrsurvey.py View File

17
 import matplotlib.ticker 
17
 import matplotlib.ticker 
18
 from matplotlib.ticker import MaxNLocator
18
 from matplotlib.ticker import MaxNLocator
19
 
19
 
20
+import seaborn as sns 
21
+from akvo.tressel.SlidesPlot import deSpine
22
+
20
 import multiprocessing 
23
 import multiprocessing 
21
 import itertools 
24
 import itertools 
22
 
25
 
301
         pass   
304
         pass   
302
  
305
  
303
     def TDSmartStack(self, outlierTest, MADcutoff, canvas):
306
     def TDSmartStack(self, outlierTest, MADcutoff, canvas):
307
+        fs = 10 # fontsize 
304
         #print("Line 300 in mrsurvey")
308
         #print("Line 300 in mrsurvey")
305
         Stack = {}
309
         Stack = {}
306
         # align for stacking and modulate
310
         # align for stacking and modulate
362
                 ax1.yaxis.set_major_formatter(y_formatter)
366
                 ax1.yaxis.set_major_formatter(y_formatter)
363
 
367
 
364
                 ax1.plot( 1e3*self.DATADICT[pulse]["TIMES"], np.average(  SimpleStack[pulse][chan], 0 )) #, color='darkblue' )
368
                 ax1.plot( 1e3*self.DATADICT[pulse]["TIMES"], np.average(  SimpleStack[pulse][chan], 0 )) #, color='darkblue' )
365
-                ax1.set_title("Ch." + str(chan) + ": avg FID", fontsize=8)
366
-                ax1.set_xlabel(r"time (ms)", fontsize=8)
369
+                ax1.set_title("Ch." + str(chan) + ": avg FID", fontsize=fs)
370
+                ax1.set_xlabel(r"time (ms)", fontsize=fs)
367
 
371
 
368
                 if ichan == 0:
372
                 if ichan == 0:
369
-                    ax1.set_ylabel(r"signal (nV)", fontsize=8)
373
+                    ax1.set_ylabel(r"signal (nV)", fontsize=fs)
370
                 else:
374
                 else:
371
                     plt.setp(ax1.get_yticklabels(), visible=False)
375
                     plt.setp(ax1.get_yticklabels(), visible=False)
372
                     plt.setp(ax1.get_yaxis().get_offset_text(), visible=False) 
376
                     plt.setp(ax1.get_yaxis().get_offset_text(), visible=False) 
503
                 #im2 = ax2.matshow( db, aspect='auto', cmap=cmocean.cm.ice, vmin=vvmin, vmax=vvmax)
507
                 #im2 = ax2.matshow( db, aspect='auto', cmap=cmocean.cm.ice, vmin=vvmin, vmax=vvmax)
504
                 if ichan == 0:
508
                 if ichan == 0:
505
                     #ax2.set_ylabel(r"$q$ (A $\cdot$ s)", fontsize=8)
509
                     #ax2.set_ylabel(r"$q$ (A $\cdot$ s)", fontsize=8)
506
-                    ax2.set_ylabel(r"pulse index", fontsize=8)
510
+                    ax2.set_ylabel(r"pulse index", fontsize=10)
507
                     #ax1.set_ylabel(r"FID (nV)", fontsize=8)
511
                     #ax1.set_ylabel(r"FID (nV)", fontsize=8)
508
                 else:
512
                 else:
509
                     #ax2.yaxis.set_ticklabels([])
513
                     #ax2.yaxis.set_ticklabels([])
528
                 ichan += 1   
532
                 ichan += 1   
529
 
533
 
530
 
534
 
531
-        canvas.fig.subplots_adjust(hspace=.1, wspace=.05, left=.075, right=.95 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
535
+        canvas.fig.subplots_adjust(hspace=.35, wspace=.15, left=.15, right=.8 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
536
+        deSpine(ax1)
532
         
537
         
533
         #cb1 = canvas.fig.colorbar(im, ax=axes[0::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
538
         #cb1 = canvas.fig.colorbar(im, ax=axes[0::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
534
         #cb1.ax.tick_params(axis='both', which='major', labelsize=8)
539
         #cb1.ax.tick_params(axis='both', which='major', labelsize=8)
535
         #cb1.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
540
         #cb1.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
536
 
541
 
537
         cb2 = canvas.fig.colorbar(im2[-1], ax=axes[1::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
542
         cb2 = canvas.fig.colorbar(im2[-1], ax=axes[1::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
538
-        cb2.ax.tick_params(axis='both', which='major', labelsize=8)
539
-        cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
543
+        cb2.ax.tick_params(axis='both', which='major', labelsize=fs)
544
+        cb2.set_label(r"$\left| \mathcal{V}_N \right|$ (nV)", fontsize=fs)
545
+                    
540
 
546
 
541
         #canvas.fig.tight_layout() 
547
         #canvas.fig.tight_layout() 
542
         canvas.draw()
548
         canvas.draw()
564
             canvas = mpl plotting axis      
570
             canvas = mpl plotting axis      
565
         """
571
         """
566
         TDPlot = True
572
         TDPlot = True
567
-        
573
+        fs = 10       
574
+ 
568
         if plot:
575
         if plot:
569
             canvas.reAx2(shy=False)
576
             canvas.reAx2(shy=False)
570
-            canvas.ax1.set_ylabel(r"signal (nV)", fontsize=8)
571
-            canvas.ax2.set_ylabel(r"signal (nV)", fontsize=8)
577
+            canvas.ax1.set_ylabel(r"signal (nV)", fontsize=fs)
578
+            canvas.ax2.set_ylabel(r"signal (nV)", fontsize=fs)
572
             if TDPlot:
579
             if TDPlot:
573
-                canvas.ax2.set_xlabel(r"time (s)", fontsize=8)
580
+                canvas.ax2.set_xlabel(r"time (s)", fontsize=fs)
574
             else:
581
             else:
575
-                canvas.ax2.set_xlabel(r"frequency (Hz)", fontsize=8)
582
+                canvas.ax2.set_xlabel(r"frequency (Hz)", fontsize=fs)
576
                 canvas.ax1.set_yscale('log')
583
                 canvas.ax1.set_yscale('log')
577
                 canvas.ax2.set_yscale('log')
584
                 canvas.ax2.set_yscale('log')
578
 
585
 
703
 
710
 
704
                     if plot:
711
                     if plot:
705
                         if procRefs: 
712
                         if procRefs: 
706
-                            canvas.ax1.legend(prop={'size':6}, loc='upper right')
707
-                        canvas.ax2.legend(prop={'size':6}, loc='upper right')
713
+                            canvas.ax1.legend(prop={'size':fs}, loc='upper right')
714
+                            plt.setp(canvas.ax1.get_xticklabels(), visible=False)
715
+                        canvas.ax2.legend(prop={'size':fs}, loc='upper right')
716
+                        deSpine(canvas.ax1)
717
+                        deSpine(canvas.ax2)
718
+                        canvas.fig.tight_layout()
708
                         canvas.draw() 
719
                         canvas.draw() 
709
                 
720
                 
710
                 percent = (int)(1e2*((ipm+istack*self.nPulseMoments)/(self.nPulseMoments*len(self.DATADICT["stacks"])))) 
721
                 percent = (int)(1e2*((ipm+istack*self.nPulseMoments)/(self.nPulseMoments*len(self.DATADICT["stacks"])))) 
766
                 #ax1.plot( 1e3*self.DATADICT[pulse][chan]["FFT"]["nu"][0:len(SimpleStack[pulse][chan])], np.average(SimpleStack[pulse][chan], 0 )) #, color='darkblue' )
777
                 #ax1.plot( 1e3*self.DATADICT[pulse][chan]["FFT"]["nu"][0:len(SimpleStack[pulse][chan])], np.average(SimpleStack[pulse][chan], 0 )) #, color='darkblue' )
767
                 #ax1.pcolor( np.real(SimpleStack[pulse][chan]) ) #, color='darkblue' )
778
                 #ax1.pcolor( np.real(SimpleStack[pulse][chan]) ) #, color='darkblue' )
768
                 ax1.matshow( np.real(SimpleStack[pulse][chan]), aspect='auto') #, color='darkblue' )
779
                 ax1.matshow( np.real(SimpleStack[pulse][chan]), aspect='auto') #, color='darkblue' )
769
-                ax1.set_title("Ch." + str(chan) + ": avg FID", fontsize=8)
770
-                ax1.set_xlabel(r"time (ms)", fontsize=8)
780
+                ax1.set_title("Ch." + str(chan) + ": avg FID", fontsize=10)
781
+                ax1.set_xlabel(r"time (ms)", fontsize=10)
771
 
782
 
772
                 if ichan == 0:
783
                 if ichan == 0:
773
-                    ax1.set_ylabel(r"signal [nV]", fontsize=8)
784
+                    ax1.set_ylabel(r"signal [nV]", fontsize=10)
774
                 else:
785
                 else:
775
                     plt.setp(ax1.get_yticklabels(), visible=False)
786
                     plt.setp(ax1.get_yticklabels(), visible=False)
776
                     plt.setp(ax1.get_yaxis().get_offset_text(), visible=False) 
787
                     plt.setp(ax1.get_yaxis().get_offset_text(), visible=False) 
932
 #         cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
943
 #         cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
933
 
944
 
934
         #canvas.fig.tight_layout() 
945
         #canvas.fig.tight_layout() 
946
+        deSpine(ax1)
935
         canvas.draw()
947
         canvas.draw()
936
         self.doneTrigger.emit() 
948
         self.doneTrigger.emit() 
937
 
949
 
1034
                     ht = signal.hilbert(xn)*np.exp(-1j*wL*self.DATADICT[pulse]["TIMES"])
1046
                     ht = signal.hilbert(xn)*np.exp(-1j*wL*self.DATADICT[pulse]["TIMES"])
1035
                     #############################################################
1047
                     #############################################################
1036
                     # Quadrature signal 
1048
                     # Quadrature signal 
1037
-                    RE[pulse][chan][ipm,:] = np.real(ht[clip::])   
1038
-                    IM[pulse][chan][ipm,:] = np.imag(ht[clip::])
1049
+                    RE[pulse][chan][ipm,:] = -np.real(ht[clip::])  # negative for consistency with VC  
1050
+                    IM[pulse][chan][ipm,:] =  np.imag(ht[clip::])
1039
                     REmax[pulse] = max(REmax[pulse], np.max(np.real(ht[clip::])))
1051
                     REmax[pulse] = max(REmax[pulse], np.max(np.real(ht[clip::])))
1040
                     IMmax[pulse] = max(IMmax[pulse], np.max(np.imag(ht[clip::])))
1052
                     IMmax[pulse] = max(IMmax[pulse], np.max(np.imag(ht[clip::])))
1041
                     #############################################################
1053
                     #############################################################
1084
 
1096
 
1085
         ###############
1097
         ###############
1086
         # Plot on GUI #      
1098
         # Plot on GUI #      
1087
-        ############### 
1099
+        ###############
1100
+        fs = 10 
1088
         dcmap = cmocean.cm.curl_r  #"seismic_r" #cmocean.cm.balance_r #"RdBu" #YlGn" # "coolwarm_r"  # diverging 
1101
         dcmap = cmocean.cm.curl_r  #"seismic_r" #cmocean.cm.balance_r #"RdBu" #YlGn" # "coolwarm_r"  # diverging 
1089
         canvas.reAxH2(  len(self.DATADICT[ self.DATADICT["PULSES"][0] ]["chan"] ), False, False)
1102
         canvas.reAxH2(  len(self.DATADICT[ self.DATADICT["PULSES"][0] ]["chan"] ), False, False)
1090
         for pulse in self.DATADICT["PULSES"]:
1103
         for pulse in self.DATADICT["PULSES"]:
1103
 
1116
 
1104
             for chan in self.DATADICT[pulse]["chan"]: 
1117
             for chan in self.DATADICT[pulse]["chan"]: 
1105
                 ax1 = axes[2*ichan  ]
1118
                 ax1 = axes[2*ichan  ]
1106
-                ax2 = axes[2*ichan+1] # TODO fix hard coded number
1119
+                ax2 = axes[2*ichan+1] 
1107
                 if phase == 0: # Re Im 
1120
                 if phase == 0: # Re Im 
1108
-                    #print("plot dog", np.shape(QQ), np.shape(self.DATADICT["RE"][pulse][chan]))
1109
-                    #print("QQ", QQ) 
1110
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["RE"][pulse][chan][iQ], cmap=dcmap, \
1121
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["RE"][pulse][chan][iQ], cmap=dcmap, \
1111
-                         vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] )
1122
+                         vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] , rasterized=True)
1112
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["IM"][pulse][chan][iQ], cmap=dcmap, \
1123
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["IM"][pulse][chan][iQ], cmap=dcmap, \
1113
-                         vmin=-self.DATADICT["IMmax"][pulse], vmax=self.DATADICT["IMmax"][pulse]  )
1124
+                         vmin=-self.DATADICT["IMmax"][pulse], vmax=self.DATADICT["IMmax"][pulse] , rasterized=True )
1114
                     #im1 = ax1.matshow( self.DATADICT["RE"][pulse][chan][iQ], cmap=dcmap, aspect='auto', \
1125
                     #im1 = ax1.matshow( self.DATADICT["RE"][pulse][chan][iQ], cmap=dcmap, aspect='auto', \
1115
                     #     vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] )
1126
                     #     vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] )
1116
                     #im2 = ax2.matshow( self.DATADICT["IM"][pulse][chan][iQ], cmap=dcmap, aspect='auto', \
1127
                     #im2 = ax2.matshow( self.DATADICT["IM"][pulse][chan][iQ], cmap=dcmap, aspect='auto', \
1117
                     #     vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] )
1128
                     #     vmin=-self.DATADICT["REmax"][pulse] , vmax=self.DATADICT["REmax"][pulse] )
1118
                 if phase == 1: # Amp phase
1129
                 if phase == 1: # Amp phase
1119
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["CA"][pulse][chan][iQ], cmap=dcmap, \
1130
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["CA"][pulse][chan][iQ], cmap=dcmap, \
1120
-                         vmin=-self.DATADICT["CAmax"][pulse] , vmax=self.DATADICT["CAmax"][pulse]  )
1131
+                         vmin=-self.DATADICT["CAmax"][pulse] , vmax=self.DATADICT["CAmax"][pulse], rasterized=True  )
1121
                     #im2 = ax2.pcolormesh( time_sp, QQ, self.DATADICT["IP"][pulse][chan], cmap=cmocean.cm.balance, rasterized=True,\
1132
                     #im2 = ax2.pcolormesh( time_sp, QQ, self.DATADICT["IP"][pulse][chan], cmap=cmocean.cm.balance, rasterized=True,\
1122
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["IP"][pulse][chan][iQ], cmap=cmocean.cm.delta, \
1133
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["IP"][pulse][chan][iQ], cmap=cmocean.cm.delta, \
1123
-                         vmin=-np.pi, vmax=np.pi)
1134
+                         vmin=-np.pi, vmax=np.pi, rasterized=True)
1124
                 if phase == 2: # CA NR
1135
                 if phase == 2: # CA NR
1125
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["CA"][pulse][chan][iQ], cmap=dcmap, \
1136
                     im1 = ax1.pcolormesh( time_sp, QQ[iQ], self.DATADICT["CA"][pulse][chan][iQ], cmap=dcmap, \
1126
-                         vmin=-self.DATADICT["CAmax"][pulse] , vmax=self.DATADICT["CAmax"][pulse] )
1137
+                         vmin=-self.DATADICT["CAmax"][pulse] , vmax=self.DATADICT["CAmax"][pulse], rasterized=True )
1127
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["NR"][pulse][chan][iQ], cmap=dcmap, \
1138
                     im2 = ax2.pcolormesh( time_sp, QQ[iQ], self.DATADICT["NR"][pulse][chan][iQ], cmap=dcmap, \
1128
-                         vmin=-self.DATADICT["NRmax"][pulse] , vmax=self.DATADICT["NRmax"][pulse] )
1139
+                         vmin=-self.DATADICT["NRmax"][pulse] , vmax=self.DATADICT["NRmax"][pulse], rasterized=True )
1129
 #                     cb2 = canvas.fig.colorbar(im2, ax=ax2, format='%1.0e')
1140
 #                     cb2 = canvas.fig.colorbar(im2, ax=ax2, format='%1.0e')
1130
 #                     cb2.set_label("Noise residual (nV)", fontsize=8)
1141
 #                     cb2.set_label("Noise residual (nV)", fontsize=8)
1131
 #                     cb2.ax.tick_params(axis='both', which='major', labelsize=8)
1142
 #                     cb2.ax.tick_params(axis='both', which='major', labelsize=8)
1150
                 self.progressTrigger.emit(percent)
1161
                 self.progressTrigger.emit(percent)
1151
                 
1162
                 
1152
                 if ichan == 0:
1163
                 if ichan == 0:
1153
-                    ax1.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=8)
1154
-                    ax2.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=8)
1164
+                    ax1.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=fs)
1165
+                    ax2.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=fs)
1155
                 else:
1166
                 else:
1156
                     #ax2.yaxis.set_ticklabels([])
1167
                     #ax2.yaxis.set_ticklabels([])
1157
                     #ax1.yaxis.set_ticklabels([])
1168
                     #ax1.yaxis.set_ticklabels([])
1171
             ax2.set_xlim( np.min(time_sp), np.max(time_sp) )
1182
             ax2.set_xlim( np.min(time_sp), np.max(time_sp) )
1172
 
1183
 
1173
             #ax2.set_xlabel(r"Time since end of pulse  (ms)", fontsize=8)
1184
             #ax2.set_xlabel(r"Time since end of pulse  (ms)", fontsize=8)
1174
-            ax2.set_xlabel(r"Time (ms)", fontsize=8)
1185
+            ax2.set_xlabel(r"time (ms)", fontsize=fs)
1186
+        
1187
+        #canvas.fig.subplots_adjust(hspace=.15, wspace=.05, left=.15, right=.85, bottom=.15, top=.9 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1188
+        canvas.fig.subplots_adjust(hspace=.15, wspace=.05, left=.15, right=.90, bottom=.15, top=.95 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1175
         
1189
         
1176
-        canvas.fig.subplots_adjust(hspace=.15, wspace=.05, left=.075, right=.95, bottom=.1, top=.95 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1177
         tick_locator = MaxNLocator(nbins=3)
1190
         tick_locator = MaxNLocator(nbins=3)
1178
 
1191
 
1179
-        cb1 = canvas.fig.colorbar(im1, ax=axes[0::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
1180
-        cb1.ax.tick_params(axis='both', which='major', labelsize=8)
1181
-        cb1.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
1192
+        cb1 = canvas.fig.colorbar(im1, ax=axes[0::2], format='%1.0f', orientation='vertical')
1193
+        #cb1 = canvas.fig.colorbar(im1, ax=axes[0::2], format='%1.0f', orientation='horizontal', shrink=.35, aspect=30, pad=.4)
1194
+        cb1.ax.tick_params(axis='both', which='major', labelsize=fs)
1195
+
1182
         cb1.locator = tick_locator
1196
         cb1.locator = tick_locator
1183
         cb1.update_ticks()
1197
         cb1.update_ticks()
1184
 
1198
 
1185
         tick_locator2 = MaxNLocator(nbins=3)
1199
         tick_locator2 = MaxNLocator(nbins=3)
1186
-        cb2 = canvas.fig.colorbar(im2, ax=axes[1::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30, pad=.2)
1187
-        cb2.ax.tick_params(axis='both', which='major', labelsize=8)
1188
-        if phase == 1: # Amp phase
1189
-            cb2.set_label(r"$\angle \mathcal{V}_N$", fontsize=8)
1200
+        cb2 = canvas.fig.colorbar(im2, ax=axes[1::2], format='%1.0f', orientation='vertical')
1201
+        #cb2 = canvas.fig.colorbar(im2, ax=axes[1::2], format='%1.0f', orientation='horizontal', shrink=.35, aspect=30, pad=.4)
1202
+        cb2.ax.tick_params(axis='both', which='major', labelsize=fs)
1203
+
1204
+        if phase == 0: # Re Im 
1205
+            cb1.set_label(r"$\mathrm{Re} \left( \mathcal{V}_N \right)$ (nV)", fontsize=fs)
1206
+            cb2.set_label(r"$\mathrm{Im} \left( \mathcal{V}_N \right)$ (nV)", fontsize=fs)
1207
+        elif phase == 1: # Amp phase
1208
+            cb1.set_label(r"$\left| \mathcal{V}_N \right|$ (nV)", fontsize=fs)
1209
+            cb2.set_label(r"$\angle \mathcal{V}_N$", fontsize=fs)
1190
         else:
1210
         else:
1191
-            cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
1211
+            cb1.set_label(r"$\left| \mathcal{V}_N \right|$ (nV)", fontsize=fs)
1212
+            cb2.set_label(r"noise (nV)", fontsize=fs)
1192
 
1213
 
1193
 
1214
 
1194
         cb2.locator = tick_locator2
1215
         cb2.locator = tick_locator2
1195
         cb2.update_ticks()
1216
         cb2.update_ticks()
1196
 
1217
 
1218
+        #canvas.fig.tight_layout()
1197
         canvas.draw()
1219
         canvas.draw()
1198
         self.doneTrigger.emit() 
1220
         self.doneTrigger.emit() 
1199
 
1221
 
1341
     def plotGateIntegrate( self, gpd, clip, phase, canvas ):
1363
     def plotGateIntegrate( self, gpd, clip, phase, canvas ):
1342
         """ Plot the gate integration 
1364
         """ Plot the gate integration 
1343
         """
1365
         """
1344
-        
1366
+       
1367
+        fs = 10 
1368
+ 
1345
         canvas.reAxH2(  len(self.DATADICT[ self.DATADICT["PULSES"][0] ]["chan"] ), False, False)
1369
         canvas.reAxH2(  len(self.DATADICT[ self.DATADICT["PULSES"][0] ]["chan"] ), False, False)
1346
         axes = canvas.fig.axes
1370
         axes = canvas.fig.axes
1347
         #cmap = cmocean.cm.balance_r 
1371
         #cmap = cmocean.cm.balance_r 
1454
                 ax2.xaxis.set_major_formatter(formatter) #matplotlib.ticker.FormatStrFormatter('%d.1'))
1478
                 ax2.xaxis.set_major_formatter(formatter) #matplotlib.ticker.FormatStrFormatter('%d.1'))
1455
                 
1479
                 
1456
                 if ichan == 0:
1480
                 if ichan == 0:
1457
-                    ax1.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=8)
1481
+                    ax1.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=fs)
1458
                     if phase == 2:
1482
                     if phase == 2:
1459
-                        ax2.set_ylabel(r"noise est. (nV)", fontsize=8)
1483
+                        ax2.set_ylabel(r"noise est. (nV)", fontsize=fs)
1460
                     else:
1484
                     else:
1461
-                        ax2.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=8)
1485
+                        ax2.set_ylabel(r"$q$ ( $\mathrm{A}\cdot\mathrm{s}$)", fontsize=fs)
1462
                 else:
1486
                 else:
1463
                     plt.setp(ax1.get_yticklabels(), visible=False)
1487
                     plt.setp(ax1.get_yticklabels(), visible=False)
1464
                     plt.setp(ax2.get_yticklabels(), visible=False)
1488
                     plt.setp(ax2.get_yticklabels(), visible=False)
1465
         
1489
         
1466
-                ax2.set_xlabel(r"$t-\tau_p$  (ms)", fontsize=8)
1490
+                ax2.set_xlabel(r"$t-\tau_p$  (ms)", fontsize=fs)
1467
                 ichan += 1 
1491
                 ichan += 1 
1468
 
1492
 
1469
         #canvas.fig.subplots_adjust(hspace=.1, wspace=.05, left=.075, right=.925 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1493
         #canvas.fig.subplots_adjust(hspace=.1, wspace=.05, left=.075, right=.925 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1470
         #canvas.fig.tight_layout()
1494
         #canvas.fig.tight_layout()
1471
         #canvas.draw()
1495
         #canvas.draw()
1472
-        canvas.fig.subplots_adjust(hspace=.15, wspace=.05, left=.075, right=.95, bottom=.1, top=.95 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1496
+        canvas.fig.subplots_adjust(hspace=.15, wspace=.05, left=.15, right=.9, bottom=.1, top=.9 )#left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 
1473
         tick_locator = MaxNLocator(nbins=5)
1497
         tick_locator = MaxNLocator(nbins=5)
1474
 
1498
 
1475
-        cb1 = canvas.fig.colorbar(im1, ax=axes[0::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30)
1476
-        cb1.ax.tick_params(axis='both', which='major', labelsize=8)
1477
-        cb1.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
1499
+        cb1 = canvas.fig.colorbar(im1, ax=axes[0::2], format='%1.0f', orientation='horizontal', shrink=.35, aspect=30)
1500
+        cb1.ax.tick_params(axis='both', which='major', labelsize=fs)
1501
+        cb1.set_label("$\mathcal{V}_N$ (nV)", fontsize=fs)
1478
         #cb1.locator = tick_locator
1502
         #cb1.locator = tick_locator
1479
         #cb1.update_ticks()
1503
         #cb1.update_ticks()
1480
 
1504
 
1481
         if phase != 2:
1505
         if phase != 2:
1482
-            cb2 = canvas.fig.colorbar(im2, ax=axes[1::2], format='%1.0e', orientation='horizontal', shrink=.35, aspect=30, pad=.2)
1483
-            cb2.ax.tick_params(axis='both', which='major', labelsize=8)
1484
-            cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=8)
1506
+            cb2 = canvas.fig.colorbar(im2, ax=axes[1::2], format='%1.0f', orientation='horizontal', shrink=.35, aspect=30, pad=.2)
1507
+            cb2.ax.tick_params(axis='both', which='major', labelsize=fs)
1508
+            cb2.set_label("$\mathcal{V}_N$ (nV)", fontsize=fs)
1485
 
1509
 
1486
             cb2.locator = tick_locator
1510
             cb2.locator = tick_locator
1487
             cb2.update_ticks()
1511
             cb2.update_ticks()
1652
                     self.DATADICT[pulse]["qeff"][ipm][istack] = qeff
1676
                     self.DATADICT[pulse]["qeff"][ipm][istack] = qeff
1653
                     self.DATADICT[pulse]["q_nu"][ipm][istack] = v
1677
                     self.DATADICT[pulse]["q_nu"][ipm][istack] = v
1654
                     iistack += 1
1678
                     iistack += 1
1655
-
1656
-                canvas.ax1.set_xlabel("time (ms)", fontsize=8)
1657
-                canvas.ax1.set_ylabel("current (A)", fontsize=8)
1658
-                canvas.draw()
1659
-
1679
+                #canvas.draw()
1660
                         
1680
                         
1661
                 percent = int(1e2* (float)((istack)+ipm*self.DATADICT["nPulseMoments"]) / 
1681
                 percent = int(1e2* (float)((istack)+ipm*self.DATADICT["nPulseMoments"]) / 
1662
                                    (float)(len(self.DATADICT["PULSES"])*self.DATADICT["nPulseMoments"]*nstack))
1682
                                    (float)(len(self.DATADICT["PULSES"])*self.DATADICT["nPulseMoments"]*nstack))
1663
                 self.progressTrigger.emit(percent)
1683
                 self.progressTrigger.emit(percent)
1664
 
1684
 
1665
-            canvas.draw()
1666
-
1685
+            canvas.ax1.set_xlabel("time (ms)", fontsize=10)
1686
+            canvas.ax1.set_ylabel("current (A)", fontsize=10)
1687
+            #canvas.draw()
1667
 
1688
 
1668
         self.plotQeffNu(cv, canvas.ax2)
1689
         self.plotQeffNu(cv, canvas.ax2)
1690
+
1691
+        deSpine(canvas.ax1)        
1692
+        deSpine(canvas.ax2)        
1693
+
1694
+        canvas.fig.tight_layout()
1669
         canvas.draw()
1695
         canvas.draw()
1670
         self.doneTrigger.emit() 
1696
         self.doneTrigger.emit() 
1671
 
1697
 
1700
                     self.progressTrigger.emit(percent)
1726
                     self.progressTrigger.emit(percent)
1701
                     istack += 1
1727
                     istack += 1
1702
             iFID += 1
1728
             iFID += 1
1703
-        ax.set_xlabel(r"pulse moment index", fontsize=8)
1704
-        ax.set_ylabel(r"$q_{eff}$ [A$\cdot$sec]", fontsize=8)
1729
+        ax.set_xlabel(r"pulse moment index", fontsize=10)
1730
+        ax.set_ylabel(r"$q_{eff}$ (A$\cdot$sec)", fontsize=10)
1705
         ax.set_yscale('log')
1731
         ax.set_yscale('log')
1706
         ax.set_xlim(0, ax.get_xlim()[1])
1732
         ax.set_xlim(0, ax.get_xlim()[1])
1707
-        ax.legend(loc='upper right', scatterpoints = 1, prop={'size':6})
1733
+        ax.legend(loc='upper right', scatterpoints = 1, prop={'size':10})
1708
 
1734
 
1709
     def enableDSP(self):
1735
     def enableDSP(self):
1710
         self.enableDSPTrigger.emit() 
1736
         self.enableDSPTrigger.emit() 
1800
                             self.DATADICT[pulse][ichan][ipm][istack] = e[::-1]
1826
                             self.DATADICT[pulse][ichan][ipm][istack] = e[::-1]
1801
                            
1827
                            
1802
      
1828
      
1803
-                        canvas.ax1.plot( H[pulse][ichan].reshape(-1, len(RX)) ) # , label="taps") 
1829
+                        #canvas.ax1.plot( H[pulse][ichan].reshape(-1, len(RX)) ) # , label="taps") 
1830
+                        canvas.ax1.plot( H[pulse][ichan][::-1].reshape(M, len(RX), order='F' ) ) #.reshape(-1, len(RX)) ) # , label="taps") 
1804
 
1831
 
1805
-                        canvas.ax2.legend(prop={'size':6}, loc='upper right')
1832
+                        canvas.ax2.legend(prop={'size':10}, loc='upper right')
1806
                         #canvas.ax2.legend(prop={'size':6}, loc='upper right')
1833
                         #canvas.ax2.legend(prop={'size':6}, loc='upper right')
1807
 
1834
 
1808
                         mh = np.max(np.abs( H[pulse][ichan] ))
1835
                         mh = np.max(np.abs( H[pulse][ichan] ))
1809
                         canvas.ax1.set_ylim( -mh, mh )
1836
                         canvas.ax1.set_ylim( -mh, mh )
1810
 
1837
 
1811
-                        canvas.ax2.set_xlabel(r"time [s]", fontsize=8)
1812
-                        canvas.ax2.set_ylabel(r"signal [nV]", fontsize=8)
1838
+                        canvas.ax2.set_xlabel(r"time (s)", fontsize=10)
1839
+                        canvas.ax2.set_ylabel(r"signal (nV)", fontsize=10)
1840
+
1841
+                        canvas.ax1.set_xlabel(r"filter tap index", fontsize=10)
1842
+                        canvas.ax1.set_ylabel(r"tap amplitude", fontsize=10)
1813
 
1843
 
1814
-                        canvas.ax1.set_xlabel(r"filter index", fontsize=8)
1815
-                        canvas.ax1.set_ylabel(r"scale factor", fontsize=8)
1844
+                    canvas.fig.tight_layout()
1845
+                    deSpine(canvas.ax1)
1846
+                    deSpine(canvas.ax2)
1816
 
1847
 
1817
                     canvas.draw()
1848
                     canvas.draw()
1818
 
1849
 
2127
         """
2158
         """
2128
         
2159
         
2129
         if plot:
2160
         if plot:
2161
+            fs = 10
2130
             canvas.reAx2()
2162
             canvas.reAx2()
2131
-            canvas.ax1.set_ylabel(r"signal [nV]", fontsize=8)
2132
-            canvas.ax2.set_xlabel(r"time [s]", fontsize=8)
2133
-            canvas.ax2.set_ylabel(r"signal [nV]", fontsize=8)
2163
+            canvas.ax1.set_ylabel(r"signal (nV)", fontsize=fs)
2164
+            canvas.ax2.set_xlabel(r"time (s)", fontsize=fs)
2165
+            canvas.ax2.set_ylabel(r"signal (nV)", fontsize=fs)
2134
 
2166
 
2135
         self.samp /= dec
2167
         self.samp /= dec
2136
         self.dt   = 1./self.samp       
2168
         self.dt   = 1./self.samp       
2168
                         for ichan in self.DATADICT[pulse]["rchan"]:
2200
                         for ichan in self.DATADICT[pulse]["rchan"]:
2169
                             canvas.ax1.plot( RSTIMES, 1e9*self.DATADICT[pulse][ichan][ipm][istack], \
2201
                             canvas.ax1.plot( RSTIMES, 1e9*self.DATADICT[pulse][ichan][ipm][istack], \
2170
                                 label = pulse + " ipm=" + str(ipm) + " istack=" + str(istack) + " ichan="  + str(ichan))
2202
                                 label = pulse + " ipm=" + str(ipm) + " istack=" + str(istack) + " ichan="  + str(ichan))
2171
-                        canvas.ax1.legend(prop={'size':6}, loc='upper right')
2172
-                        canvas.ax2.legend(prop={'size':6}, loc='upper right')
2203
+                        canvas.ax1.legend(prop={'size':fs}, loc='upper right')
2204
+                        canvas.ax2.legend(prop={'size':fs}, loc='upper right')
2205
+                   
2206
+                        deSpine( canvas.ax1 ) 
2207
+                        deSpine( canvas.ax2 ) 
2208
+                        plt.setp(canvas.ax1.get_xticklabels(), visible=False)
2209
+                        canvas.fig.tight_layout()
2173
                         canvas.draw() 
2210
                         canvas.draw() 
2211
+
2174
                 percent = (int)(1e2*((float)(iFID*self.DATADICT["nPulseMoments"]+(ipm))/( len(self.DATADICT["PULSES"])*self.nPulseMoments)))
2212
                 percent = (int)(1e2*((float)(iFID*self.DATADICT["nPulseMoments"]+(ipm))/( len(self.DATADICT["PULSES"])*self.nPulseMoments)))
2175
                 self.progressTrigger.emit(percent)
2213
                 self.progressTrigger.emit(percent)
2176
             iFID += 1  
2214
             iFID += 1  
2569
                     for ichan in rchan:
2607
                     for ichan in rchan:
2570
                         canvas.ax2.plot(self.DATADICT["Pulse 1"]["TIMES"], self.DATADICT["Pulse 1"][ichan][ipm][istack], label="Pulse 1 FID ref ch. "+str(ichan)) #, color='blue')
2608
                         canvas.ax2.plot(self.DATADICT["Pulse 1"]["TIMES"], self.DATADICT["Pulse 1"][ichan][ipm][istack], label="Pulse 1 FID ref ch. "+str(ichan)) #, color='blue')
2571
 
2609
 
2572
-                    canvas.ax3.legend(prop={'size':6}, loc='upper right')
2573
-                    canvas.ax2.legend(prop={'size':6}, loc='upper right')
2610
+                    # reference axis
2611
+                    canvas.ax2.tick_params(axis='both', which='major', labelsize=10)
2612
+                    canvas.ax2.tick_params(axis='both', which='minor', labelsize=10)
2613
+                    #canvas.ax2.xaxis.set_ticklabels([])
2614
+                    plt.setp(canvas.ax2.get_xticklabels(), visible=False)
2615
+                    canvas.ax2.legend(prop={'size':10}, loc='upper right')
2616
+                    canvas.ax2.set_title("stack "+str(istack)+" pulse index " + str(ipm), fontsize=10)
2617
+                    canvas.ax2.set_ylabel("RAW signal [V]", fontsize=10)
2574
 
2618
 
2575
-                    canvas.ax1.set_ylabel("Current [A]", fontsize=8) 
2619
+
2620
+                    canvas.ax1.set_ylabel("Current (A)", fontsize=10) 
2576
                     canvas.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y') 
2621
                     canvas.ax1.ticklabel_format(style='sci', scilimits=(0,0), axis='y') 
2577
-                    canvas.ax1.set_xlabel("time [s]", fontsize=8)
2578
-                    
2579
-                    canvas.ax2.set_title("stack "+str(istack)+" pulse index " + str(ipm), fontsize=8)
2580
-                    canvas.ax2.set_ylabel("RAW signal [V]", fontsize=8)
2581
-                    canvas.ax3.set_ylabel("RAW signal [V]", fontsize=8)
2582
-                    canvas.ax2.tick_params(axis='both', which='major', labelsize=8)
2583
-                    canvas.ax2.tick_params(axis='both', which='minor', labelsize=6)
2622
+                    canvas.ax1.set_xlabel("time (s)", fontsize=10)
2584
 
2623
 
2624
+                    canvas.ax3.legend(prop={'size':10}, loc='upper right')
2625
+                    canvas.ax3.set_ylabel("RAW signal [V]", fontsize=10)
2626
+                    
2627
+                    canvas.fig.tight_layout()
2585
                     canvas.draw()
2628
                     canvas.draw()
2586
 
2629
 
2587
             percent = (int) (1e2*((float)((iistack*self.nPulseMoments+ipm+1))  / (len(procStacks)*self.nPulseMoments)))
2630
             percent = (int) (1e2*((float)((iistack*self.nPulseMoments+ipm+1))  / (len(procStacks)*self.nPulseMoments)))

+ 1
- 1
setup.py View File

21
     long_description = fh.read()
21
     long_description = fh.read()
22
 
22
 
23
 setup(name='Akvo',
23
 setup(name='Akvo',
24
-      version='1.4.2',
24
+      version='1.4.3',
25
       python_requires='>3.7.0', # due to pyLemma
25
       python_requires='>3.7.0', # due to pyLemma
26
       description='Surface nuclear magnetic resonance workbench',
26
       description='Surface nuclear magnetic resonance workbench',
27
       long_description=long_description,
27
       long_description=long_description,

Loading…
Cancel
Save