diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java @ 4813:bf2fd9c58ac4

Fixed MINFO SQ calculation. * Fixed calculation of sieve 8. * Fixed calculation of 'Geschiebetransport'. * Fixed calculation of fractions (Sand, gravel, coarse).
author Raimund Renkert <rrenkert@intevation.de>
date Sun, 20 Jan 2013 15:02:19 +0100
parents 0df2247d98e1
children 61c2f739cf78 9e25c7523485
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java	Fri Jan 11 13:57:38 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java	Sun Jan 20 15:02:19 2013 +0100
@@ -1,6 +1,7 @@
 package de.intevation.flys.artifacts.model.sq;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.Date;
@@ -52,7 +53,7 @@
             "g.UFERABLINKS  AS UFERABLINKS," +
             "m.TSCHWEB      AS TSCHWEB," +
             "m.TSAND        AS TSAND," +
-            "gp.GTRIEB      AS GTRIEB," +
+            "gp.GTRIEB_F      AS GTRIEB," +
             "m.TGESCHIEBE   AS TGESCHIEBE," +
             "si.SIEB01 AS SIEB01, si.SIEB02 AS SIEB02," +
             "si.SIEB03 AS SIEB03, si.SIEB04 AS SIEB04," +
@@ -328,10 +329,6 @@
             accumulated.add(accumulate(same));
         }
 
-        for (Measurement m: accumulated) {
-            m.adjustSieves();
-        }
-
         if (debug) {
             log.debug("Before date separation: " + accumulated.size());
         }
@@ -459,10 +456,10 @@
         if (N == 1) {
             return measuments.get(0);
         }
-
         TreeMap<Double, double []> diameters =
             new TreeMap<Double, double []>(Sieve.DIAMETER_CMP);
 
+        double sumGTrieb = 0d;
         for (Measurement m: measuments) {
             for (Sieve s: m.getSieves()) {
                 Double key = s.getDiameter();
@@ -473,6 +470,8 @@
                 }
                 sum[0] += s.getLoad();
             }
+            // calculate 'Geschiebetrieb'
+            sumGTrieb += m.get("GTRIEB");
         }
         List<Sieve> accumulatedSieves = new ArrayList<Sieve>(diameters.size());
         for (Map.Entry<Double, double []> entry: diameters.entrySet()) {
@@ -480,10 +479,10 @@
                 new Sieve(entry.getKey(),
                     entry.getValue()[0]/N));
         }
-
         Map<String, Object> data =
             new HashMap<String, Object>(measuments.get(0).getData());
 
+        data.put("GTRIEB", sumGTrieb/N);
         return new Measurement(data, accumulatedSieves);
     }
 }

http://dive4elements.wald.intevation.org