[PATCH] issue1418: skip MainValues with NaN values

Wald Commits scm-commit at wald.intevation.org
Mon Jul 29 14:53:04 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1375102942 -7200
# Node ID 5d071e1cb17c36f28428c1e671ed86516c3badbb
# Parent  14a18c4c8dea1a20d4f920948d2b398358f566fe
issue1418: skip MainValues with NaN values.

diff -r 14a18c4c8dea -r 5d071e1cb17c artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Mon Jul 29 12:29:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Mon Jul 29 15:02:22 2013 +0200
@@ -128,6 +128,10 @@
         StickyAxisAnnotation annotation = null;
         if (this.name.equals(DURATION_MAINVALUES_Q)) {
             for (NamedDouble q: qs) {
+                if (Double.isNaN(q.getValue())) {
+                    logger.warn("NaN MainValue " + q.getName());
+                    continue;
+                }
                 annotation =
                     new StickyAxisAnnotation(
                         q.getName(),
@@ -142,6 +146,10 @@
         }
         else {
             for (NamedDouble q: qs) {
+                if (Double.isNaN(q.getValue())) {
+                    logger.warn("NaN MainValue " + q.getName());
+                    continue;
+                }
                 annotation =
                     new StickyAxisAnnotation(
                         q.getName(),
diff -r 14a18c4c8dea -r 5d071e1cb17c artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Mon Jul 29 12:29:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Mon Jul 29 15:02:22 2013 +0200
@@ -122,6 +122,11 @@
         }
 
         for (NamedDouble w: ws) {
+            logger.debug("W Annotation at " + w.getValue() + " ("+w.getName()+")"+ wqdays);
+            if (Double.isNaN(w.getValue())) {
+                logger.warn("NaN MainValue " + w.getName());
+                continue;
+            }
             StickyAxisAnnotation annotation =
                 new StickyAxisAnnotation(
                     w.getName(),


More information about the Dive4elements-commits mailing list