Ver código fonte

Support for off-resonance pulses was added, additionally file name changes have been put into place to better differentiate kernal and data files. Other bug fixes to .dmp files have been made, although .dmp file are still not robust for late stage processing.

tags/1.6.1
Trevor Irons 3 anos atrás
pai
commit
f6f79fcefc
6 arquivos alterados com 358 adições e 210 exclusões
  1. 127
    102
      akvo/gui/addFigure8Loop.ui
  2. 123
    31
      akvo/gui/akvoGUI.py
  3. 100
    69
      akvo/gui/main.ui
  4. 2
    2
      akvo/terminal/plotKernelDiff.py
  5. 4
    4
      akvo/tressel/mrsurvey.py
  6. 2
    2
      setup.py

+ 127
- 102
akvo/gui/addFigure8Loop.ui Ver arquivo

7
     <x>0</x>
7
     <x>0</x>
8
     <y>0</y>
8
     <y>0</y>
9
     <width>400</width>
9
     <width>400</width>
10
-    <height>456</height>
10
+    <height>499</height>
11
    </rect>
11
    </rect>
12
   </property>
12
   </property>
13
   <property name="windowTitle">
13
   <property name="windowTitle">
14
    <string>Dialog</string>
14
    <string>Dialog</string>
15
   </property>
15
   </property>
16
   <layout class="QGridLayout" name="gridLayout">
16
   <layout class="QGridLayout" name="gridLayout">
17
-   <item row="12" column="2">
18
-    <widget class="QDoubleSpinBox" name="doubleSpinBox_3"/>
17
+   <item row="10" column="0">
18
+    <widget class="QLabel" name="label_4">
19
+     <property name="text">
20
+      <string>radius  (m)</string>
21
+     </property>
22
+    </widget>
23
+   </item>
24
+   <item row="0" column="2">
25
+    <widget class="QDoubleSpinBox" name="centreNorth1">
26
+     <property name="minimum">
27
+      <double>-999999999.000000000000000</double>
28
+     </property>
29
+     <property name="maximum">
30
+      <double>9999999999.000000000000000</double>
31
+     </property>
32
+    </widget>
19
    </item>
33
    </item>
20
    <item row="7" column="0">
34
    <item row="7" column="0">
21
     <widget class="QLabel" name="label_8">
35
     <widget class="QLabel" name="label_8">
24
      </property>
38
      </property>
25
     </widget>
39
     </widget>
26
    </item>
40
    </item>
27
-   <item row="14" column="2">
28
-    <widget class="QSpinBox" name="segments">
29
-     <property name="toolTip">
30
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Currently Akvo/Merlin calculates circular loops using segments of wire, forming a polygon. Analytic circular loops may be added in the future. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
31
-     </property>
32
-     <property name="minimum">
33
-      <number>5</number>
34
-     </property>
35
-     <property name="maximum">
36
-      <number>200</number>
41
+   <item row="5" column="0">
42
+    <widget class="Line" name="line">
43
+     <property name="orientation">
44
+      <enum>Qt::Horizontal</enum>
37
      </property>
45
      </property>
38
-     <property name="value">
39
-      <number>15</number>
46
+    </widget>
47
+   </item>
48
+   <item row="8" column="0">
49
+    <widget class="Line" name="line_5">
50
+     <property name="orientation">
51
+      <enum>Qt::Horizontal</enum>
40
      </property>
52
      </property>
41
     </widget>
53
     </widget>
42
    </item>
54
    </item>
43
    <item row="10" column="2">
55
    <item row="10" column="2">
44
-    <widget class="QDoubleSpinBox" name="loopHeight">
56
+    <widget class="QDoubleSpinBox" name="loopRadius">
45
      <property name="toolTip">
57
      <property name="toolTip">
46
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Akvo uses a positive down convention, a slight negative value to the loop height improves numerical stability using digital filtering hankel transforms. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
47
-     </property>
48
-     <property name="decimals">
49
-      <number>3</number>
58
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Radius of the loop&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
50
      </property>
59
      </property>
51
      <property name="minimum">
60
      <property name="minimum">
52
-      <double>-99.000000000000000</double>
61
+      <double>0.100000000000000</double>
62
+     </property>
63
+     <property name="maximum">
64
+      <double>600.000000000000000</double>
53
      </property>
65
      </property>
54
      <property name="value">
66
      <property name="value">
55
-      <double>-0.001000000000000</double>
67
+      <double>50.000000000000000</double>
56
      </property>
68
      </property>
57
     </widget>
69
     </widget>
58
    </item>
70
    </item>
59
-   <item row="13" column="0">
60
-    <widget class="QLabel" name="label_6">
61
-     <property name="text">
62
-      <string>turns</string>
71
+   <item row="17" column="2">
72
+    <widget class="QDialogButtonBox" name="buttonBox">
73
+     <property name="orientation">
74
+      <enum>Qt::Horizontal</enum>
75
+     </property>
76
+     <property name="standardButtons">
77
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
63
      </property>
78
      </property>
64
     </widget>
79
     </widget>
65
    </item>
80
    </item>
66
-   <item row="6" column="2">
67
-    <widget class="QDoubleSpinBox" name="centreNorth2"/>
68
-   </item>
69
-   <item row="8" column="1">
70
-    <widget class="Line" name="line_4">
81
+   <item row="5" column="2">
82
+    <widget class="Line" name="line_2">
71
      <property name="orientation">
83
      <property name="orientation">
72
       <enum>Qt::Horizontal</enum>
84
       <enum>Qt::Horizontal</enum>
73
      </property>
85
      </property>
74
     </widget>
86
     </widget>
75
    </item>
87
    </item>
76
-   <item row="5" column="0">
77
-    <widget class="Line" name="line">
88
+   <item row="8" column="1">
89
+    <widget class="Line" name="line_4">
78
      <property name="orientation">
90
      <property name="orientation">
79
       <enum>Qt::Horizontal</enum>
91
       <enum>Qt::Horizontal</enum>
80
      </property>
92
      </property>
81
     </widget>
93
     </widget>
82
    </item>
94
    </item>
83
-   <item row="1" column="2">
84
-    <widget class="QDoubleSpinBox" name="centreEast1">
85
-     <property name="minimum">
86
-      <double>-99999999.000000000000000</double>
87
-     </property>
88
-     <property name="maximum">
89
-      <double>99999999.989999994635582</double>
95
+   <item row="11" column="0">
96
+    <widget class="QLabel" name="label_3">
97
+     <property name="text">
98
+      <string>height (m)</string>
90
      </property>
99
      </property>
91
     </widget>
100
     </widget>
