changeset 2994:a2b265b9b2f7

FixA: corrected fitting (Q->W instead W->Q). flys-artifacts/trunk@4546 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 28 May 2012 21:34:24 +0000
parents 70469e3d34b9
children 7d33aec0b61d
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java flys-artifacts/src/main/java/de/intevation/flys/exports/DeltaWtExporter.java
diffstat 3 files changed, 14 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon May 28 20:59:27 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon May 28 21:34:24 2012 +0000
@@ -1,3 +1,13 @@
+2012-05-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java:
+	  Fit from Q to W not from W to Q!
+	  Delta w/t's are now in cm.
+	  Slimmed down fitting error report.
+
+	* src/main/java/de/intevation/flys/exports/DeltaWtExporter.java:
+	  Changed default column header of delta W to cm.
+	  
 2012-05-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	Made Delta W/t calculation work.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Mon May 28 20:59:27 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Mon May 28 21:34:24 2012 +0000
@@ -311,7 +311,7 @@
                         continue;
                     }
 
-                    double deltaW = ow[0] - nw;
+                    double deltaW = (ow[0] - nw)*100.0; // in cm
 
                     DeltaWT deltaWT = new DeltaWT(
                         deltaW,
@@ -423,29 +423,9 @@
         LevenbergMarquardtOptimizer lmo = new LevenbergMarquardtOptimizer();
         CurveFitter cf = new CurveFitter(lmo);
 
-        boolean missingWs = false;
-        boolean missingQs = false;
-
         for (int i = 0; i < ws.length; ++i) {
-            boolean ignore = false;
-            if (Double.isNaN(ws[i])) {
-                ignore = true;
-                if (!missingWs) {
-                    missingWs = true;
-                    // TODO: i18n
-                    addProblem(km, "fix.missing.w");
-                }
-            }
-            if (Double.isNaN(qs[i])) {
-                ignore = true;
-                if (!missingQs) {
-                    missingQs = true;
-                    // TODO: i18n
-                    addProblem(km, "fix.missing.q");
-                }
-            }
-            if (!ignore) {
-                cf.addObservedPoint(ws[i], qs[i]);
+            if (!Double.isNaN(ws[i]) && !Double.isNaN(qs[i])) {
+                cf.addObservedPoint(qs[i], ws[i]);
             }
         }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DeltaWtExporter.java	Mon May 28 20:59:27 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DeltaWtExporter.java	Mon May 28 21:34:24 2012 +0000
@@ -49,7 +49,7 @@
 
     public static final String DEFAULT_CSV_KM_HEADER = "km";
 
-    public static final String DEFAULT_CSV_DELTA_W_HEADER = "\u0394 W";
+    public static final String DEFAULT_CSV_DELTA_W_HEADER = "\u0394 W [cm]";
 
     public static final String DEFAULT_CSV_T_HEADER = "Datum";
 

http://dive4elements.wald.intevation.org