Browse Source

Reworking multiple frequency harmonic modelling

tags/1.6.1
Trevor Irons 5 years ago
parent
commit
3498a3516d
4 changed files with 234 additions and 105 deletions
  1. 28
    1
      akvo/gui/akvoGUI.py
  2. 194
    101
      akvo/gui/main.ui
  3. 4
    1
      akvo/tressel/harmonic.py
  4. 8
    2
      akvo/tressel/mrsurvey.py

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

173
         self.ui.f0KNSpin.valueChanged.connect( self.LCDHarmonics )
173
         self.ui.f0KNSpin.valueChanged.connect( self.LCDHarmonics )
174
         self.ui.f0KsSpin.valueChanged.connect( self.LCDHarmonics )
174
         self.ui.f0KsSpin.valueChanged.connect( self.LCDHarmonics )
175
         self.ui.f0Spin.valueChanged.connect( self.LCDHarmonics )
175
         self.ui.f0Spin.valueChanged.connect( self.LCDHarmonics )
176
+
177
+        self.ui.NHarmonicsFreqsSpin.valueChanged.connect( self.LCDHarmonics2 )
178
+        
179
+        self.ui.f1K1Spin.valueChanged.connect( self.LCDHarmonics2 )
180
+        self.ui.f1KNSpin.valueChanged.connect( self.LCDHarmonics2 )
181
+        self.ui.f1KsSpin.valueChanged.connect( self.LCDHarmonics2 )
182
+        self.ui.f1Spin.valueChanged.connect( self.LCDHarmonics2 )
176
  
183
  
177
         self.ui.plotQD.setEnabled(False) 
184
         self.ui.plotQD.setEnabled(False) 
178
         self.ui.plotQD.pressed.connect( self.plotQD )
185
         self.ui.plotQD.pressed.connect( self.plotQD )
266
         self.ui.lcdHNF.display( self.ui.f0Spin.value() * self.ui.f0KNSpin.value() )
273
         self.ui.lcdHNF.display( self.ui.f0Spin.value() * self.ui.f0KNSpin.value() )
267
         self.ui.lcdf0NK.setEnabled(True)
274
         self.ui.lcdf0NK.setEnabled(True)
268
         self.ui.lcdf0NK.display( (self.ui.f0KNSpin.value()+1-self.ui.f0K1Spin.value()) * self.ui.f0KsSpin.value() )
275
         self.ui.lcdf0NK.display( (self.ui.f0KNSpin.value()+1-self.ui.f0K1Spin.value()) * self.ui.f0KsSpin.value() )
276
+    
277
+    def LCDHarmonics2(self):
278
+        if self.ui.NHarmonicsFreqsSpin.value() == 2:
279
+            self.ui.lcdH1F2.setEnabled(True)
280
+            self.ui.lcdH1F2.display( self.ui.f1Spin.value() * self.ui.f1K1Spin.value() )
281
+            self.ui.lcdHNF2.setEnabled(True)
282
+            self.ui.lcdHNF2.display( self.ui.f1Spin.value() * self.ui.f1KNSpin.value() )
283
+            self.ui.lcdf0NK2.setEnabled(True)
284
+            self.ui.lcdf0NK2.display( (self.ui.f1KNSpin.value()+1-self.ui.f1K1Spin.value()) * self.ui.f1KsSpin.value() )
285
+        else:
286
+            self.ui.lcdH1F2.setEnabled(False)
287
+            self.ui.lcdHNF2.setEnabled(False)
288
+            self.ui.lcdf0NK2.setEnabled(False)
269
 
289
 
270
     def closeTabs(self):
290
     def closeTabs(self):
271
         #self.ui.ProcTabs.removeTab(idx)    
291
         #self.ui.ProcTabs.removeTab(idx)    
1103
             self.YamlNode.Processing["Harmonic modelling"]["f0K1"] = str( self.ui.f0K1Spin.value() )
1123
             self.YamlNode.Processing["Harmonic modelling"]["f0K1"] = str( self.ui.f0K1Spin.value() )
1104
             self.YamlNode.Processing["Harmonic modelling"]["f0KN"] = str( self.ui.f0KNSpin.value() )