92
    </item>
101
    </item>
93
-   <item row="12" column="0">
94
-    <widget class="QLabel" name="label_9">
102
+   <item row="9" column="0" colspan="2">
103
+    <widget class="QLabel" name="label_10">
95
      <property name="text">
104
      <property name="text">
96
-      <string>TextLabel</string>
105
+      <string>current flow in loop 1</string>
97
      </property>
106
      </property>
98
     </widget>
107
     </widget>
99
    </item>
108
    </item>
104
      </property>
113
      </property>
105
     </widget>
114
     </widget>
106
    </item>
115
    </item>
107
-   <item row="8" column="2">
108
-    <widget class="Line" name="line_3">
109
-     <property name="orientation">
110
-      <enum>Qt::Horizontal</enum>
116
+   <item row="13" column="2">
117
+    <widget class="QSpinBox" name="loopTurns">
118
+     <property name="minimum">
119
+      <number>1</number>
120
+     </property>
121
+     <property name="maximum">
122
+      <number>100000</number>
111
      </property>
123
      </property>
112
     </widget>
124
     </widget>
113
    </item>
125
    </item>
114
-   <item row="0" column="0">
115
-    <widget class="QLabel" name="label">
116
-     <property name="text">
117
-      <string>centre northing 1 (m)</string>
126
+   <item row="11" column="2">
127
+    <widget class="QDoubleSpinBox" name="loopHeight">
128
+     <property name="toolTip">
129
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Akvo uses a positive down convention, a slight negative value to the loop height improves numerical stability using digital filtering hankel transforms. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
130
+     </property>
131
+     <property name="decimals">
132
+      <number>3</number>
133
+     </property>
134
+     <property name="minimum">
135
+      <double>-99.000000000000000</double>
136
+     </property>
137
+     <property name="value">
138
+      <double>-0.001000000000000</double>
118
      </property>
139
      </property>
119
     </widget>
140
     </widget>
120
    </item>
141
    </item>
125
      </property>
146
      </property>
126
     </widget>
147
     </widget>
127
    </item>
148
    </item>
128
-   <item row="14" column="0">
129
-    <widget class="QLabel" name="label_5">
130
-     <property name="text">
131
-      <string>segments</string>
132
-     </property>
133
-    </widget>
134
-   </item>
135
-   <item row="17" column="2">
136
-    <widget class="QDialogButtonBox" name="buttonBox">
149
+   <item row="8" column="2">
150
+    <widget class="Line" name="line_3">
137
      <property name="orientation">
151
      <property name="orientation">
138
       <enum>Qt::Horizontal</enum>
152
       <enum>Qt::Horizontal</enum>
139
      </property>
153
      </property>
140
-     <property name="standardButtons">
141
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
142
-     </property>
143
     </widget>
154
     </widget>
144
    </item>
155
    </item>
145
-   <item row="5" column="2">
146
-    <widget class="Line" name="line_2">
147
-     <property name="orientation">
148
-      <enum>Qt::Horizontal</enum>
156
+   <item row="7" column="2">
157
+    <widget class="QDoubleSpinBox" name="centreEast2">
158
+     <property name="minimum">
159
+      <double>-9999999999.000000000000000</double>
160
+     </property>
161
+     <property name="maximum">
162
+      <double>9999999999.000000000000000</double>
149
      </property>
163
      </property>
150
     </widget>
164
     </widget>
151
    </item>
165
    </item>
152
-   <item row="7" column="2">
153
-    <widget class="QDoubleSpinBox" name="centreEast2"/>
154
-   </item>
155
-   <item row="10" column="0">
156
-    <widget class="QLabel" name="label_3">
166
+   <item row="14" column="0">
167
+    <widget class="QLabel" name="label_5">
157
      <property name="text">
168
      <property name="text">
158
-      <string>height (m)</string>
169
+      <string>segments</string>
159
      </property>
170
      </property>
160
     </widget>
171
     </widget>
161
    </item>
172
    </item>
162
-   <item row="0" column="2">
163
-    <widget class="QDoubleSpinBox" name="centreNorth1">
164
-     <property name="minimum">
165
-      <double>-999999999.000000000000000</double>
166
-     </property>
167
-     <property name="maximum">
168
-      <double>9999999999.000000000000000</double>
173
+   <item row="0" column="0">
174
+    <widget class="QLabel" name="label">
175
+     <property name="text">
176
+      <string>centre northing 1 (m)</string>
169
      </property>
177
      </property>
170
     </widget>
178
     </widget>
171
    </item>
179
    </item>
172
-   <item row="13" column="2">
173
-    <widget class="QSpinBox" name="loopTurns">
180
+   <item row="14" column="2">
181
+    <widget class="QSpinBox" name="segments">
182
+     <property name="toolTip">
183
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Currently Akvo/Merlin calculates circular loops using segments of wire, forming a polygon. Analytic circular loops may be added in the future. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
184
+     </property>
174
      <property name="minimum">
185
      <property name="minimum">
175
-      <number>1</number>
186
+      <number>5</number>
176
      </property>
187
      </property>
177
      <property name="maximum">
188
      <property name="maximum">
178
-      <number>100000</number>
189
+      <number>200</number>
190
+     </property>
191
+     <property name="value">
192
+      <number>15</number>
179
      </property>
193
      </property>
180
     </widget>
194
     </widget>
181
    </item>
195
    </item>
182
-   <item row="8" column="0">
183
-    <widget class="Line" name="line_5">
184
-     <property name="orientation">
185
-      <enum>Qt::Horizontal</enum>
186
-     </property>
196
+   <item row="9" column="2">
197
+    <widget class="QComboBox" name="cwiseBox">
198
+     <item>
199
+      <property name="text">
200
+       <string>clockwise</string>
201
+      </property>
202
+     </item>
203
+     <item>
204
+      <property name="text">
205
+       <string>anti-clockwise</string>
206
+      </property>
207
+     </item>
187
     </widget>
208
     </widget>
188
    </item>
209
    </item>
189
-   <item row="9" column="0">
190
-    <widget class="QLabel" name="label_4">
191
-     <property name="text">
192
-      <string>radius  (m)</string>
210
+   <item row="6" column="2">
211
+    <widget class="QDoubleSpinBox" name="centreNorth2">
212
+     <property name="minimum">
213
+      <double>-9999999999.000000000000000</double>
214
+     </property>
215
+     <property name="maximum">
216
+      <double>99999999999.000000000000000</double>
193
      </property>
217
      </property>
194
     </widget>
218
     </widget>
195
    </item>
219
    </item>
