/** * Sets the geophysical no-data value which is simply the scaled "raw" no-data value * returned by {@link #getNoDataValue()}. * <p>The no-data value is used to determine valid pixels. For more information * on valid pixels, please refer to the documentation of the {@link #isPixelValid(int, int, javax.media.jai.ROI)} * method. * <p>On property change, the method calls {@link #fireProductNodeChanged(String)} with the property * name {@link #PROPERTY_NAME_NO_DATA_VALUE}. * * @param noDataValue the new geophysical no-data value * @see #setGeophysicalNoDataValue(double) * @see #isNoDataValueSet() */ public void setGeophysicalNoDataValue(double noDataValue) { setNoDataValue(scaleInverse(noDataValue)); }
public static void readCfBandAttributes(Variable variable, RasterDataNode rasterDataNode) { rasterDataNode.setDescription(variable.getDescription()); rasterDataNode.setUnit(variable.getUnitsString()); rasterDataNode.setScalingFactor(getScalingFactor(variable)); rasterDataNode.setScalingOffset(getAddOffset(variable)); final Number noDataValue = getNoDataValue(variable); if (noDataValue != null) { rasterDataNode.setNoDataValue(noDataValue.doubleValue()); rasterDataNode.setNoDataValueUsed(true); } }
targetRaster.setLog10Scaled(sourceRaster.isLog10Scaled()); targetRaster.setNoDataValueUsed(sourceRaster.isNoDataValueUsed()); targetRaster.setNoDataValue(sourceRaster.getNoDataValue()); targetRaster.setValidPixelExpression(sourceRaster.getValidPixelExpression()); if (sourceRaster instanceof Band && targetRaster instanceof Band) {
public void testSetRawNoDataValue_SetNoDataValue_UByte_WithScalingLikeAlgal_MER_RR__2P() { short noDataValue; double geophysNoDataValue; initNode(ProductData.TYPE_UINT8, 0.023622047156095505, -3.0236220359802246, true); noDataValue = 214; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); noDataValue = 120; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); }
public void testSetNoDataValue_SetNoDataValue_UByte_WithScalingLinkeAeroOptThick_MER_RR__2P() { short noDataValue; double geophysNoDataValue; initNode(ProductData.TYPE_UINT8, 0.0062992126, -0.0062992126, false); noDataValue = 87; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); noDataValue = 120; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); }
public void testSetRawNoDataValue_SetNoDataValue_UShort_WithScalingLikeReflec_MER_RR__2P() { int noDataValue; double geophysNoDataValue; initNode(ProductData.TYPE_UINT16, 1.5259255E-5, -1.5259255E-5, false); noDataValue = 1214; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); noDataValue = 120; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); }
public void testSetRawNoDataValue_SetNoDataValue_UShort_WithScalingLikeTotalSusp_MER_RR__2P() { int noDataValue; double geophysNoDataValue; initNode(ProductData.TYPE_UINT16, 0.015748031, -2.015748, true); noDataValue = 1214; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); noDataValue = 120; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(),true, noDataValue == _node.getNoDataValue()); }
public void testSetRawNoDataValue_SetNoDataValue_UShort_WithScalingLikeRadiance5_MER_RR__1P() { int noDataValue; double geophysNoDataValue; initNode(ProductData.TYPE_UINT16, 0.00940664, 0, false); noDataValue = 1214; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(), true, noDataValue == _node.getNoDataValue()); noDataValue = 120; _node.setNoDataValue(noDataValue); geophysNoDataValue = _node.getGeophysicalNoDataValue(); _node.setGeophysicalNoDataValue(4f); _node.setGeophysicalNoDataValue(geophysNoDataValue); assertEquals("Expected "+ noDataValue+" but was " + _node.getNoDataValue(),true, noDataValue == _node.getNoDataValue()); }