From 1290d2fcd6d0b526f8a102bcfe89ec3974011e9c Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Mon, 28 Jul 2014 17:05:21 -0500 Subject: [PATCH] Omaha #3451 extended colorbar range for grid lightning Change-Id: Ia734b28b6d1b0daf8c257d2cc72c2aca1bd2de46 Former-commit-id: dba2a973929e0316922eefb01b68681b5ea88235 [formerly 98b69171853013aeaf15b1f1e266ffc9549be5f1] [formerly a16643a3d050793492ae4f67fe39266a31f1d74d] [formerly 334f5f107e5a8b6ac0d64be70f9c85e46437330e [formerly a16643a3d050793492ae4f67fe39266a31f1d74d [formerly 7d3789e0832e7be5b0a87176cbf26509b6f3c708]]] Former-commit-id: 334f5f107e5a8b6ac0d64be70f9c85e46437330e Former-commit-id: 421b86d8c6672942d541e7ea80126eb4b2173076 [formerly c3ca0eb9349d7febd2be3d77aad218afede409e6] Former-commit-id: 4b2fe6248b17e4e7619932971491e1ce1a11cfa0 --- .../viz/lightning/GridLightningResource.java | 27 +++++++++++++++++++ .../gridLightningImageryStyleRules.xml | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cave/com.raytheon.viz.lightning/src/com/raytheon/viz/lightning/GridLightningResource.java b/cave/com.raytheon.viz.lightning/src/com/raytheon/viz/lightning/GridLightningResource.java index bd7a4f4eaf..a85a73e1c0 100644 --- a/cave/com.raytheon.viz.lightning/src/com/raytheon/viz/lightning/GridLightningResource.java +++ b/cave/com.raytheon.viz.lightning/src/com/raytheon/viz/lightning/GridLightningResource.java @@ -48,6 +48,8 @@ import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper; import com.raytheon.uf.common.numeric.filter.UnsignedFilter; import com.raytheon.uf.common.style.ParamLevelMatchCriteria; +import com.raytheon.uf.common.style.image.DataScale; +import com.raytheon.uf.common.style.image.ImagePreferences; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.cache.CacheObject; import com.raytheon.uf.viz.core.exception.VizException; @@ -69,6 +71,7 @@ import com.raytheon.viz.lightning.cache.LightningFrameRetriever; * ------------ ---------- ----------- -------------------------- * Jul 07, 2014 3333 bclement Initial creation * Jul 22, 2014 3333 bclement ignores strikes that aren't on map + * Jul 28, 2014 3451 bclement uses intended range min * * * @@ -114,8 +117,32 @@ public class GridLightningResource extends @Override protected ColorMapParameters createColorMapParameters(GeneralGridData data) throws VizException { + /* + * TODO investigate if the colormap parameter factory actually needs + * those special cases or not + */ + /* + * colormap parameter factory doesn't allow for data scale mins that are + * under 1 when you have a large max, extract the intended min from the + * style preferences and restore it in the colormap parameters + */ + float minRange = Float.NaN; + if (stylePreferences != null + && stylePreferences instanceof ImagePreferences) { + DataScale dataScale = ((ImagePreferences) stylePreferences) + .getDataScale(); + if (dataScale != null) { + Double minValue = dataScale.getMinValue(); + if (minValue != null) { + minRange = minValue.floatValue(); + } + } + } ColorMapParameters rval = super.createColorMapParameters(data); rval.setNoDataValue(0); + if (!Double.isNaN(minRange)) { + rval.setColorMapMin(minRange); + } return rval; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/utility/common_static/base/styleRules/gridLightningImageryStyleRules.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/utility/common_static/base/styleRules/gridLightningImageryStyleRules.xml index fd132b9080..d827ffabda 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/utility/common_static/base/styleRules/gridLightningImageryStyleRules.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/utility/common_static/base/styleRules/gridLightningImageryStyleRules.xml @@ -27,11 +27,11 @@ false 0.5 - 1000 + 30000 Grid/gridded data - 1 3 10 30 100 300 1000 + 1 3 10 30 100 300 1000 3000 10000 30000