196
-   <item row="9" column="2">
197
-    <widget class="QDoubleSpinBox" name="loopRadius">
198
-     <property name="toolTip">
199
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Radius of the loop&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
200
-     </property>
220
+   <item row="1" column="2">
221
+    <widget class="QDoubleSpinBox" name="centreEast1">
201
      <property name="minimum">
222
      <property name="minimum">
202
-      <double>0.100000000000000</double>
223
+      <double>-99999999.000000000000000</double>
203
      </property>
224
      </property>
204
      <property name="maximum">
225
      <property name="maximum">
205
-      <double>600.000000000000000</double>
226
+      <double>99999999.989999994635582</double>
206
      </property>
227
      </property>
207
-     <property name="value">
208
-      <double>50.000000000000000</double>
228
+    </widget>
229
+   </item>
230
+   <item row="13" column="0">
231
+    <widget class="QLabel" name="label_6">
232
+     <property name="text">
233
+      <string>turns</string>
209
      </property>
234
      </property>
210
     </widget>
235
     </widget>
211
    </item>
236
    </item>

+ 123
- 31
akvo/gui/akvoGUI.py Ver arquivo

8
 import time
8
 import time
9
 import os
9
 import os
10
 from copy import deepcopy
10
 from copy import deepcopy
11
-from matplotlib.backends.backend_qt4 import NavigationToolbar2QT #as NavigationToolbar
11
+from matplotlib.backends.backend_qt5 import NavigationToolbar2QT #as NavigationToolbar
12
 import datetime, time
12
 import datetime, time
13
 import pkg_resources  # part of setuptools
13
 import pkg_resources  # part of setuptools
14
 from collections import OrderedDict
14
 from collections import OrderedDict
28
 from pyLemma import Merlin
28
 from pyLemma import Merlin
29
 
29
 
30
 VERSION = pkg_resources.require("Akvo")[0].version
30
 VERSION = pkg_resources.require("Akvo")[0].version
31
+GAMMAH = 42.577478518 * 1e-3  # Hz nT
31
 
32
 
32
 # Writes out numpy arrays into Eigen vectors as serialized by Lemma
33
 # Writes out numpy arrays into Eigen vectors as serialized by Lemma
33
 class MatrixXr(yaml.YAMLObject):
34
 class MatrixXr(yaml.YAMLObject):
166
         self.ui.plotGI.setEnabled(False) 
167
         self.ui.plotGI.setEnabled(False) 
167
         self.ui.plotGI.pressed.connect( self.plotGI )
168
         self.ui.plotGI.pressed.connect( self.plotGI )
168
 
169
 
170
+        # balance the Larmor frequency info and Tx off resonance info
171
+        self.ui.intensitySpinBox.valueChanged.connect( self.adjustLarmor )
172
+        self.ui.txv.valueChanged.connect( self.adjustB0 )
173
+        self.ui.larmorv.valueChanged.connect( self.adjustB02 )
174
+
169
         # Kernel         
175
         # Kernel         
170
         self.ui.calcK0.pressed.connect( self.calcK0 )       
176
         self.ui.calcK0.pressed.connect( self.calcK0 )       
171
 
177
 
286
             self.ui.lcdHNF2.setEnabled(False)
292
             self.ui.lcdHNF2.setEnabled(False)
287
             self.ui.lcdf0NK2.setEnabled(False)
293
             self.ui.lcdf0NK2.setEnabled(False)
288
 
294
 
295
+    def adjustLarmor(self):
296
+        """ Triggers when the B0 intensity spin box is cycled
297
+        """
298
+        self.ui.larmorv.setValue( self.ui.intensitySpinBox.value() * GAMMAH )
299
+        self.ui.txv.setValue( self.RAWDataProc.transFreq - self.ui.larmorv.value() )
300
+
301
+    def adjustB0(self):
302
+        """ Triggers when tx frequency offset is cycled
303
+        """
304
+        self.ui.intensitySpinBox.setValue( (self.RAWDataProc.transFreq - self.ui.txv.value()) / GAMMAH )
305
+    
306
+    def adjustB02(self):
307
+        """ Triggers when Larmor frequency spin box is cycled o
308
+        """
309
+        self.ui.intensitySpinBox.setValue( (self.ui.larmorv.value()) / GAMMAH )
310
+
289
     def closeTabs(self):
311
     def closeTabs(self):
290
         #self.ui.ProcTabs.removeTab(idx)    
312
         #self.ui.ProcTabs.removeTab(idx)    
291
         self.ui.ProcTabs.clear( )    
313
         self.ui.ProcTabs.clear( )    
338
         except IOError as e:
360
         except IOError as e:
339
             fpath = '.'
361
             fpath = '.'
340
         
362
         
341
-        self.akvoDataFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Datafile File', fpath, r"Akvo datafiles (*.yaml)")[0]
363
+        self.akvoDataFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Datafile File', fpath, r"Akvo datafiles (*.akvoProcData *.yaml)")[0]
342
         self.ui.dataText.clear()   
364
         self.ui.dataText.clear()   
343
         self.ui.dataText.append( self.akvoDataFile )   
365
         self.ui.dataText.append( self.akvoDataFile )   
344
     
366
     
350
         except IOError as e:
372
         except IOError as e:
351
             fpath = '.'
373
             fpath = '.'
352
         
374
         
353
-        self.K0akvoDataFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Datafile File', fpath, r"Akvo datafiles (*.yaml)")[0]
354
-        self.ui.K0DataText.clear()   
355
-        self.ui.K0DataText.append( self.K0akvoDataFile )  
375
+        self.K0akvoDataFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Datafile File', fpath, r"Akvo datafiles (*.akvoProcData *.yaml)")[0]
356
 
376
 
357
         # populate combo box with loops 
377
         # populate combo box with loops 
358
-
359
-        with open(self.K0akvoDataFile) as f:
360
-            parse = yaml.load( f, Loader=yaml.Loader )
361
-        
362
-        self.ui.txListWidget.clear()
363
-        self.ui.rxListWidget.clear()
364
-        for loop in parse.META["Loops"]:
365
-            print(loop)
366
-            self.ui.txListWidget.addItem( parse.META["Loops"][loop] )
367
-            self.ui.rxListWidget.addItem( parse.META["Loops"][loop] )
368
-            
369
-        self.ui.txListWidget.setCurrentRow(0)
370
-        self.ui.rxListWidget.setCurrentRow(0)
378
+        if os.path.isfile( self.K0akvoDataFile ): 
379
+        
380
+            self.ui.K0DataText.clear()   
381
+            self.ui.K0DataText.append( self.K0akvoDataFile )  
382
+
383
+            with open(self.K0akvoDataFile) as f:
384
+                parse = yaml.load( f, Loader=yaml.Loader )
385
+        
386
+            self.ui.txListWidget.clear()
387
+            self.ui.rxListWidget.clear()
388
+            for loop in parse.META["Loops"]:
389
+                print(loop)
390
+                self.ui.txListWidget.addItem( parse.META["Loops"][loop] )
391
+                self.ui.rxListWidget.addItem( parse.META["Loops"][loop] )
392
+           
393
+            # TODO, why are these necessary 
394
+            self.ui.txListWidget.setCurrentRow(0)
395
+            self.ui.rxListWidget.setCurrentRow(0)
396
+        # else do nothing
371
          