1124
             self.YamlNode.Processing["Harmonic modelling"]["f0KN"] = str( self.ui.f0KNSpin.value() )
1105
             self.YamlNode.Processing["Harmonic modelling"]["f0Ks"] = str( self.ui.f0KsSpin.value() )
1125
             self.YamlNode.Processing["Harmonic modelling"]["f0Ks"] = str( self.ui.f0KsSpin.value() )
1106
-            self.YamlNode.Processing["Harmonic modelling"]["f1"] = str( self.ui.f1Spin.value() )
1126
+            self.YamlNode.Processing["Harmonic modelling"]["f0"] = str( self.ui.f0Spin.value() )
1127
+            self.YamlNode.Processing["Harmonic modelling"]["f1K1"] = str( self.ui.f0K1Spin.value() )
1128
+            self.YamlNode.Processing["Harmonic modelling"]["f1KN"] = str( self.ui.f0KNSpin.value() )
1129
+            self.YamlNode.Processing["Harmonic modelling"]["f1Ks"] = str( self.ui.f0KsSpin.value() )
1130
+            self.YamlNode.Processing["Harmonic modelling"]["f1"] = str( self.ui.f0Spin.value() )
1107
             self.YamlNode.Processing["Harmonic modelling"]["Segments"] = str( 1 ) # Future 
1131
             self.YamlNode.Processing["Harmonic modelling"]["Segments"] = str( 1 ) # Future 
1108
             self.Log()
1132
             self.Log()
1109
         else:
1133
         else:
1122
                  self.ui.f0KNSpin.value(), \
1146
                  self.ui.f0KNSpin.value(), \
1123
                  self.ui.f0KsSpin.value(), \
1147
                  self.ui.f0KsSpin.value(), \
1124
                  self.ui.f1Spin.value(), \
1148
                  self.ui.f1Spin.value(), \
1149
+                 self.ui.f1K1Spin.value(), \
1150
+                 self.ui.f1KNSpin.value(), \
1151
+                 self.ui.f1KsSpin.value(), \
1125
                  self.ui.plotHarmonic.isChecked(), \
1152
                  self.ui.plotHarmonic.isChecked(), \
1126
                  self.ui.mplwidget \
1153
                  self.ui.mplwidget \
1127
                 ) \
1154
                 ) \

+ 194
- 101
akvo/gui/main.ui View File

1005
               <property name="maximumSize">
1005
               <property name="maximumSize">
1006
                <size>
1006
                <size>
1007
                 <width>16777215</width>
1007
                 <width>16777215</width>
1008
-                <height>350</height>
1008
+                <height>430</height>
1009
                </size>
1009
                </size>
1010
               </property>
1010
               </property>
1011
               <property name="toolTip">
1011
               <property name="toolTip">
1021
                <bool>true</bool>
1021
                <bool>true</bool>
1022
               </property>
1022
               </property>
1023
               <layout class="QGridLayout" name="gridLayout_9">
1023
               <layout class="QGridLayout" name="gridLayout_9">
1024
-               <item row="1" column="2">
1025
-                <widget class="Line" name="line_2">
1026
-                 <property name="orientation">
1027
-                  <enum>Qt::Horizontal</enum>
1024
+               <item row="3" column="2">
1025
+                <widget class="QLCDNumber" name="lcdH1F">
1026
+                 <property name="styleSheet">
1027
+                  <string notr="true">#lcdH1F {
1028
+  color: green;
1029
+  background: black;
1030
+}
1031
+
1032
+#lcdH1F:disabled {
1033
+  color: grey;
1034
+  background: dark grey;
1035
+}</string>
1028
                  </property>
1036
                  </property>
1029
                 </widget>
1037
                 </widget>
1030
                </item>
1038
                </item>
1031
-               <item row="8" column="1">
1032
-                <widget class="Line" name="line_8">
1039
+               <item row="13" column="1">
1040
+                <widget class="QCheckBox" name="plotHarmonic">
1041
+                 <property name="text">
1042
+                  <string>Plot</string>
1043
+                 </property>
1044
+                 <property name="checked">
1045
+                  <bool>true</bool>
1046
+                 </property>
1047
+                </widget>
1048
+               </item>
1049
+               <item row="6" column="1">
1050
+                <widget class="Line" name="line_5">
1033
                  <property name="orientation">
