Pārlūkot izejas kodu

Added harmonics to yaml log

tags/1.6.1
Trevor Irons 5 gadus atpakaļ
vecāks
revīzija
7ca51911f1
2 mainītis faili ar 26 papildinājumiem un 5 dzēšanām
  1. 18
    1
      akvo/gui/akvoGUI.py
  2. 8
    4
      akvo/tressel/mrsurvey.py

+ 18
- 1
akvo/gui/akvoGUI.py Parādīt failu

@@ -1083,7 +1083,24 @@ class ApplicationWindow(QtWidgets.QMainWindow):
1083 1083
                 self.ui.mplwidget))
1084 1084
 
1085 1085
     def harmonicModel(self):
1086
+
1087
+
1088
+        if "Harmonic modelling" not in self.YamlNode.Processing.keys():
1089
+            self.YamlNode.Processing["Harmonic modelling"] = {}
1090
+            self.YamlNode.Processing["Harmonic modelling"]["NF"] = str( self.ui.NHarmonicsFreqsSpin.value() ) 
1091
+            self.YamlNode.Processing["Harmonic modelling"]["Nk"] = str( self.ui.NKHarmonicsSpin.value() )
1092
+            self.YamlNode.Processing["Harmonic modelling"]["f0"] = str( self.ui.f0Spin.value() )
1093
+            self.YamlNode.Processing["Harmonic modelling"]["f1"] = str( self.ui.f1Spin.value() )
1094
+            self.YamlNode.Processing["Harmonic modelling"]["Segments"] = str( 1 ) # Future 
1095
+            self.Log()
1096
+        else:
1097
+            err_msg = "Harmonic modelling noise cancellation has already been applied!"
1098
+            reply =QtWidgets.QMessageBox.critical(self, 'Error', 
1099
+                err_msg) 
1100
+            return 
1101
+
1086 1102
         self.lock("harmonic noise modelling")
1103
+
1087 1104
         thread.start_new_thread(self.RAWDataProc.harmonicModel, \
1088 1105
                 ( \
1089 1106
                  self.ui.NHarmonicsFreqsSpin.value(), \
@@ -1276,8 +1293,8 @@ class ApplicationWindow(QtWidgets.QMainWindow):
1276 1293
             reply =QtWidgets.QMessageBox.critical(self, 'Error', 
1277 1294
                 err_msg) 
1278 1295
             return 
1279
-
1280 1296
         self.lock("window filter")
1297
+        
1281 1298
         thread.start_new_thread(self.RAWDataProc.windowFilter, \
1282 1299
                 (str(self.ui.windowTypeComboBox.currentText()), \
1283 1300
                 self.ui.windowBandwidthSpinBox.value(), \

+ 8
- 4
akvo/tressel/mrsurvey.py Parādīt failu

@@ -542,8 +542,10 @@ class GMRDataProcessor(SNMRDataProcessor):
542 542
                             canvas.ax1.plot( self.DATADICT[pulse]["TIMES"], 1e9*self.DATADICT[pulse][ichan][ipm][istack], \
543 543
                                 label = "orig " +  pulse + " ipm=" + str(ipm) + " istack=" + str(istack) + " rchan="  + str(ichan))
544 544
 
545
-                        self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic( f0, self.DATADICT[pulse][ichan][ipm][istack], self.samp, 45, self.DATADICT[pulse]["TIMES"] ) 
546
-                        #self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic2( f0-1e-2, f0+1e-2, self.DATADICT[pulse][ichan][ipm][istack], self.samp, 30, self.DATADICT[pulse]["TIMES"] ) 
545
+                        if nF == 1:
546
+                            self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic( f0, self.DATADICT[pulse][ichan][ipm][istack], self.samp, nK, self.DATADICT[pulse]["TIMES"] ) 
547
+                        elif nF == 2:
548
+                            self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic2( f0-1e-2, f1+1e-2, self.DATADICT[pulse][ichan][ipm][istack], self.samp, nK, self.DATADICT[pulse]["TIMES"] ) 
547 549
 
548 550
                         # plot
549 551
                         if plot:
@@ -556,8 +558,10 @@ class GMRDataProcessor(SNMRDataProcessor):
556 558
                             canvas.ax2.plot( self.DATADICT[pulse]["TIMES"], 1e9*self.DATADICT[pulse][ichan][ipm][istack], \
557 559
                                 label = "orig " +  pulse + " ipm=" + str(ipm) + " istack=" + str(istack) + " chan="  + str(ichan))
558 560
                         
559
-                        self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic( f0, self.DATADICT[pulse][ichan][ipm][istack], self.samp, 45, self.DATADICT[pulse]["TIMES"] ) 
560
-                        #self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic2( f0-1e-2, f0+1e-2, self.DATADICT[pulse][ichan][ipm][istack], self.samp, 30, self.DATADICT[pulse]["TIMES"] ) 
561
+                        if nF == 1:
562
+                            self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic( f0, self.DATADICT[pulse][ichan][ipm][istack], self.samp, nK, self.DATADICT[pulse]["TIMES"] ) 
563
+                        elif nF == 2:
564
+                            self.DATADICT[pulse][ichan][ipm][istack] = harmonic.minHarmonic2( f0-1e-2, f1+1e-2, self.DATADICT[pulse][ichan][ipm][istack], self.samp, nK, self.DATADICT[pulse]["TIMES"] ) 
561 565
                         #self.DATADICT[pulse][ichan][ipm][istack] = harmonic.harmonicEuler( f0, self.DATADICT[pulse][ichan][ipm][istack], self.samp, 20, self.DATADICT[pulse]["TIMES"] ) 
562 566
                
563 567
                         # plot

Notiek ielāde…
Atcelt
Saglabāt