397
          
372
- 
373
     def invKernelSelect(self):
398
     def invKernelSelect(self):
374
         try:
399
         try:
375
             with open('.akvo.last.path') as f: 
400
             with open('.akvo.last.path') as f: 
378
         except IOError as e:
403
         except IOError as e:
379
             fpath = '.'
404
             fpath = '.'
380
         
405
         
381
-        self.K0file = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Kernel File', fpath, r"Akvo kernels (*.yml)")[0]
406
+        self.K0file = QtWidgets.QFileDialog.getOpenFileName(self, 'Select Kernel File', fpath, r"Akvo kernels (*.akvoK0)")[0]
382
         self.ui.kernelText.clear()   
407
         self.ui.kernelText.clear()   
383
         self.ui.kernelText.append(self.K0file)   
408
         self.ui.kernelText.append(self.K0file)   
384
     
409
     
455
             rxCoils.append(rxCoil.text())
480
             rxCoils.append(rxCoil.text())
456
 
481
 
457
 
482
 
458
-        saveStr = QtWidgets.QFileDialog.getSaveFileName(self, "Save kernel as", fpath, r"Merlin KernelV0 (*.yml)")[0] 
483
+        saveStr = QtWidgets.QFileDialog.getSaveFileName(self, "Save kernel as", fpath, r"Merlin KernelV0 (*.akvoK0)")[0] 
459
 
484
 
460
         intDict = dict()
485
         intDict = dict()
461
         intDict["origin_n"] = self.ui.originN.value()
486
         intDict["origin_n"] = self.ui.originN.value()
554
                     points = np.linspace(0, 2*np.pi, dialog.ui.segments.value()+1)
579
                     points = np.linspace(0, 2*np.pi, dialog.ui.segments.value()+1)
555
                     for iseg, ipt in enumerate(points):
580
                     for iseg, ipt in enumerate(points):
556
                         if cwise == 0:
581
                         if cwise == 0:
557
-                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, (  cn+rad*np.sin(ipt), ce+rad*np.cos(ipt), ht) )
582
+                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, ( cn+rad*np.sin(ipt), ce+rad*np.cos(ipt), ht) )
558
                         else:
583
                         else:
559
-                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, ( -cn+rad*np.sin(ipt), ce+rad*np.cos(ipt), ht) )
584
+                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, ( cn-rad*np.sin(ipt), ce+rad*np.cos(ipt), ht) )
560
                     self.loops[self.ui.loopLabel.text()].SetNumberOfFrequencies(1)
585
                     self.loops[self.ui.loopLabel.text()].SetNumberOfFrequencies(1)
561
                     self.loops[self.ui.loopLabel.text()].SetCurrent(1.)
586
                     self.loops[self.ui.loopLabel.text()].SetCurrent(1.)
562
             
587
             
576
                     rad = dialog.ui.loopRadius.value()
601
                     rad = dialog.ui.loopRadius.value()
577
                     turns = dialog.ui.loopTurns.value()
602
                     turns = dialog.ui.loopTurns.value()
578
                     ns = dialog.ui.segments.value()
603
                     ns = dialog.ui.segments.value()
579
-                    #cwise = dialog.ui.cwiseBox.currentIndex()
580
-                    print(cn1, ce1, cn2, ce2, ht, rad, turns, ns)   
604
+                    cwise = dialog.ui.cwiseBox.currentIndex()
605
+
606
+                    self.loops[self.ui.loopLabel.text()] = FDEM1D.PolygonalWireAntenna()
607
+                    self.loops[self.ui.loopLabel.text()].SetNumberOfPoints( 2*dialog.ui.segments.value() + 1 )
608
+                    self.loops[self.ui.loopLabel.text()].SetNumberOfTurns( dialog.ui.loopTurns.value() )
609
+
610
+                    # first loop
611
+                    points = np.linspace(0, 2*np.pi, dialog.ui.segments.value())
612
+                    ptsL = []
613
+                    for iseg, ipt in enumerate(points):
614
+                        ptsL.append( np.array( [cn1+rad*np.sin(ipt), ce1+rad*np.cos(ipt)]  ))
615
+                    lenP = len(points)
616
+                    
617
+                    # search for closest point, ugly and not efficient, but it's not critical here 
618
+                    closest = 1e8
619
+                    iclosest = -1
620
+                    for iseg, ipt in enumerate(points):
621
+                        p2 = np.array([cn2-rad*np.sin(ipt), ce2-rad*np.cos(ipt)])
622
+                        for p1 in ptsL:
623
+                            dist = np.linalg.norm(p1-p2)
624
+                            if dist < closest:
625
+                                closest = dist
626
+                                iclosest = iseg
627
+
628
+                    points = np.concatenate([points[iclosest::],points[0:iclosest]])
629
+                    point1 = False
630
+                    for iseg, ipt in enumerate(points):
631
+                        if cwise == 0:
632
+                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, ( cn1+rad*np.sin(ipt), ce1+rad*np.cos(ipt), ht) )
633
+                            if not point1:
634
+                                point1 = ( cn1+rad*np.sin(ipt), ce1+rad*np.cos(ipt), ht) 
635
+                        else:
636
+                            self.loops[self.ui.loopLabel.text()].SetPoint(iseg, ( cn1-rad*np.sin(ipt), ce1+rad*np.cos(ipt), ht) )
637
+                            if not point1:
638
+                                point1 = ( cn1-rad*np.sin(ipt), ce1+rad*np.cos(ipt), ht) 
639
+
640
+                    lenP = len(points)
641
+
642
+                    # fill 
643
+                    for iseg, ipt in enumerate(points):
644
+                        if cwise == 0:
645
+                            self.loops[self.ui.loopLabel.text()].SetPoint(lenP+iseg, ( cn2-rad*np.cos(ipt), ce2-rad*np.sin(ipt), ht) )
646
+                        else:
647
+                            self.loops[self.ui.loopLabel.text()].SetPoint(lenP+iseg, ( cn2+rad*np.cos(ipt), ce2+rad*np.sin(ipt), ht) )
648
+
649
+                    # close loop        
650
+                    self.loops[self.ui.loopLabel.text()].SetPoint(lenP+iseg+1, point1) 
651
+
652
+
653
+                    self.loops[self.ui.loopLabel.text()].SetNumberOfFrequencies(1)
654
+                    self.loops[self.ui.loopLabel.text()].SetCurrent(1.)
655
+ 
581
             
