Просмотр исходного кода

More tweaks to the GUI for better use experience.

tags/1.6.1
Trevor Irons 5 лет назад
Родитель
Сommit
2a0f40eb3c
4 измененных файлов: 27 добавлений и 22 удалений
  1. 9
    6
      akvo/gui/akvoGUI.py
  2. 0
    3
      akvo/gui/main.ui
  3. 5
    4
      akvo/tressel/harmonic.py
  4. 13
    9
      akvo/tressel/mrsurvey.py

+ 9
- 6
akvo/gui/akvoGUI.py Просмотреть файл

@@ -1024,6 +1024,7 @@ class ApplicationWindow(QtWidgets.QMainWindow):
1024 1024
         self.ui.BandPassBox.setEnabled(False)
1025 1025
         self.ui.downSampleGroupBox.setEnabled(False)
1026 1026
         self.ui.windowFilterGroupBox.setEnabled(False)
1027
+        self.ui.harmonicBox.setEnabled(False)
1027 1028
 #        self.ui.despikeGroupBox.setEnabled(False)
1028 1029
         self.ui.adaptBox.setEnabled(False)
1029 1030
         self.ui.adaptFDBox.setEnabled(False)
@@ -1069,12 +1070,14 @@ class ApplicationWindow(QtWidgets.QMainWindow):
1069 1070
         # Harmonic
1070 1071
         self.ui.harmonicBox.setEnabled(True)
1071 1072
         self.ui.harmonicBox.setChecked(True)
1073
+        self.LCDHarmonics()
1074
+        self.LCDHarmonics2()
1072 1075
 
1073 1076
         # sum group box
1074 1077
         try:
1075 1078
             if len(self.dataChan) > 1:
1076 1079
                 self.ui.sumDataBox.setEnabled(True)
1077
-                self.ui.sumDataBox.setChecked(True)
1080
+                self.ui.sumDataBox.setChecked(False)
1078 1081
         except:
1079 1082
             pass
1080 1083
 
@@ -1157,11 +1160,11 @@ class ApplicationWindow(QtWidgets.QMainWindow):
1157 1160
                 self.YamlNode.Processing["Harmonic modelling"]["f1Ks"] = str( self.ui.f1KsSpin.value() )
1158 1161
                 self.YamlNode.Processing["Harmonic modelling"]["f1"] = str( self.ui.f1Spin.value() )
1159 1162
             self.Log()
1160
-        else:
1161
-            err_msg = "Harmonic modelling noise cancellation has already been applied!"
1162
-            reply = QtWidgets.QMessageBox.critical(self, 'Error', 
1163
-                err_msg) 
1164
-            return 
1163
+        #else:
1164
+        #    err_msg = "Harmonic modelling noise cancellation has already been applied!"
1165
+        #    reply = QtWidgets.QMessageBox.critical(self, 'Error', 
1166
+        #        err_msg) 
1167
+        #    return 
1165 1168
 
1166 1169
         self.lock("harmonic noise modelling")
1167 1170
 

+ 0
- 3
akvo/gui/main.ui Просмотреть файл

@@ -1154,9 +1154,6 @@ background: dark grey;
1154 1154
                </item>
1155 1155
                <item row="4" column="2">
1156 1156
                 <widget class="QLCDNumber" name="lcdH1F">
1157
-                 <property name="enabled">
1158
-                  <bool>false</bool>
1159
-                 </property>
1160 1157
                  <property name="styleSheet">
1161 1158
                   <string notr="true">#lcdH1F {
1162 1159
 color: green;

+ 5
- 4
akvo/tressel/harmonic.py Просмотреть файл

@@ -40,7 +40,7 @@ def harmonicNorm (f0, sN, fs, t, k1, kN, ks):
40 40
 def minHarmonic(sN, fs, t, f0, k1, kN, ks):
41 41
     
