# HG changeset patch # User Sascha L. Teichmann # Date 1329395433 0 # Node ID a0d9a99a5d17a0478be8d092e89472d4d68100b0 # Parent a992ab2588a85351a755698c84eb5661db1393fb Fixed W->Q conversion for "W fuer ungleichwertige Abflusslaengsschnitte." flys-artifacts/trunk@4063 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a992ab2588a8 -r a0d9a99a5d17 flys-artifacts/ChangeLog --- 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 + + * src/main/java/de/intevation/flys/artifacts/model/Calculation4.java: + Fixed W->Q conversion for "W fuer ungleichwertige Abflusslaengsschnitte." + 2012-02-16 Ingo Weinzierl flys/issue509 (Dauerlinie: Q-Achse sollte bei 0 beginnen) diff -r a992ab2588a8 -r a0d9a99a5d17 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java --- 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 {