changeset 8361:c494f9a61490

Instead of adding datum to Q-values, correctly transform W-values to meter above datum.
author Tom Gottfried <tom@intevation.de>
date Wed, 01 Oct 2014 15:42:55 +0200
parents 75ccacd37bec
children 839032ac1523
files artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java	Wed Oct 01 15:24:21 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java	Wed Oct 01 15:42:55 2014 +0200
@@ -217,12 +217,12 @@
             log.error("No values for this gauge / discharge found.");
             return error(new WQKms[0], "no.gauge.found");
         }
-        for (int i = 0 ; i < values[0].length; i++) {
-            values[0][i] += gauge.getDatum().doubleValue();
+        for (int i = 0 ; i < values[1].length; i++) {
+            values[1][i] = values[1][i]/100d + gauge.getDatum().doubleValue();
         }
-        double [] kms = new double[values[0].length];
+        double [] kms = new double[values[1].length];
         Arrays.fill(kms, gauge.getStation().doubleValue());
-        res.add(new WQKms(kms, values[0], values[1], name, W.CENTIMETER_AT_GAUGE));
+        res.add(new WQKms(kms, values[0], values[1], name));
 
         return new CalculationResult(
             res.toArray(new WQKms[res.size()]),

http://dive4elements.wald.intevation.org