diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 637:f0c1250d1e7b

Make "Berechnungsart 4" work independent of flow direction. Commented out back jump correction temporarily. flys-artifacts/trunk@2013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 26 May 2011 16:54:16 +0000
parents 58276db49b16
children 2dbbb5be30a1
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu May 26 15:55:48 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu May 26 16:54:16 2011 +0000
@@ -521,7 +521,15 @@
             return new WQKms[0];
         }
 
-        double [][] segments = getSplittedDistance();
+        double [][] segments = getRanges();
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("segments ----------------- enter");
+            for (double [] segment: segments) {
+                logger.debug("  " + joinDoubles(segment));
+            }
+            logger.debug("segments ----------------- leave");
+        }
 
         if (segments.length < 1) {
             logger.warn("no segments given");
@@ -617,12 +625,14 @@
 
         ArrayList<WQKms> results = new ArrayList<WQKms>();
 
+        int referenceIndex = kmUp ?  0 : boundKms.length-1;
+
         for (int i = 0; i < iqs.length; ++i) {
             double [] iqsi = iqs[i];
 
             QPosition qPosition = wst.interpolate(
                 iqsi[0],
-                kmUp ? 0 : boundKms.length-1,
+                referenceIndex,
                 boundKms, boundWs, boundQs);
 
             if (qPosition == null) {
@@ -644,14 +654,16 @@
 
             wst.interpolate(okms, ows, oqs, qPosition, remap);
 
+            /*
             BackJumpCorrector bjc = new BackJumpCorrector();
             if (bjc.doCorrection(okms, ows)) {
                 logger.debug("Discharge longitudinal section has backjumps.");
                 results.add(new WQCKms(okms, oqs, ows, bjc.getCorrected()));
             }
             else {
+            */
                 results.add(new WQKms(okms, oqs, ows));
-            }
+            //}
         }
 
         WQKms [] wqkms = results.toArray(new WQKms[results.size()]);

http://dive4elements.wald.intevation.org