[PATCH] Do not return pure NaN data

Wald Commits scm-commit at wald.intevation.org
Fri Sep 5 15:26:43 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1409923600 -7200
# Node ID 04d1d56d896b05bf11f55bba64bb7545dd23af70
# Parent  c657ddcf1fa65cde2696982f56a05f565a5e4052
Do not return pure NaN data.

diff -r c657ddcf1fa6 -r 04d1d56d896b artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Fri Sep 05 14:53:58 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Fri Sep 05 15:26:40 2014 +0200
@@ -317,12 +317,18 @@
                     results.add(result);
                 }
 
+                if (results.size() == 0) {
+                    continue;
+                }
+
                 double [][] result = average(results);
 
-                SedimentLoadDataResult.Fraction sldrf =
-                    new SedimentLoadDataResult.Fraction(ls.getDescription(),
-                                                        result, period);
-                sldr.addFraction(sldrf);
+                if (!DoubleUtil.isNaN(result[1])) {
+                    SedimentLoadDataResult.Fraction sldrf =
+                        new SedimentLoadDataResult.Fraction(
+                            ls.getDescription(), result, period);
+                    sldr.addFraction(sldrf);
+                }
             }
 
         }


More information about the Dive4Elements-commits mailing list