1051
                  <property name="orientation">
1034
                   <enum>Qt::Horizontal</enum>
1052
                   <enum>Qt::Horizontal</enum>
1035
                  </property>
1053
                  </property>
1036
                 </widget>
1054
                 </widget>
1037
                </item>
1055
                </item>
1038
-               <item row="5" column="0">
1039
-                <widget class="QLabel" name="label_33">
1056
+               <item row="0" column="0">
1057
+                <widget class="QLabel" name="label_26">
1040
                  <property name="text">
1058
                  <property name="text">
1041
-                  <string>Sub-harmonics </string>
1059
+                  <string>N freqs</string>
1042
                  </property>
1060
                  </property>
1043
                 </widget>
1061
                 </widget>
1044
                </item>
1062
                </item>
1045
-               <item row="7" column="1">
1046
-                <widget class="QDoubleSpinBox" name="f1Spin">
1063
+               <item row="8" column="0">
1064
+                <widget class="QLabel" name="label_34">
1065
+                 <property name="text">
1066
+                  <string>First harmonic 2</string>
1067
+                 </property>
1068
+                </widget>
1069
+               </item>
1070
+               <item row="2" column="1">
1071
+                <widget class="QDoubleSpinBox" name="f0Spin">
1047
                  <property name="maximum">
1072
                  <property name="maximum">
1048
                   <double>25000.000000000000000</double>
1073
                   <double>25000.000000000000000</double>
1049
                  </property>
1074
                  </property>
1075
+                 <property name="singleStep">
1076
+                  <double>0.100000000000000</double>
1077
+                 </property>
1050
                  <property name="value">
1078
                  <property name="value">
1051
                   <double>60.000000000000000</double>
1079
                   <double>60.000000000000000</double>
1052
                  </property>
1080
                  </property>
1053
                 </widget>
1081
                 </widget>
1054
                </item>
1082
                </item>
1055
-               <item row="8" column="2">
1056
-                <widget class="Line" name="line_9">
1057
-                 <property name="orientation">
1058
-                  <enum>Qt::Horizontal</enum>
1083
+               <item row="7" column="1">
1084
+                <widget class="QDoubleSpinBox" name="f1Spin">
1085
+                 <property name="maximum">
1086
+                  <double>25000.000000000000000</double>
1087
+                 </property>
1088
+                 <property name="value">
1089
+                  <double>60.000000000000000</double>
1059
                  </property>
1090
                  </property>
1060
                 </widget>
1091
                 </widget>
1061
                </item>
1092
                </item>
1062
-               <item row="3" column="0">
1063
-                <widget class="QLabel" name="label_11">
1064
-                 <property name="text">
1065
-                  <string>First harmonic 1</string>
1093
+               <item row="4" column="1">
1094
+                <widget class="QSpinBox" name="f0KNSpin">
1095
+                 <property name="minimum">
1096
+                  <number>2</number>
1097
+                 </property>
1098
+                 <property name="value">
1099
+                  <number>40</number>
1066
                  </property>
1100
                  </property>
1067
                 </widget>
1101
                 </widget>
1068
                </item>
1102
                </item>
1069
-               <item row="6" column="1">
1070
-                <widget class="Line" name="line_5">
1071
-                 <property name="orientation">
1072
-                  <enum>Qt::Horizontal</enum>
1103
+               <item row="4" column="2">
1104
+                <widget class="QLCDNumber" name="lcdHNF">
1105
+                 <property name="styleSheet">
1106
+                  <string notr="true">#lcdHNF {
1107
+  color: green;
1108
+  background: black;
1109
+}
1110
+
1111
+#lcdHNF:disabled {
1112
+  color: grey;
1113
+  background: dark grey;
1114
+}</string>
1073
                  </property>
1115
                  </property>
1074
                 </widget>
1116
                 </widget>
1075
                </item>
1117
                </item>
1080
                  </property>
1122
                  </property>
1081
                 </widget>
