changeset 2551:a0d9a99a5d17

Fixed W->Q conversion for "W fuer ungleichwertige Abflusslaengsschnitte." flys-artifacts/trunk@4063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 16 Feb 2012 12:30:33 +0000
parents a992ab2588a8
children c7dbe696286c
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Feb 16 12:15:11 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Feb 16 12:30:33 2012 +0000
@@ -1,3 +1,8 @@
+2012-02-16  Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation4.java:
+	  Fixed W->Q conversion for "W fuer ungleichwertige Abflusslaengsschnitte."
+
 2012-02-16  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue509 (Dauerlinie: Q-Achse sollte bei 0 beginnen)
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Thu Feb 16 12:15:11 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Thu Feb 16 12:30:33 2012 +0000
@@ -9,6 +9,7 @@
 
 import de.intevation.flys.model.River;
 import de.intevation.flys.model.Gauge;
+import de.intevation.flys.model.DischargeTable;
 
 import de.intevation.flys.artifacts.model.WstValueTable.QPosition;
 
@@ -77,17 +78,21 @@
 
             // convert to Q if needed
             if (!isQ && gauge != null) {
-                double [][] table = new DischargeTables(
-                    river.getName(), gauge.getName()).getFirstTable();
+
+                DischargeTable dt = gauge.fetchMasterDischargeTable();
+
+                double [][] table =
+                    DischargeTables.loadDischargeTableValues(dt, 1);
 
                 // need the original values for naming
                 segment.backup();
 
                 for (int i = 0; i < values.length; ++i) {
-                    double w = values[i] * 100;
+                    double w = values[i] / 100.0;
                     double [] qs = DischargeTables.getQsForW(table, w);
                     if (qs.length == 0) {
                         logger.warn("No Qs found for W = " + values[i]);
+                        addProblem("cannot.find.w.for.q", values[i]);
                         values[i] = Double.NaN;
                     }
                     else {

http://dive4elements.wald.intevation.org