changeset 2267:46918e6a831d

Return the Qs from the "Bezugslinienverfahren, too." flys-artifacts/trunk@3924 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 06 Feb 2012 13:53:49 +0000
parents c9a40e3fdf16
children bad9a0313824
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java
diffstat 3 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Feb 06 13:20:00 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Feb 06 13:53:49 2012 +0000
@@ -1,3 +1,12 @@
+2012-02-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java(relateWs):
+	  Return the Qs of the Ws, too.
+	  
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation5.java:
+	  Adjusted to cope with the return Qs. TODO: Create WQWQ or WWQQ dataset
+	  for storing the result.
+
 2012-02-06  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java	Mon Feb 06 13:20:00 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java	Mon Feb 06 13:53:49 2012 +0000
@@ -35,11 +35,12 @@
             double [][] wws = wst.relateWs(startKm, endKm, this);
             int newNumProblems = numProblems();
 
-            if (wws.length == 2) {
+            if (wws.length == 4) {
+                // TODO: Create WQWQ instead.
                 WW ww = new WW(
                     generateName(startKm, endKm),
                     startKm, kms2gaugeDatums.get(startKm), wws[0],
-                    endKm,   kms2gaugeDatums.get(endKm),   wws[1]);
+                    endKm,   kms2gaugeDatums.get(endKm),   wws[2]);
 
                 if (newNumProblems > numProblems) {
                     ww.removeNaNs();
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Mon Feb 06 13:20:00 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Mon Feb 06 13:53:49 2012 +0000
@@ -948,21 +948,23 @@
 
         double [] ws1 = new double[numSamples];
         double [] ws2 = new double[numSamples];
+        double [] qs1 = new double[numSamples];
+        double [] qs2 = new double[numSamples];
 
         Arrays.fill(ws1, Double.NaN);
         Arrays.fill(ws2, Double.NaN);
+        Arrays.fill(qs1, Double.NaN);
+        Arrays.fill(qs2, Double.NaN);
 
         boolean hadErrors = false;
 
         double p = 0d;
         for (int i = 0; i < numSamples; ++i, p += stepWidth) {
             try {
-                double q1 = iQ1.value(p);
-                double w1 = qW1.value(q1);
-                double q2 = iQ2.value(p);
-                double w2 = qW2.value(q2);
-                ws1[i] = w1;
-                ws2[i] = w2;
+                qs1[i] = iQ1.value(p);
+                ws1[i] = qW1.value(qs1[i]);
+                qs2[i] = iQ2.value(p);
+                ws2[i] = qW2.value(qs2[i]);
             }
             catch (ArgumentOutsideDomainException aode) {
                 if (!hadErrors) {
@@ -977,7 +979,7 @@
             }
         }
 
-        return new double [][] { ws1, ws2 };
+        return new double [][] { ws1, qs1, ws2, qs2 };
     }
 
     public QPosition getQPosition(double km, double q) {

http://dive4elements.wald.intevation.org