1123
                 </widget>
1082
                </item>
1124
                </item>
1083
-               <item row="8" column="0">
1084
-                <widget class="Line" name="line_7">
1125
+               <item row="11" column="2">
1126
+                <widget class="Line" name="line_9">
1085
                  <property name="orientation">
1127
                  <property name="orientation">
1086
                   <enum>Qt::Horizontal</enum>
1128
                   <enum>Qt::Horizontal</enum>
1087
                  </property>
1129
                  </property>
1088
                 </widget>
1130
                 </widget>
1089
                </item>
1131
                </item>
1090
-               <item row="10" column="1">
1091
-                <widget class="QCheckBox" name="plotHarmonic">
1132
+               <item row="3" column="0">
1133
+                <widget class="QLabel" name="label_11">
1092
                  <property name="text">
1134
                  <property name="text">
1093
-                  <string>Plot</string>
1094
-                 </property>
1095
-                 <property name="checked">
1096
-                  <bool>true</bool>
1135
+                  <string>First harmonic 1</string>
1097
                  </property>
1136
                  </property>
1098
                 </widget>
1137
                 </widget>
1099
                </item>
1138
                </item>
1104
                  </property>
1143
                  </property>
1105
                 </widget>
1144
                 </widget>
1106
                </item>
1145
                </item>
1107
-               <item row="4" column="2">
1108
-                <widget class="QLCDNumber" name="lcdHNF">
1109
-                 <property name="styleSheet">
1110
-                  <string notr="true">#lcdHNF {
1111
-  color: green;
1112
-  background: black;
1113
-}
1114
-
1115
-#lcdHNF:disabled {
1116
-  color: grey;
1117
-  background: dark grey;
1118
-}</string>
1146
+               <item row="11" column="1">
1147
+                <widget class="Line" name="line_8">
1148
+                 <property name="orientation">
1149
+                  <enum>Qt::Horizontal</enum>
1119
                  </property>
1150
                  </property>
1120
                 </widget>
1151
                 </widget>
1121
                </item>
1152
                </item>
1122
-               <item row="4" column="1">
1123
-                <widget class="QSpinBox" name="f0KNSpin">
1153
+               <item row="8" column="1">
1154
+                <widget class="QSpinBox" name="f1K1Spin">
1124
                  <property name="minimum">
1155
                  <property name="minimum">
1125
-                  <number>2</number>
1156
+                  <number>1</number>
1126
                  </property>
1157
                  </property>
1127
-                 <property name="value">
1128
-                  <number>40</number>
1158
+                </widget>
1159
+               </item>
1160
+               <item row="10" column="1">
1161
+                <widget class="QSpinBox" name="f1KsSpin">
1162
+                 <property name="minimum">
1163
+                  <number>1</number>
1164
+                 </property>
1165
+                 <property name="maximum">
1166
+                  <number>3</number>
1129
                  </property>
1167
                  </property>
1130
                 </widget>
1168
                 </widget>
1131
                </item>
1169
                </item>
1132
-               <item row="2" column="0">
1133
-                <widget class="QLabel" name="label_25">
1170
+               <item row="4" column="0">
1171
+                <widget class="QLabel" name="label_31">
1134
                  <property name="text">
1172
                  <property name="text">
1135
-                  <string>Base freq. 1</string>
1173
+                  <string>Last harmonic 1</string>
1136
                  </property>
1174
                  </property>
1137
                 </widget>
1175
                 </widget>
1138
                </item>
1176
                </item>
1139
-               <item row="2" column="1">
1140
-                <widget class="QDoubleSpinBox" name="f0Spin">
1141
-                 <property name="maximum">
1142
-                  <double>25000.000000000000000</double>
1143
-                 </property>
1144
-                 <property name="singleStep">
1145
-                  <double>0.100000000000000</double>
1177
+               <item row="1" column="0">
1178
+                <widget class="Line" name="line_3">
1179
+                 <property name="orientation">
1180
+                  <enum>Qt::Horizontal</enum>
1146
                  </property>
1181
                  </property>
