changeset 3106:23de6d678fba

FixA: Store into QWs if they are interpolated. flys-artifacts/trunk@4705 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 19 Jun 2012 14:01:47 +0000
parents 9592b7d76633
children cbf308f5c41b
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/artifacts/model/fixings/QW.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java
diffstat 4 files changed, 47 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Jun 19 13:55:14 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Jun 19 14:01:47 2012 +0000
@@ -27,6 +27,15 @@
 
 2012-06-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java:
+	  Store into QWs if they are interpolated.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java:
+	  Stores boolean if the values are interpolated.
+
+2012-06-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
 	* src/main/java/de/intevation/flys/artifacts/math/fitting/SQPow.java:
 	  Name derivative S'(Q).
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Tue Jun 19 13:55:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Tue Jun 19 14:01:47 2012 +0000
@@ -166,8 +166,9 @@
 
         double [] kms = DoubleUtil.explode(from, to, step / 1000.0);
 
-        final double [] qs = new double[eventColumns.size()];
-        final double [] ws = new double[qs.length];
+        final double  [] qs = new double[eventColumns.size()];
+        final double  [] ws = new double[qs.length];
+        final boolean [] interpolated = new boolean[ws.length];
 
         Fitting.QWDFactory qwdFactory = new Fitting.QWDFactory() {
             @Override
@@ -182,6 +183,7 @@
                             q, w,
                             column.getDescription(),
                             column.getDate(),
+                            interpolated[i],
                             0d);
                     }
                 }
@@ -218,8 +220,7 @@
 
             // Fill Qs and Ws from event columns.
             for (int j = 0; j < ws.length; ++j) {
-                boolean interpolated =
-                    eventColumns.get(j).getQW(km, qs, ws, j);
+                interpolated[j] = eventColumns.get(j).getQW(km, qs, ws, j);
                 // TODO: mark as interpolated.
             }
 
@@ -392,7 +393,8 @@
                         Date date = column.getDate();
                         String description = column.getDescription();
 
-                        QWD qwd = new QWD(wq[1], wq[0], description, date, dw);
+                        QWD qwd = new QWD(
+                            wq[1], wq[0], description, date, true, dw);
 
                         qwds.add(qwd);
 
@@ -417,7 +419,7 @@
                             String avgDescription = "avg.deltawt." + qSector;
 
                             QWD avgQWD = new QWD(
-                                avgQ, avgW, avgDescription, avgDate, avgDw);
+                                avgQ, avgW, avgDescription, avgDate, true, avgDw);
 
                             qSectorAverages[qSector] = avgQWD;
                         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java	Tue Jun 19 13:55:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java	Tue Jun 19 14:01:47 2012 +0000
@@ -7,10 +7,11 @@
 public class QW
 implements   Serializable
 {
-    protected double q;
-    protected double w;
-    protected String description;
-    protected Date   date;
+    protected double  q;
+    protected double  w;
+    protected String  description;
+    protected Date    date;
+    protected boolean interpolated;
 
     public QW() {
     }
@@ -20,10 +21,17 @@
         this.w = w;
     }
 
-    public QW(double q, double w, String description, Date date) {
+    public QW(
+        double  q,
+        double  w,
+        String  description, 
+        Date    date,
+        boolean interpolated
+    ) {
         this(q, w);
-        this.description = description;
-        this.date        = date;
+        this.description  = description;
+        this.date         = date;
+        this.interpolated = interpolated;
     }
 
     public double getQ() {
@@ -57,5 +65,13 @@
     public void setDescription(String description) {
         this.description = description;
     }
+
+    public boolean getInterpolated() {
+        return interpolated;
+    }
+
+    public void setInterpolated(boolean interpolated) {
+        this.interpolated = interpolated;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java	Tue Jun 19 13:55:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java	Tue Jun 19 14:01:47 2012 +0000
@@ -15,13 +15,14 @@
     }
 
     public QWD(
-        double q,
-        double w,
-        String description,
-        Date   date,
-        double deltaW
+        double  q,
+        double  w,
+        String  description,
+        Date    date,
+        boolean interpolated,
+        double  deltaW
     ) {
-        super(q, w, description, date);
+        super(q, w, description, date, interpolated);
         this.deltaW = deltaW;
     }
 

http://dive4elements.wald.intevation.org