comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisCalculation.java @ 9325:094ed9d1f2ad

Fixed: change of point style of interpolated data did not change in WQ chart of fixanalysis Fixed: change of point style of interpolated data did not change in dWt chart of fixanalysis; also had duplicate legend entries
author gernotbelger
date Fri, 27 Jul 2018 14:33:41 +0200
parents 5e38e2924c07
children a3f318347707
comparison
equal deleted inserted replaced
9324:058701d91552 9325:094ed9d1f2ad
128 Range range = new Range(from, to); 128 Range range = new Range(from, to);
129 129
130 int kmIndex = parameters.columnIndex("km"); 130 int kmIndex = parameters.columnIndex("km");
131 int maxQIndex = parameters.columnIndex("max_q"); 131 int maxQIndex = parameters.columnIndex("max_q");
132 132
133 double [] wq = new double[2]; 133 final double [] ws = new double[1];
134 final double [] qs = new double[1];
134 135
135 int [] parameterIndices = 136 int [] parameterIndices =
136 parameters.columnIndices(function.getParameterNames()); 137 parameters.columnIndices(function.getParameterNames());
137 138
138 double [] parameterValues = new double[parameterIndices.length]; 139 double [] parameterValues = new double[parameterIndices.length];
219 if (meta.findQSector(km) != qSector) { 220 if (meta.findQSector(km) != qSector) {
220 // Ignore not matching sectors. 221 // Ignore not matching sectors.
221 continue; 222 continue;
222 } 223 }
223 224
224 Column column = cc.getColumn(meta); 225 final Column column = cc.getColumn(meta);
225 if (column == null || !column.getQW(km, wq)) { 226 if (column == null )
226 continue; 227 continue;
227 } 228
228 229 boolean interpolated = !column.getQW(km, qs, ws, 0);
229 double fw = instance.value(wq[1]); 230 // FIXME: it was like this before... check if this has an effekt on the calculation
231 interpolated = true;
232
233 final double w = ws[0];
234 final double q = qs[0];
235 if( Double.isNaN(w) || Double.isNaN(q))
236 continue;
237
238 double fw = instance.value(q);
230 if (Double.isNaN(fw)) { 239 if (Double.isNaN(fw)) {
231 continue; 240 continue;
232 } 241 }
233 242
234 double dw = (wq[0] - fw)*100.0; 243 double dw = (w - fw)*100.0;
235 244
245
236 stdDev.increment(dw); 246 stdDev.increment(dw);
237 247
238 Date date = column.getDate(); 248 Date date = column.getDate();
239 String description = column.getDescription(); 249 String description = column.getDescription();
240 250
251
241 QWD qwd = new QWD( 252 QWD qwd = new QWD(
242 wq[1], wq[0], 253 q, w,
243 description, 254 description,
244 date, true, 255 date, interpolated,
245 dw, getIndex(col2index, column.getIndex())); 256 dw, getIndex(col2index, column.getIndex()));
246 257
247 qwds.add(qwd); 258 qwds.add(qwd);
248 259
249 sumW += wq[0]; 260 sumW += w;
250 sumQ += wq[1]; 261 sumQ += q;
251 262
252 dateAverager.add(date); 263 dateAverager.add(date);
253 } 264 }
254 265
255 // Calulate average per Q sector. 266 // Calulate average per Q sector.

http://dive4elements.wald.intevation.org