Browse Source

More tweaks to harmonic modelling

tags/1.6.1
Trevor Irons 5 years ago
parent
commit
6e7f14da3e
3 changed files with 5 additions and 3 deletions
  1. 1
    1
      akvo/gui/akvoGUI.py
  2. 1
    1
      akvo/gui/main.ui
  3. 3
    1
      akvo/tressel/harmonic.py

+ 1
- 1
akvo/gui/akvoGUI.py View File

1154
             self.Log()
1154
             self.Log()
1155
         else:
1155
         else:
1156
             err_msg = "Harmonic modelling noise cancellation has already been applied!"
1156
             err_msg = "Harmonic modelling noise cancellation has already been applied!"
1157
-            reply =QtWidgets.QMessageBox.critical(self, 'Error', 
1157
+            reply = QtWidgets.QMessageBox.critical(self, 'Error', 
1158
                 err_msg) 
1158
                 err_msg) 
1159
             return 
1159
             return 
1160
 
1160
 

+ 1
- 1
akvo/gui/main.ui View File

1372
                   <number>1</number>
1372
                   <number>1</number>
1373
                  </property>
1373
                  </property>
1374
                  <property name="maximum">
1374
                  <property name="maximum">
1375
-                  <number>10</number>
1375
+                  <number>100</number>
1376
                  </property>
1376
                  </property>
1377
                  <property name="value">
1377
                  <property name="value">
1378
                   <number>1</number>
1378
                   <number>1</number>

+ 3
- 1
akvo/tressel/harmonic.py View File

41
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
41
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
42
     res = minimize(harmonicNorm, np.array((f0)), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
42
     res = minimize(harmonicNorm, np.array((f0)), args=(sN, fs, t, k1, kN, ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
43
     #print(res)
43
     #print(res)
44
+    #print ( "guess", guessf0(  harmonicEuler(sN, fs, t, res.x[0], k1, kN, ks), fs  ) )
44
     return harmonicEuler(sN, fs, t, res.x[0], k1, kN, ks)#[0]
45
     return harmonicEuler(sN, fs, t, res.x[0], k1, kN, ks)#[0]
45
 
46
 
46
 def harmonicEuler2 ( sN, fs, t, f0, f0k1, f0kN, f0ks, f1, f1k1, f1kN, f1ks ): 
47
 def harmonicEuler2 ( sN, fs, t, f0, f0k1, f0kN, f0ks, f1, f1k1, f1kN, f1ks ): 
92
 def minHarmonic2(sN, fs, t, f0, f0k1, f0kN, f0ks, f1, f1k1, f1kN, f1ks):
93
 def minHarmonic2(sN, fs, t, f0, f0k1, f0kN, f0ks, f1, f1k1, f1kN, f1ks):
93
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
94
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
94
     res = minimize(harmonic2Norm, np.array((f0, f1)), args=(sN, fs, t, f0k1, f0kN, f0ks, f1k1,f1kN, f1ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
95
     res = minimize(harmonic2Norm, np.array((f0, f1)), args=(sN, fs, t, f0k1, f0kN, f0ks, f1k1,f1kN, f1ks), jac='2-point', method='BFGS') # hess=None, bounds=None )
95
-    print(res)
96
+    #print(res)
97
+    #print ( "guess", guessf0(harmonicEuler2(sN, fs, t, res.x[0], f0k1, f0kN, f0ks, res.x[1], f1k1, f1kN, f1ks), fs)  )
96
     return harmonicEuler2(sN, fs, t, res.x[0], f0k1, f0kN, f0ks, res.x[1], f1k1, f1kN, f1ks)#[0]
98
     return harmonicEuler2(sN, fs, t, res.x[0], f0k1, f0kN, f0ks, res.x[1], f1k1, f1kN, f1ks)#[0]
97
 
99
 
98
 def guessf0( sN, fs ):
100
 def guessf0( sN, fs ):

Loading…
Cancel
Save