1147
-                 <property name="value">
1148
-                  <double>60.000000000000000</double>
1182
+                </widget>
1183
+               </item>
1184
+               <item row="1" column="2">
1185
+                <widget class="Line" name="line_2">
1186
+                 <property name="orientation">
1187
+                  <enum>Qt::Horizontal</enum>
1149
                  </property>
1188
                  </property>
1150
                 </widget>
1189
                 </widget>
1151
                </item>
1190
                </item>
1152
-               <item row="3" column="2">
1153
-                <widget class="QLCDNumber" name="lcdH1F">
1191
+               <item row="5" column="2">
1192
+                <widget class="QLCDNumber" name="lcdf0NK">
1154
                  <property name="styleSheet">
1193
                  <property name="styleSheet">
1155
-                  <string notr="true">#lcdH1F {
1156
-  color: green;
1157
-  background: black;
1194
+                  <string notr="true">#lcdf0NK { 
1195
+ color: green;
1196
+ background: black;
1158
 }
1197
 }
1159
 
1198
 
1160
-#lcdH1F:disabled {
1199
+#lcdf0NK:disabled {
1161
   color: grey;
1200
   color: grey;
1162
   background: dark grey;
1201
   background: dark grey;
1163
 }</string>
1202
 }</string>
1164
                  </property>
1203
                  </property>
1204
+                 <property name="intValue" stdset="0">
1205
+                  <number>0</number>
1206
+                 </property>
1165
                 </widget>
1207
                 </widget>
1166
                </item>
1208
                </item>
1167
                <item row="7" column="0">
1209
                <item row="7" column="0">
1171
                  </property>
1213
                  </property>
1172
                 </widget>
1214
                 </widget>
1173
                </item>
1215
                </item>
1174
-               <item row="0" column="1">
1175
-                <widget class="QSpinBox" name="NHarmonicsFreqsSpin">
1216
+               <item row="3" column="1">
1217
+                <widget class="QSpinBox" name="f0K1Spin">
1176
                  <property name="minimum">
1218
                  <property name="minimum">
1177
                   <number>1</number>
1219
                   <number>1</number>
1178
                  </property>
1220
                  </property>
1179
                  <property name="maximum">
1221
                  <property name="maximum">
1180
-                  <number>1</number>
1222
+                  <number>50</number>
1181
                  </property>
1223
                  </property>
1182
                  <property name="value">
1224
                  <property name="value">
1183
                   <number>1</number>
1225
                   <number>1</number>
1184
                  </property>
1226
                  </property>
1185
                 </widget>
1227
                 </widget>
1186
                </item>
1228
                </item>
1187
-               <item row="6" column="0">
1188
-                <widget class="Line" name="line_4">
1229
+               <item row="11" column="0">
1230
+                <widget class="Line" name="line_7">
1189
                  <property name="orientation">
1231
                  <property name="orientation">
1190
                   <enum>Qt::Horizontal</enum>
1232
                   <enum>Qt::Horizontal</enum>
1191
                  </property>
1233
                  </property>
1192
                 </widget>
1234
                 </widget>
1193
                </item>
1235
                </item>
1194
-               <item row="4" column="0">
1195
-                <widget class="QLabel" name="label_31">
1196
-                 <property name="text">
1197
-                  <string>Last harmonic 1</string>
1236
+               <item row="0" column="1">
1237
+                <widget class="QSpinBox" name="NHarmonicsFreqsSpin">
1238
+                 <property name="minimum">
1239
+                  <number>1</number>
1240
+                 </property>
1241
+                 <property name="maximum">
1242
+                  <number>2</number>
1243
+                 </property>
1244
+                 <property name="value">
1245
+                  <number>1</number>
1198
                  </property>
1246
                  </property>
1199
                 </widget>
1247
                 </widget>
1200
                </item>
1248
                </item>
1214
                  </property>
1262
                  </property>
1215
                 </widget>
1263
                 </widget>
1216
                </item>
1264
                </item>
1217
-               <item row="1" column="0">
1218
-                <widget class="Line" name="line_3">
1219
-                 <property name="orientation">
1220
-                  <enum>Qt::Horizontal</enum>
1265
+               <item row="2" column="0">
1266
+                <widget class="QLabel" name="label_25">
1267
+                 <property name="text">
1268
+                  <string>Base freq. 1</string>
1221
                  </property>
