comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 676:c501f27c1f71

Added error reporting to 'Dauerzahlen' calculation. flys-artifacts/trunk@2100 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 10 Jun 2011 12:38:08 +0000
parents fdc898a134a7
children a95f34f1f39a
comparison
equal deleted inserted replaced
675:8b0152363bdb 676:c501f27c1f71
32 import de.intevation.flys.artifacts.model.WQDay; 32 import de.intevation.flys.artifacts.model.WQDay;
33 import de.intevation.flys.artifacts.model.WQKms; 33 import de.intevation.flys.artifacts.model.WQKms;
34 import de.intevation.flys.artifacts.model.WstValueTable; 34 import de.intevation.flys.artifacts.model.WstValueTable;
35 import de.intevation.flys.artifacts.model.WstValueTable.QPosition; 35 import de.intevation.flys.artifacts.model.WstValueTable.QPosition;
36 import de.intevation.flys.artifacts.model.WstValueTableFactory; 36 import de.intevation.flys.artifacts.model.WstValueTableFactory;
37 import de.intevation.flys.artifacts.model.Calculation3;
37 import de.intevation.flys.artifacts.model.Calculation4; 38 import de.intevation.flys.artifacts.model.Calculation4;
38 import de.intevation.flys.artifacts.model.Segment; 39 import de.intevation.flys.artifacts.model.Segment;
39 40
40 import gnu.trove.TDoubleArrayList; 41 import gnu.trove.TDoubleArrayList;
41 42
414 Object[] obj = MainValuesFactory.getDurationCurveData(gauge); 415 Object[] obj = MainValuesFactory.getDurationCurveData(gauge);
415 416
416 int[] days = (int[]) obj[0]; 417 int[] days = (int[]) obj[0];
417 double[] qs = (double[]) obj[1]; 418 double[] qs = (double[]) obj[1];
418 419
419 double[] interpolatedW = new double[qs.length]; 420 Calculation3 calculation = new Calculation3(location, days, qs);
420 interpolatedW = wst.interpolateW(location, qs, interpolatedW); 421
421 422 // TODO: report the errors to the user.
422 WQDay wqday = new WQDay(qs.length); 423 return calculation.calculate(wst);
423
424 for (int i = 0; i < days.length; i++) {
425 wqday.add(days[i], interpolatedW[i], qs[i]);
426 }
427
428 return wqday;
429 } 424 }
430 425
431 426
432 /** 427 /**
433 * Returns the data that is computed by a discharge curve computation. 428 * Returns the data that is computed by a discharge curve computation.

http://dive4elements.wald.intevation.org