42 42
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
43
-    #res = minimize(harmonicNorm, np.array((f0)), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
43
+    res = minimize(harmonicNorm, np.array((f0)), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
44 44
     
45 45
     #############
46 46
     # Reduced N #
@@ -51,11 +51,12 @@ def minHarmonic(sN, fs, t, f0, k1, kN, ks):
51 51
     ########## 
52 52
     # Bounds #
53 53
     ##########
54
-    print("bounded search for f0", f0)
55
-    bnds = ( (f0-0.125, f0+0.125), )
54
+    #print("bounded search for f0 with 10", f0)
55
+    #bnds = ( (f0-0.125, f0+0.125), )
56 56
     #print("len f0", len( [f0,] ))
57 57
     #print("len bnds", len(bnds) )
58
-    res = minimize(harmonicNorm, (f0,), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='L-BFGS-B', bounds=bnds ) # hess=None, bounds=None )
58
+    #res = minimize(harmonicNorm, (f0,), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='L-BFGS-B', bounds=bnds ) # hess=None, bounds=None )
59
+    #res = minimize(harmonicNorm, (f0,), args=(sN, fs, t, k1, 10, ks), jac='2-point', method='L-BFGS-B', bounds=bnds ) # hess=None, bounds=None )
59 60
     
60 61
     #print(res)
61 62
     #print ( "guess", guessf0(  harmonicEuler(sN, fs, t, res.x[0], k1, kN, ks), fs  ) )

+ 13
- 9
akvo/tressel/mrsurvey.py Просмотреть файл

@@ -2002,10 +2002,12 @@ class GMRDataProcessor(SNMRDataProcessor):
2002 2002
         self.samp /= dec
2003 2003
         self.dt   = 1./self.samp       
2004 2004
 
2005
-        if truncate:
2006
-            itrunc = (int)( 1e-3*truncate*self.samp )
2007 2005
         iFID = 0  
2008 2006
         for pulse in self.DATADICT["PULSES"]:
2007
+            RSTIMES = self.DATADICT[pulse]["TIMES"][::dec]
2008
+            if truncate:
2009
+                itrunc = (int)( 1e-3*truncate*self.samp )
2010
+                RSTIMES = RSTIMES[0:itrunc]
2009 2011
             for ipm in range(self.DATADICT["nPulseMoments"]):
2010 2012
                 for istack in self.DATADICT["stacks"]:
2011 2013
                     if plot:
@@ -2014,16 +2016,18 @@ class GMRDataProcessor(SNMRDataProcessor):
2014 2016
                         # trim off indices that don't divide evenly
2015 2017
                         ndi = np.shape(self.DATADICT[pulse][ichan][ipm][istack])[0]%dec
2016 2018
                         if ndi:
2017
-                            [self.DATADICT[pulse][ichan][ipm][istack], RSTIMES] = signal.resample(self.DATADICT[pulse][ichan][ipm][istack][0:-ndi],\
2018
-                                         len(self.DATADICT[pulse][ichan][ipm][istack][0:-ndi])//dec,\
2019
-                                         self.DATADICT[pulse]["TIMES"][0:-ndi], window='hamm')
2019
+                            #[self.DATADICT[pulse][ichan][ipm][istack], RSTIMES] = signal.resample(self.DATADICT[pulse][ichan][ipm][istack][0:-ndi],\
2020
+                            #             len(self.DATADICT[pulse][ichan][ipm][istack][0:-ndi])//dec,\
2021
+                            #             self.DATADICT[pulse]["TIMES"][0:-ndi], window='hamm')
2022
+                            self.DATADICT[pulse][ichan][ipm][istack] = signal.decimate(self.DATADICT[pulse][ichan][ipm][istack], dec, n=None, ftype='iir', zero_phase=True)
2020 2023
                         else:
2021
-                            [self.DATADICT[pulse][ichan][ipm][istack], RSTIMES] = signal.resample(self.DATADICT[pulse][ichan][ipm][istack],\
2022
-                                         len(self.DATADICT[pulse][ichan][ipm][istack])//dec,\
2023
-                                         self.DATADICT[pulse]["TIMES"], window='hamm')
2024
+                            #[self.DATADICT[pulse][ichan][ipm][istack], RSTIMES] = signal.resample(self.DATADICT[pulse][ichan][ipm][istack],\
2025
+                            #             len(self.DATADICT[pulse][ichan][ipm][istack])//dec,\
2026
+                            #             self.DATADICT[pulse]["TIMES"], window='hamm')
2027
+                            self.DATADICT[pulse][ichan][ipm][istack] = signal.decimate(self.DATADICT[pulse][ichan][ipm][istack], dec, n=None, ftype='iir', zero_phase=True)
2024 2028
                         if truncate:
2025 2029
                             self.DATADICT[pulse][ichan][ipm][istack] = self.DATADICT[pulse][ichan][ipm][istack][0:itrunc]
2026
-                            RSTIMES = RSTIMES[0:itrunc]
2030
+
2027 2031
                     if plot:
2028 2032
                         for ichan in self.DATADICT[pulse]["chan"]:
2029 2033
                             canvas.ax2.plot( RSTIMES, 1e9*self.DATADICT[pulse][ichan][ipm][istack], \

Загрузка…
Отмена
Сохранить