Omaha #3451 extended colorbar range for grid lightning

Change-Id: Ia734b28b6d1b0daf8c257d2cc72c2aca1bd2de46

Former-commit-id: 98b6917185 [formerly a16643a3d0] [formerly 334f5f107e [formerly 7d3789e0832e7be5b0a87176cbf26509b6f3c708]]
Former-commit-id: 334f5f107e
Former-commit-id: c3ca0eb934
This commit is contained in:
Brian Clements 2014-07-28 17:05:21 -05:00
parent b8ea5967a9
commit 4b2fe6248b
2 changed files with 29 additions and 2 deletions

View file

@ -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
*
* </pre>
*
@ -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;
}

View file

@ -27,11 +27,11 @@
<interpolate>false</interpolate>
<range scale="LOG">
<minValue>0.5</minValue>
<maxValue>1000</maxValue>
<maxValue>30000</maxValue>
</range>
<defaultColormap>Grid/gridded data</defaultColormap>
<colorbarLabeling>
<values>1 3 10 30 100 300 1000</values>
<values>1 3 10 30 100 300 1000 3000 10000 30000</values>
</colorbarLabeling>
</imageStyle>
</styleRule>