1269
                  </property>
1222
                 </widget>
1270
                 </widget>
1223
                </item>
1271
                </item>
1224
-               <item row="10" column="2">
1272
+               <item row="13" column="2">
1225
                 <widget class="QPushButton" name="harmonicGO">
1273
                 <widget class="QPushButton" name="harmonicGO">
1226
                  <property name="layoutDirection">
1274
                  <property name="layoutDirection">
1227
                   <enum>Qt::LeftToRight</enum>
1275
                   <enum>Qt::LeftToRight</enum>
1235
                  </property>
1283
                  </property>
1236
                 </widget>
1284
                 </widget>
1237
                </item>
1285
                </item>
1238
-               <item row="3" column="1">
1239
-                <widget class="QSpinBox" name="f0K1Spin">
1240
-                 <property name="minimum">
1241
-                  <number>1</number>
1286
+               <item row="5" column="0">
1287
+                <widget class="QLabel" name="label_33">
1288
+                 <property name="text">
1289
+                  <string>Sub-harmonics </string>
1242
                  </property>
1290
                  </property>
1243
-                 <property name="maximum">
1244
-                  <number>50</number>
1291
+                </widget>
1292
+               </item>
1293
+               <item row="6" column="0">
1294
+                <widget class="Line" name="line_4">
1295
+                 <property name="orientation">
1296
+                  <enum>Qt::Horizontal</enum>
1245
                  </property>
1297
                  </property>
1246
-                 <property name="value">
1247
-                  <number>1</number>
1298
+                </widget>
1299
+               </item>
1300
+               <item row="10" column="2">
1301
+                <widget class="QLCDNumber" name="lcdf0NK2">
1302
+                 <property name="styleSheet">
1303
+                  <string notr="true">#lcdf0NK2 { 
1304
+ color: green;
1305
+ background: black;
1306
+}
1307
+
1308
+#lcdf0NK2:disabled {
1309
+  color: grey;
1310
+  background: dark grey;
1311
+}</string>
1248
                  </property>
1312
                  </property>
1249
                 </widget>
1313
                 </widget>
1250
                </item>
1314
                </item>
1251
-               <item row="0" column="0">
1252
-                <widget class="QLabel" name="label_26">
1253
-                 <property name="text">
1254
-                  <string>N freqs</string>
1315
+               <item row="9" column="2">
1316
+                <widget class="QLCDNumber" name="lcdHNF2">
1317
+                 <property name="styleSheet">
1318
+                  <string notr="true">#lcdHNF2 { 
1319
+ color: green;
1320
+ background: black;
1321
+}
1322
+
1323
+#lcdHNF2:disabled {
1324
+  color: grey;
1325
+  background: dark grey;
1326
+}</string>
1255
                  </property>
1327
                  </property>
1256
                 </widget>
1328
                 </widget>
1257
                </item>
1329
                </item>
1258
-               <item row="5" column="2">
1259
-                <widget class="QLCDNumber" name="lcdf0NK">
1330
+               <item row="8" column="2">
1331
+                <widget class="QLCDNumber" name="lcdH1F2">
1260
                  <property name="styleSheet">
1332
                  <property name="styleSheet">
1261
-                  <string notr="true">#lcdf0NK { 
1333
+                  <string notr="true">#lcdH1F2{ 
1262
  color: green;
1334
  color: green;
1263
  background: black;
1335
  background: black;
1264
 }
1336
 }
1265
 
1337
 
1266
-#lcdf0NK:disabled {
1338
+#lcdH1F2:disabled {
1267
   color: grey;
1339
   color: grey;
1268
   background: dark grey;
1340
   background: dark grey;
1269
 }</string>
1341
 }</string>
1270
                  </property>
1342
                  </property>