656
             
582
             if self.ui.loopGeom.currentText() == "polygon":
657
             if self.ui.loopGeom.currentText() == "polygon":
583
                 
658
                 
638
             # general across all types   
713
             # general across all types   
639
             if dialog.result():
714
             if dialog.result():
640
 
715
 
641
-                yml = open( self.ui.loopLabel.text() + ".yml", 'w' )
716
+                yml = open( self.ui.loopLabel.text() + ".pwa", 'w' )
642
                 print( self.loops[self.ui.loopLabel.text()], file=yml)
717
                 print( self.loops[self.ui.loopLabel.text()], file=yml)
643
 
718
 
644
                 # update the table 
719
                 # update the table 
845
         self.ui.lcdNumberNQ.display(self.RAWDataProc.nPulseMoments)
920
         self.ui.lcdNumberNQ.display(self.RAWDataProc.nPulseMoments)
846
         self.ui.DeadTimeSpinBox.setValue(1e3*self.RAWDataProc.deadTime)
921
         self.ui.DeadTimeSpinBox.setValue(1e3*self.RAWDataProc.deadTime)
847
         self.ui.CentralVSpinBox.setValue( self.RAWDataProc.transFreq )
922
         self.ui.CentralVSpinBox.setValue( self.RAWDataProc.transFreq )
848
-            
923
+
924
+        # set the B0 field according to Tx as an initial guess
925
+        self.ui.intensitySpinBox.setValue( self.RAWDataProc.transFreq/GAMMAH )           
926
+ 
849
         if self.RAWDataProc.pulseType != "FID":
927
         if self.RAWDataProc.pulseType != "FID":
850
             self.ui.lcdNumberTauPulse2.setEnabled(1)
928
             self.ui.lcdNumberTauPulse2.setEnabled(1)
851
             self.ui.lcdNumberTauPulse2.display(1e3*self.RAWDataProc.pulseLength[1])
929
             self.ui.lcdNumberTauPulse2.display(1e3*self.RAWDataProc.pulseLength[1])
874
         
952
         
875
         fdir = os.path.dirname(fpath)
953
         fdir = os.path.dirname(fpath)
876
         # Pickle the preprocessed data dictionary 
954
         # Pickle the preprocessed data dictionary 
877
-        SaveStr = QtWidgets.QFileDialog.getSaveFileName(self, "Save as", fdir, r"Processed data (*.yaml)")[0]
955
+        SaveStr = QtWidgets.QFileDialog.getSaveFileName(self, "Save as", fdir, r"Processed data (*.akvoProcData)")[0]
878
         
956
         
879
         spath,filen=os.path.split(str(SaveStr))
957
         spath,filen=os.path.split(str(SaveStr))
880
         f = open('.akvo.last.yaml.path', 'w')
958
         f = open('.akvo.last.yaml.path', 'w')
991
             TXRX.append(txrx)
1069
             TXRX.append(txrx)
992
         INFO["TXRX"] = TXRX       
1070
         INFO["TXRX"] = TXRX       
993
 
1071
 
994
-        # 
1072
+        if "Stacking" in self.YamlNode.Stacking.keys():
1073
+            INFO["sigma"] = self.RawDataProc.sigma
1074
+
1075
+        if "Gate integrate" in self.YamlNode.Stacking.keys():
1076
+            INFO["GATED"] = self.RAWDataProc.GATED
1077
+
995
         print("META SAVE")
1078
         print("META SAVE")
996
         print("INFO log", INFO["log"])
1079
         print("INFO log", INFO["log"])
997
 
1080
 
1099
         #    self.YamlNode.Processing["Loaded"] = []
1182
         #    self.YamlNode.Processing["Loaded"] = []
1100
         #self.YamlNode.Processing["Loaded"].append(datetime.datetime.now().isoformat()) 
1183
         #self.YamlNode.Processing["Loaded"].append(datetime.datetime.now().isoformat()) 
1101
         #self.Log()
1184
         #self.Log()
1185
+
1186
+        if "Stacking" in self.YamlNode.Stacking.keys():
1187
+            self.RAWDataProc.sigma = self.RAWDataProc.DATADICT["sigma"]
1188
+
1189
+        # check to see if gate integration has been done, and it's ready to send to Merlin
1190
+        if "Gate integrate" in self.YamlNode.Stacking.keys():
1191
+            self.RAWDataProc.GATED = self.RAWDataProc.DATADICT["GATED"]
1192
+            self.ui.actionExport_Preprocessed_Dataset.setEnabled(True)
1193
+            #self.ui.plotGI.setEnabled(True)
1102
  
1194
  
1103
         # If we got this far, enable all the widgets
1195
         # If we got this far, enable all the widgets
1104
         self.ui.lcdNumberTauPulse1.setEnabled(True)
1196
         self.ui.lcdNumberTauPulse1.setEnabled(True)
1136
         if u"Pulse 1" in self.RAWDataProc.DATADICT.keys():
1228
         if u"Pulse 1" in self.RAWDataProc.DATADICT.keys():
1137
             self.ui.lcdNumberFID1Length.display(self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][-1]- self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0])
1229
             self.ui.lcdNumberFID1Length.display(self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][-1]- self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0])
1138
             self.ui.lcdTotalDeadTime.display( round(1e3*(self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 1"]["PULSE_TIMES"][-1]), 3) )
1230
             self.ui.lcdTotalDeadTime.display( round(1e3*(self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 1"]["PULSE_TIMES"][-1]), 3) )
1139
-            print("CALC DEAD",    (1e3*(self.RAWDataProc.prePulseDelay))) # -  (self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 1"]["PULSE_TIMES"][-1])), 3) )
1231
+            #print("CALC DEAD",    (1e3*(self.RAWDataProc.prePulseDelay))) # -  (self.RAWDataProc.DATADICT["Pulse 1"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 1"]["PULSE_TIMES"][-1])), 3) )
1140
         if u"Pulse 2" in self.RAWDataProc.DATADICT.keys():
1232
         if u"Pulse 2" in self.RAWDataProc.DATADICT.keys():
1141
             self.ui.lcdNumberFID1Length.display(self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][-1]- self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][0])
1233
             self.ui.lcdNumberFID1Length.display(self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][-1]- self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][0])
1142
             self.ui.lcdTotalDeadTime.display( 1e3 * (self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 2"]["PULSE_TIMES"][-1]) )
1234
             self.ui.lcdTotalDeadTime.display( 1e3 * (self.RAWDataProc.DATADICT["Pulse 2"]["TIMES"][0]-self.RAWDataProc.DATADICT["Pulse 2"]["PULSE_TIMES"][-1]) )
1612
         self.YamlNode.META["Loops"] = OrderedDict()
1704
         self.YamlNode.META["Loops"] = OrderedDict()
1613
         for loop in self.loops:
1705
         for loop in self.loops:
1614
             print(self.loops[loop])
1706
             print(self.loops[loop])
1615
-            self.YamlNode.META["Loops"][loop] = loop + ".yml" 
1707
+            self.YamlNode.META["Loops"][loop] = loop + ".pwa" 
1616
 
1708
 
1617
         self.Log()
1709
         self.Log()
1618
 
1710
 

+ 100
- 69
akvo/gui/main.ui Ver arquivo

638
                 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
638
                 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
639
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
639
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
640
 p, li { white-space: pre-wrap; }
640
 p, li { white-space: pre-wrap; }
641
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:italic;&quot;&gt;
641
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:italic;&quot;&gt;
642
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Serif'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
642
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Serif'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
643
                </property>
643
                </property>
644
               </widget>
644
               </widget>
710
         <rect>
710
         <rect>
711
          <x>0</x>
711
          <x>0</x>
712
          <y>0</y>
712
          <y>0</y>
713
-         <width>543</width>
714
-         <height>889</height>
713
+         <width>537</width>
714
+         <height>982</height>
715
         </rect>
715
         </rect>
716
        </property>
716
        </property>
717
        <property name="sizePolicy">
717
        <property name="sizePolicy">
2918
                <string>Survey site information</string>
2918
                <string>Survey site information</string>
2919
               </property>
2919
               </property>
2920
               <layout class="QGridLayout" name="gridLayout_10">
2920
               <layout class="QGridLayout" name="gridLayout_10">
2921
-               <item row="4" column="3">
2922
-                <widget class="QDoubleSpinBox" name="tempSpinBox">
2923
-                 <property name="value">
2924
-                  <double>20.000000000000000</double>
2921
+               <item row="2" column="3">
2922
+                <widget class="QLabel" name="label_64">
2923
+                 <property name="text">
2924
+                  <string>Ellipsoid</string>
2925
                  </property>
2925
                  </property>
2926
                 </widget>
2926
                 </widget>
2927
                </item>
2927
                </item>
2947
                  </item>
2947
                  </item>
2948
                 </widget>
2948
                 </widget>
2949
                </item>
2949
                </item>
2950
-               <item row="2" column="2">
2951
-                <widget class="QLabel" name="label_63">
2952
-                 <property name="text">
2953
-                  <string>Lat. Band </string>
2954
-                 </property>
2955
-                </widget>
2956
-               </item>
2957
-               <item row="4" column="2">
2958
-                <widget class="QTimeEdit" name="timeEdit">
2959
-                 <property name="calendarPopup">
2960
-                  <bool>true</bool>
2961
-                 </property>
2962
-                </widget>
2963
-               </item>
2964
-               <item row="5" column="1">
2965
-                <widget class="QDoubleSpinBox" name="incSpinBox">
2966
-                 <property name="decimals">
2967
-                  <number>1</number>
2968
-                 </property>
2969
-                 <property name="minimum">
2970
-                  <double>-90.000000000000000</double>
2971
-                 </property>
2972
-                 <property name="maximum">
2973
-                  <double>90.000000000000000</double>
2974
-                 </property>
2975
-                 <property name="value">
2976
-                  <double>45.000000000000000</double>
2977
-                 </property>
2978
-                </widget>
2979
-               </item>
2980
                <item row="5" column="0">
2950
                <item row="5" column="0">
2981
                 <widget class="QLabel" name="label_67">
2951
                 <widget class="QLabel" name="label_67">
2982
                  <property name="text">
2952
                  <property name="text">
2984
                  </property>
2954
                  </property>
2985
                 </widget>
2955
                 </widget>
2986
                </item>
2956
                </item>
2987
-               <item row="2" column="3">
2988
-                <widget class="QLabel" name="label_64">
2989
-                 <property name="text">
2990
-                  <string>Ellipsoid</string>
2957
+               <item row="6" column="1">
2958
+                <widget class="QDoubleSpinBox" name="txv">
2959
+                 <property name="minimum">
2960
+                  <double>-500.000000000000000</double>
2961
+                 </property>
2962
+                 <property name="maximum">
2963
+                  <double>500.000000000000000</double>
2991
                  </property>
2964
                  </property>
2992
                 </widget>
2965
                 </widget>
2993
                </item>
2966
                </item>
3011
                  </property>
2984
                  </property>
3012
                 </widget>
2985
                 </widget>
3013
                </item>
2986
                </item>
2987
+               <item row="6" column="3">
2988
+                <widget class="QDoubleSpinBox" name="larmorv">
2989
+                 <property name="maximum">
2990
+                  <double>3000.000000000000000</double>
2991
+                 </property>
2992
+                </widget>
2993
+               </item>
3014
                <item row="3" column="2">
2994
                <item row="3" column="2">
3015
                 <widget class="QComboBox" name="latBand">
2995
                 <widget class="QComboBox" name="latBand">
3016
                  <property name="toolTip">
2996
                  <property name="toolTip">
3133
                  </item>
3113
                  </item>
3134
                 </widget>
3114
                 </widget>
3135
                </item>
3115
                </item>
3116
+               <item row="2" column="2">
3117
+                <widget class="QLabel" name="label_63">
3118
+                 <property name="text">
3119
+                  <string>Lat. Band </string>
3120
+                 </property>
3121
+                </widget>
3122
+               </item>
3136
                <item row="4" column="1">
3123
                <item row="4" column="1">
3137
                 <widget class="QDateEdit" name="dateEdit">
3124
                 <widget class="QDateEdit" name="dateEdit">
3138
                  <property name="calendarPopup">
3125
                  <property name="calendarPopup">
3160
                  </property>
3147
                  </property>
3161
                 </widget>
3148
                 </widget>
3162
                </item>
3149
                </item>
3163
-               <item row="2" column="1">
3164
-                <widget class="QLabel" name="label_59">
3165
-                 <property name="maximumSize">
3166
-                  <size>
3167
-                   <width>16777215</width>
3168
-                   <height>20</height>
3169
-                  </size>
3150
+               <item row="5" column="2">
3151
+                <widget class="QDoubleSpinBox" name="decSpinBox">
3152
+                 <property name="decimals">
3153
+                  <number>1</number>
3154
+                 </property>
3155
+                 <property name="minimum">
3156
+                  <double>-90.000000000000000</double>
3157
+                 </property>
3158
+                 <property name="maximum">
3159
+                  <double>90.000000000000000</double>
3170
                  </property>
3160
                  </property>
3161
+                 <property name="value">
3162
+                  <double>0.000000000000000</double>
3163
+                 </property>
3164
+                </widget>
3165
+               </item>
3166
+               <item row="3" column="0">
3167
+                <widget class="QLabel" name="label_61">
3171
                  <property name="text">
3168
                  <property name="text">
3172
-                  <string>UTM</string>
3169
+                  <string>Coordinates</string>
3173
                  </property>
3170
                  </property>
3174
                 </widget>
3171
                 </widget>
3175
                </item>
3172
                </item>
3176
-               <item row="5" column="2">
3177
-                <widget class="QDoubleSpinBox" name="decSpinBox">
3173
+               <item row="1" column="0" colspan="4">
3174
+                <widget class="Line" name="line_13">
3175
+                 <property name="orientation">
3176
+                  <enum>Qt::Horizontal</enum>
3177
+                 </property>
3178
+                </widget>
3179
+               </item>
3180
+               <item row="5" column="1">
3181
+                <widget class="QDoubleSpinBox" name="incSpinBox">
3178
                  <property name="decimals">
3182
                  <property name="decimals">
3179
                   <number>1</number>
3183
                   <number>1</number>
3180
                  </property>
3184
                  </property>
3185
                   <double>90.000000000000000</double>
3189
                   <double>90.000000000000000</double>
3186
                  </property>
3190
                  </property>
3187
                  <property name="value">
3191
                  <property name="value">
3188
-                  <double>0.000000000000000</double>
3192
+                  <double>45.000000000000000</double>
3189
                  </property>
3193
                  </property>
3190
                 </widget>
3194
                 </widget>
3191
                </item>
3195
                </item>
3192
-               <item row="4" column="0">
3193
-                <widget class="QLabel" name="label_57">
3196
+               <item row="2" column="1">
3197
+                <widget class="QLabel" name="label_59">
3198
+                 <property name="maximumSize">
3199
+                  <size>
3200
+                   <width>16777215</width>
3201
+                   <height>20</height>
3202
+                  </size>
3203
+                 </property>
3194
                  <property name="text">
3204
                  <property name="text">
3195
-                  <string>[Date, time,°C]</string>
3205
+                  <string>UTM</string>
3196
                  </property>
3206
                  </property>
3197
                 </widget>
3207
                 </widget>
3198
                </item>
3208
                </item>
3199
-               <item row="3" column="0">
3200
-                <widget class="QLabel" name="label_61">
3209
+               <item row="4" column="3">
3210
+                <widget class="QDoubleSpinBox" name="tempSpinBox">
3211
+                 <property name="value">
3212
+                  <double>20.000000000000000</double>
3213
+                 </property>
3214
+                </widget>
3215
+               </item>
3216
+               <item row="4" column="2">
3217
+                <widget class="QTimeEdit" name="timeEdit">
3218
+                 <property name="calendarPopup">
3219
+                  <bool>true</bool>
3220
+                 </property>
3221
+                </widget>
3222
+               </item>
3223
+               <item row="4" column="0">
3224
+                <widget class="QLabel" name="label_57">
3201
                  <property name="text">
3225
                  <property name="text">
3202
-                  <string>Coordinates</string>
3226
+                  <string>[Date, time,°C]</string>
3203
                  </property>
3227
                  </property>
3204
                 </widget>
3228
                 </widget>
3205
                </item>
3229
                </item>
3515
                  </item>
3539
                  </item>
3516
                 </widget>
3540
                 </widget>
3517
                </item>
3541
                </item>
3518
-               <item row="1" column="0" colspan="4">
3519
-                <widget class="Line" name="line_13">
3520
-                 <property name="orientation">
3521
-                  <enum>Qt::Horizontal</enum>
3542
+               <item row="6" column="2">
3543
+                <widget class="QLabel" name="label_85">
3544
+                 <property name="text">
3545
+                  <string>Larmor 𝜈 [Hz]</string>
3546
+                 </property>
3547
+                </widget>
3548
+               </item>
3549
+               <item row="6" column="0">
3550
+                <widget class="QLabel" name="label_86">
3551
+                 <property name="text">
3552
+                  <string>Tx offset [Hz]</string>
3522
                  </property>
3553
                  </property>
3523
                 </widget>
3554
                 </widget>
3524
                </item>
3555
                </item>
4112
               <rect>
4143
               <rect>
4113
                <x>0</x>
4144
                <x>0</x>
4114
                <y>0</y>
4145
                <y>0</y>
4115
-               <width>98</width>
4116
-               <height>28</height>
4146
+               <width>96</width>
4147
+               <height>26</height>
4117
               </rect>
4148
               </rect>
4118
              </property>
4149
              </property>
4119
              <attribute name="label">
4150
              <attribute name="label">
4125
               <rect>
4156
               <rect>
4126
                <x>0</x>
4157
                <x>0</x>
4127
                <y>0</y>
4158
                <y>0</y>
4128
-               <width>411</width>
4129
-               <height>79</height>
4159
+               <width>96</width>
4160
+               <height>26</height>
4130
               </rect>
4161
               </rect>
4131
              </property>
4162
              </property>
4132
              <attribute name="label">
4163
              <attribute name="label">
4422
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
4453
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
4423
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
4454
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
4424
 p, li { white-space: pre-wrap; }
4455
 p, li { white-space: pre-wrap; }
4425
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
4426
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;All processing steps are recorded here for your records&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
4456
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
4457
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;All processing steps are recorded here for your records&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
4427
             </property>
4458
             </property>
4428
            </widget>
4459
            </widget>
4429
            <widget class="QLabel" name="label_74">
4460
            <widget class="QLabel" name="label_74">
4454
      <x>0</x>
4485
      <x>0</x>
4455
      <y>0</y>
4486
      <y>0</y>
4456
      <width>1230</width>
4487
      <width>1230</width>
4457
-     <height>22</height>
4488
+     <height>30</height>
4458
     </rect>
4489
     </rect>
4459
    </property>
4490
    </property>
4460
    <widget class="QMenu" name="menuOpen_GMR_RAW_Header">
4491
    <widget class="QMenu" name="menuOpen_GMR_RAW_Header">

+ 2
- 2
akvo/terminal/plotKernelDiff.py Ver arquivo

36
     q = np.array(K0.PulseI.data)* (float)(K0.Taup)
36
     q = np.array(K0.PulseI.data)* (float)(K0.Taup)
37
 
37
 
38
     #plt.pcolor(K0.Interfaces.data, K0.PulseI.data, np.abs(K))
38
     #plt.pcolor(K0.Interfaces.data, K0.PulseI.data, np.abs(K))
39
-    plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.gray_r)
39
+    #plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.gray_r)
40
     #plt.contourf(q, K0.Interfaces.data[0:-1], np.abs(K), cmap=cmocean.cm.tempo)
40
     #plt.contourf(q, K0.Interfaces.data[0:-1], np.abs(K), cmap=cmocean.cm.tempo)
41
     #plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.tempo)
41
     #plt.pcolor(q, K0.Interfaces.data, np.abs(K), cmap=cmocean.cm.tempo)
42
     
42
     
43
-    plt.pcolor(q, K0.Interfaces.data, np.abs(K - K2), cmap=cmocean.cm.gray_r)
43
+    plt.pcolor(q, K0.Interfaces.data, (np.abs(K) - np.abs(K2)), cmap=cmocean.cm.gray_r)
44
     plt.colorbar()
44
     plt.colorbar()
45
 
45
 
46
     ax1 = plt.gca()
46
     ax1 = plt.gca()

+ 4
- 4
akvo/tressel/mrsurvey.py Ver arquivo

495
                 # convert to dB and add colorbars
495
                 # convert to dB and add colorbars
496
                 #db = 20.*np.log10(np.abs(SFFT[:,istart:iend]))
496
                 #db = 20.*np.log10(np.abs(SFFT[:,istart:iend]))
497
                 db = (np.abs(SFFT[:,istart:iend]))
497
                 db = (np.abs(SFFT[:,istart:iend]))
498
+                
498
                 #db = (np.real(SFFT[:,istart:iend]))
499
                 #db = (np.real(SFFT[:,istart:iend]))
500
+                #db = (np.imag(SFFT[:,istart:iend]))
499
                 #dbr = (np.real(SFFT[:,istart:iend]))
501
                 #dbr = (np.real(SFFT[:,istart:iend]))
500
                 #db = (np.imag(SFFT[:,istart:iend]))
502
                 #db = (np.imag(SFFT[:,istart:iend]))
501
                 
503
                 
1269
                 
1271
                 
1270
                     # Bootstrap noise 
1272
                     # Bootstrap noise 
1271
                     #self.GATED[chan]["isum"]
1273
                     #self.GATED[chan]["isum"]
1272
-                    print("bootstrappin") 
1273
                     Means = rotate.bootstrapWindows( self.DATADICT["NR"][pulse][chan][ipm], 20000, isum[isum!=1], adapt=True)
1274
                     Means = rotate.bootstrapWindows( self.DATADICT["NR"][pulse][chan][ipm], 20000, isum[isum!=1], adapt=True)
1274
                     # MAD, only for windows > 1 
1275
                     # MAD, only for windows > 1 
1275
                     c = stats.norm.ppf(3./4.)
1276
                     c = stats.norm.ppf(3./4.)
1276
                     sig_stack[isum!=1] = np.ma.median(np.ma.abs(Means), axis=1) / c 
1277
                     sig_stack[isum!=1] = np.ma.median(np.ma.abs(Means), axis=1) / c 
1277
                     self.GATED[chan]["BN"][ipm] = sig_stack[clip:] 
1278
                     self.GATED[chan]["BN"][ipm] = sig_stack[clip:] 
1278
-                    print("end bootstrappin")
1279
 
1279
 
1280
                     #self.GATED[chan]["DATA"][ipm] = GD.real
1280
                     #self.GATED[chan]["DATA"][ipm] = GD.real
1281
                     self.GATEDABSCISSA = GT[clip:]
1281
                     self.GATEDABSCISSA = GT[clip:]
1650
 
1650
 
1651
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1651
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1652
                 #scolours = plt.cm.Blues(np.linspace(0,1,1.5*len(self.DATADICT["stacks"])))
1652
                 #scolours = plt.cm.Blues(np.linspace(0,1,1.5*len(self.DATADICT["stacks"])))
1653
-                scolours = cmocean.cm.ice(np.linspace(0,1,1.5*len(self.DATADICT["stacks"])))
1653
+                scolours = cmocean.cm.ice(np.linspace(0,1,int(1.5*len(self.DATADICT["stacks"]))))
1654
                 iistack = 0
1654
                 iistack = 0
1655
                 for istack in self.DATADICT["stacks"]:
1655
                 for istack in self.DATADICT["stacks"]:
1656
                     #self.DATADICT[pulse]["PULSE_TIMES"]
1656
                     #self.DATADICT[pulse]["PULSE_TIMES"]
1706
             ilabel = True
1706
             ilabel = True
1707
             for ipm in range(self.DATADICT["nPulseMoments"]):
1707
             for ipm in range(self.DATADICT["nPulseMoments"]):
1708
                 #scolours = np.array([0.,0.,1.])
1708
                 #scolours = np.array([0.,0.,1.])
1709
-                scolours = cmocean.cm.ice(np.linspace(0,1,1.5*len(self.DATADICT["stacks"])))
1709
+                scolours = cmocean.cm.ice(np.linspace(0,1,int(1.5*len(self.DATADICT["stacks"]))))
1710
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1710
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1711
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1711
                 #scolours = plt.cm.Spectral(np.linspace(0,1,len(self.DATADICT["stacks"])))
1712
                 istack = 0
1712
                 istack = 0

+ 2
- 2
setup.py Ver arquivo

21
     long_description = fh.read()
21
     long_description = fh.read()
22
 
22
 
23
 setup(name='Akvo',
23
 setup(name='Akvo',
24
-      version='1.4.6',
24
+      version='1.5.0',
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,
53
           'pandas',
53
           'pandas',
54
           'pyqt-distutils',
54
           'pyqt-distutils',
55
           'cmocean',
55
           'cmocean',
56
-          'pyLemma >= 0.0.11'
56
+          'pyLemma >= 0.1.0'
57
       ],
57
       ],
58
       packages=['akvo', 'akvo.tressel', 'akvo.gui'],
58
       packages=['akvo', 'akvo.tressel', 'akvo.gui'],
59
       license=['GPL 4.0'],
59
       license=['GPL 4.0'],

Carregando…
Cancelar
Salvar