1271
-                 <property name="intValue" stdset="0">
1272
-                  <number>0</number>
1343
+                </widget>
1344
+               </item>
1345
+               <item row="9" column="0">
1346
+                <widget class="QLabel" name="label_35">
1347
+                 <property name="text">
1348
+                  <string>Last harmonic 2</string>
1349
+                 </property>
1350
+                </widget>
1351
+               </item>
1352
+               <item row="10" column="0">
1353
+                <widget class="QLabel" name="label_41">
1354
+                 <property name="text">
1355
+                  <string>Sub-harmonics</string>
1356
+                 </property>
1357
+                </widget>
1358
+               </item>
1359
+               <item row="9" column="1">
1360
+                <widget class="QSpinBox" name="f1KNSpin">
1361
+                 <property name="minimum">
1362
+                  <number>2</number>
1363
+                 </property>
1364
+                 <property name="value">
1365
+                  <number>40</number>
1273
                  </property>
1366
                  </property>
1274
                 </widget>
1367
                 </widget>
1275
                </item>
1368
                </item>
1592
               <widget class="QPushButton" name="calcQGO">
1685
               <widget class="QPushButton" name="calcQGO">
1593
                <property name="geometry">
1686
                <property name="geometry">
1594
                 <rect>
1687
                 <rect>
1595
-                 <x>380</x>
1596
-                 <y>80</y>
1688
+                 <x>400</x>
1689
+                 <y>100</y>
1597
                  <width>84</width>
1690
                  <width>84</width>
1598
                  <height>30</height>
1691
                  <height>30</height>
1599
                 </rect>
1692
                 </rect>

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

40
     res = sN-h # residual 
40
     res = sN-h # residual 
41
 
41
 
42
 def harmonicNorm (f0, sN, fs, t, k1, kN, ks): 
42
 def harmonicNorm (f0, sN, fs, t, k1, kN, ks): 
43
-    return np.linalg.norm( harmonicEuler(sN, fs, t, f0, k1, kN, ks)) 
43
+    #print ("norm diff")
44
+    #return np.linalg.norm( harmonicEuler(sN, fs, t, f0, k1, kN, ks)) 
45
+    ii =  sN < (3.* np.std(sN))
46
+    return np.linalg.norm( harmonicEuler(sN, fs, t, f0, k1, kN, ks)[ii] ) 
44
 
47
 
45
 def minHarmonic(sN, fs, t, f0, k1, kN, ks):
48
 def minHarmonic(sN, fs, t, f0, k1, kN, ks):
46
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr
49
     # CG, BFGS, Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and trust-constr

+ 8
- 2
akvo/tressel/mrsurvey.py View File

519
 
519
 
520
     #def harmonicModel(self, nF, nK, f0, f1, plot, canvas):
520
     #def harmonicModel(self, nF, nK, f0, f1, plot, canvas):
521
     
521
     
522
-    def harmonicModel(self, nF, f0, f0K1, f0KN, f0Ks, f1, plot, canvas):
522
+    def harmonicModel(self, nF, \
523
+        f0, f0K1, f0KN, f0Ks,  \
524
+        f1, f1K1, f1KN, K1Ks,  \
525
+        plot, canvas):
523
         """ nF = number of base frequencies, must be 1 or 2 
526
         """ nF = number of base frequencies, must be 1 or 2 
524
             f0 = first base frequency  
527
             f0 = first base frequency  
525
             f0K1 = first harmonic to model for first base frequency 
528
             f0K1 = first harmonic to model for first base frequency 
526
             f0KN = last harmonic to model for the first base frequency 
529
             f0KN = last harmonic to model for the first base frequency 
527
             f0Ks = subharmonic spacing, set to 1 for no subharmonics.
530
             f0Ks = subharmonic spacing, set to 1 for no subharmonics.
528
-            plot = should Akvo plot the results 
529
             f1 = second base frequency  
531
             f1 = second base frequency  
532
+            f1K1 = first harmonic to model for second base frequency 
533
+            f1KN = last harmonic to model for the second base frequency 
534
+            f1Ks = subharmonic spacing for the second base frequency, set to 1 for no subharmonics.
535
+            plot = should Akvo plot the results 
530
             canvas = mpl plotting axis      
536
             canvas = mpl plotting axis      
531
         """
537
         """
532
         #print("harmonic modelling...", f0)
538
         #print("harmonic modelling...", f0)

Loading…
Cancel
Save