org.esa.beam.framework.datamodel
Class RasterDataNode

java.lang.Object
  extended by com.bc.ceres.core.ExtensibleObject
      extended by org.esa.beam.framework.datamodel.ProductNode
          extended by org.esa.beam.framework.datamodel.DataNode
              extended by org.esa.beam.framework.datamodel.RasterDataNode
All Implemented Interfaces:
com.bc.ceres.core.Extensible, Scaling
Direct Known Subclasses:
AbstractBand, TiePointGrid

public abstract class RasterDataNode
extends DataNode
implements Scaling

The RasterDataNode class ist the abstract base class for all objects in the product package that contain rasterized data. i.e. Band and TiePointGrid. It unifies the access to raster data in the product model. A raster is considered as a rectangular raw data array with a fixed width and height. A raster data node can scale its raw raster data samples in order to return geophysically meaningful pixel values.

Author:
Norman Fomferra
See Also:
getRasterData(), getRasterWidth(), getRasterHeight(), isScalingApplied(), isLog10Scaled(), getScalingFactor(), getScalingOffset()

Nested Class Summary
 class RasterDataNode.RasterDataDoubleList
          Adapts a DoubleList
static interface RasterDataNode.RasterDataProcessor
          Deprecated. since BEAM 4.5. No direct replacement, implement a GPF operator or a SingleBandedOpImage instead.
 
Field Summary
static String INVALID_POS_TEXT
          Text returned by the getPixelString(int, int) method if no data is available at the given pixel position.
static String IO_ERROR_TEXT
          Text returned by the getPixelString(int, int) method if an I/O error occurred while pixel data was reloaded.
static String NO_DATA_TEXT
          Text returned by the getPixelString(int, int) method if no data is available at the given pixel position.
static String PROPERTY_NAME_GEOCODING
           
static String PROPERTY_NAME_IMAGE_INFO
           
static String PROPERTY_NAME_LOG_10_SCALED
           
static String PROPERTY_NAME_NO_DATA_VALUE
           
static String PROPERTY_NAME_NO_DATA_VALUE_USED
           
static String PROPERTY_NAME_ROI_DEFINITION
          Deprecated. since BEAM 4.11, no replacement
static String PROPERTY_NAME_SCALING_FACTOR
           
static String PROPERTY_NAME_SCALING_OFFSET
           
static String PROPERTY_NAME_STX
           
static String PROPERTY_NAME_VALID_PIXEL_EXPRESSION
           
 
Fields inherited from class org.esa.beam.framework.datamodel.DataNode
PROPERTY_NAME_DATA, PROPERTY_NAME_READ_ONLY, PROPERTY_NAME_SYNTHETIC, PROPERTY_NAME_UNIT
 
Fields inherited from class org.esa.beam.framework.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
 
Fields inherited from interface org.esa.beam.framework.datamodel.Scaling
IDENTITY
 
Constructor Summary
protected RasterDataNode(String name, int dataType, int width, int height)
          Constructs an object of type RasterDataNode.
 
Method Summary
abstract  void acceptVisitor(ProductVisitor visitor)
          Accepts the given visitor.
 boolean canBeOrthorectified()
          Tests if this raster data node can be orthorectified.
 void checkCompatibleRasterData(ProductData rasterData, int w, int h)
          Deprecated. since BEAM 4.11. No replacement.
 void clearNoDataValue()
          Clears the no-data value, so that isNoDataValueSet() will return false.
protected  Stx computeStxImpl(int level, com.bc.ceres.core.ProgressMonitor pm)
          Computes the statistics.
 BufferedImage createColorIndexedImage(com.bc.ceres.core.ProgressMonitor pm)
          Creates an image for this raster data node.
 ProductData createCompatibleRasterData()
          Creates raster data that is compatible to this dataset's data type.
 ProductData createCompatibleRasterData(int width, int height)
          Creates raster data that is compatible to this dataset's data type.
 ProductData createCompatibleSceneRasterData()
          Creates raster data that is compatible to this dataset's data type.
 ImageInfo createDefaultImageInfo(double[] histoSkipAreas, Histogram histogram)
          Creates an instance of a default image information.
 ImageInfo createDefaultImageInfo(double[] histoSkipAreas, com.bc.ceres.core.ProgressMonitor pm)
          Creates a default image information instance.
 IndexValidator createPixelValidator(int lineOffset, javax.media.jai.ROI roi)
          Creates a validator which can be used to validate indexes of pixels in a flat raster data buffer.
protected  Pointing createPointing()
          Creates a Pointing applicable for this raster.
 BufferedImage createRgbImage(com.bc.ceres.core.ProgressMonitor pm)
          Creates an RGB image for this raster data node.
protected abstract  RenderedImage createSourceImage()
          Creates the source image associated with this RasterDataNode.
 TransectProfileData createTransectProfileData(Shape shape)
          Creates a transect profile for the given shape (-outline).
 void dispose()
          Releases all of the resources used by this object instance and all of its owned children.
 void fireImageInfoChanged()
          Notifies listeners that the image (display) information has changed.
 GeoCoding getGeoCoding()
          Returns the geo-coding of this RasterDataNode.
 int getGeophysicalDataType()
          Returns the geophysical data type of this RasterDataNode.
 com.bc.ceres.glevel.MultiLevelImage getGeophysicalImage()
           
 double getGeophysicalNoDataValue()
          Gets the geophysical no-data value which is simply the scaled "raw" no-data value returned by getNoDataValue().
 ImageInfo getImageInfo()
          Gets the image information for image display.
 ImageInfo getImageInfo(double[] histoSkipAreas, com.bc.ceres.core.ProgressMonitor pm)
          Gets the image creation information.
 ImageInfo getImageInfo(com.bc.ceres.core.ProgressMonitor pm)
          Returns the image information for this raster data node.
 double getNoDataValue()
          Gets the no-data value as a primitive double.
 ProductNodeGroup<Mask> getOverlayMaskGroup()
           
abstract  double getPixelDouble(int x, int y)
          Deprecated. since BEAM 4.11. Use getSampleFloat(int, int) instead.
abstract  float getPixelFloat(int x, int y)
          Deprecated. since BEAM 4.11. Use getSampleFloat(int, int) instead.
abstract  int getPixelInt(int x, int y)
          Deprecated. since BEAM 4.11. Use getSampleInt(int, int) instead.
 double[] getPixels(int x, int y, int w, int h, double[] pixels)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  double[] getPixels(int x, int y, int w, int h, double[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 float[] getPixels(int x, int y, int w, int h, float[] pixels)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  float[] getPixels(int x, int y, int w, int h, float[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 int[] getPixels(int x, int y, int w, int h, int[] pixels)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  int[] getPixels(int x, int y, int w, int h, int[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 String getPixelString(int x, int y)
          Returns the pixel located at (x,y) as a string value.
 Pointing getPointing()
          Gets a Pointing if one is available for this raster.
 ProductData getRasterData()
          Deprecated. Since BEAM 4.11. Use getSourceImage() or the various readPixels() method variants to retrieve or read raster data.
 int getRasterHeight()
          Returns the height of the raster used by this product raster.
 int getRasterWidth()
          Returns the width of the raster used by this product raster.
 ProductNodeGroup<Mask> getRoiMaskGroup()
          Deprecated. since BEAM 4.10 (no replacement)
 float getSampleFloat(int x, int y)
          Gets a geo-physical sample value at the given pixel coordinate as float value.
 int getSampleInt(int x, int y)
          Gets a geo-physical sample value at the given pixel coordinate as int value.
 double getScalingFactor()
          Gets the scaling factor which is applied to raw ProductData.
 double getScalingOffset()
          Gets the scaling offset which is applied to raw ProductData.
abstract  ProductData getSceneRasterData()
          Deprecated. since BEAM 4.11, use getSourceImage() instead.
 int getSceneRasterHeight()
          Returns the height in pixels of the scene represented by this product raster.
 int getSceneRasterWidth()
          Returns the width in pixels of the scene represented by this product raster.
 com.bc.ceres.glevel.MultiLevelImage getSourceImage()
          Gets the source image associated with this RasterDataNode.
 Stx getStx()
          Gets the statistics.
 Stx getStx(boolean accurate, com.bc.ceres.core.ProgressMonitor pm)
          Gets the statistics.
 String getValidMaskExpression()
          Gets the expression used for the computation of the mask which identifies valid pixel values.
 com.bc.ceres.glevel.MultiLevelImage getValidMaskImage()
          Gets the valid-mask image associated with this RasterDataNode.
 String getValidPixelExpression()
          Gets the expression that is used to determine whether a pixel is valid or not.
 Shape getValidShape()
          Gets the shape of the area where this raster data contains valid samples.
 boolean hasIntPixels()
          Determines whether this raster data node contains integer samples.
 boolean hasRasterData()
          Deprecated. since BEAM 4.11. No replacement.
 boolean isCompatibleRasterData(ProductData rasterData, int w, int h)
          Deprecated. since BEAM 4.11. No replacement.
 boolean isFloatingPointType()
          Returns true if the pixel data contained in this band is "naturally" a floating point number type.
 boolean isGeophysicalImageSet()
          Returns whether the geophysical image is set on this RasterDataNode.
 boolean isLog10Scaled()
          Gets whether or not the ProductData of this band has a negative binominal distribution and thus the common logarithm (base 10) of the values is stored in the raw data.
 boolean isNoDataValueSet()
          Tests whether or not a no-data value has been specified.
 boolean isNoDataValueUsed()
          Tests whether or not the no-data value is used.
 boolean isPixelValid(int pixelIndex)
          Checks whether or not the pixel located at (x,y) is valid.
 boolean isPixelValid(int x, int y)
          Checks whether or not the pixel located at (x,y) is valid.
 boolean isPixelValid(int x, int y, javax.media.jai.ROI roi)
          Checks whether or not the pixel located at (x,y) is valid.
 boolean isScalingApplied()
          Tests whether scaling of raw raster data values is applied before they are returned as geophysically meaningful pixel values.
 boolean isSourceImageSet()
          Returns whether the source image is set on this RasterDataNode.
 boolean isStxSet()
           
 boolean isValidMaskImageSet()
          Returns wether the valid mask image is set on this RasterDataNode.
static boolean isValidMaskProperty(String propertyName)
          Tests if the given name is the name of a property which is relevant for the computation of the valid mask.
 boolean isValidMaskUsed()
          Tests whether or not this raster data node uses a data-mask in order to determine valid pixels.
 void loadRasterData()
          Deprecated. since BEAM 4.11. No replacement.
 void loadRasterData(com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. No replacement.
protected  void processRasterData(String message, RasterDataNode.RasterDataProcessor processor, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.5. No direct replacement, implement a GPF operator or a SingleBandedOpImage instead.
 void quantizeRasterData(double newMin, double newMax, double gamma, byte[] samples, int offset, int stride, com.bc.ceres.core.ProgressMonitor pm)
           
 byte[] quantizeRasterData(double newMin, double newMax, double gamma, com.bc.ceres.core.ProgressMonitor pm)
           
 double[] readPixels(int x, int y, int w, int h, double[] pixels)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  double[] readPixels(int x, int y, int w, int h, double[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 float[] readPixels(int x, int y, int w, int h, float[] pixels)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  float[] readPixels(int x, int y, int w, int h, float[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 int[] readPixels(int x, int y, int w, int h, int[] pixels)
           
abstract  int[] readPixels(int x, int y, int w, int h, int[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 void readRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  void readRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 void readRasterDataFully()
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
abstract  void readRasterDataFully(com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use getSourceImage() instead.
 boolean[] readValidMask(int x, int y, int w, int h, boolean[] validMask)
           
 void resetValidMask()
          Resets the valid mask of this raster.
 double scale(double v)
          Applies the scaling v * scalingFactor + scalingOffset the the given input value.
 double scaleInverse(double v)
          Applies the inverse scaling (v - scalingOffset) / scalingFactor the the given input value.
 void setGeoCoding(GeoCoding geoCoding)
          Sets the geo-coding for this RasterDataNode.
 void setGeophysicalNoDataValue(double noDataValue)
          Sets the geophysical no-data value which is simply the scaled "raw" no-data value returned by getNoDataValue().
 void setImageInfo(ImageInfo imageInfo)
          Sets the image information for image display.
protected  void setImageInfo(ImageInfo imageInfo, boolean change)
           
 void setLog10Scaled(boolean log10Scaled)
          Sets whether or not the ProductData of this band has a negative binominal distribution and thus the common logarithm (base 10) of the values is stored in the raw data.
 void setModified(boolean modified)
          Sets this node's modified flag.
 void setNoDataValue(double noDataValue)
          Sets the no-data value as a primitive double.
 void setNoDataValueUsed(boolean noDataValueUsed)
          Sets whether or not the no-data value is used.
abstract  void setPixelDouble(int x, int y, double pixelValue)
          Deprecated. since BEAM 4.11. No replacement.
abstract  void setPixelFloat(int x, int y, float pixelValue)
          Deprecated. since BEAM 4.11. No replacement.
abstract  void setPixelInt(int x, int y, int pixelValue)
          Deprecated. since BEAM 4.11. No replacement.
abstract  void setPixels(int x, int y, int w, int h, double[] pixels)
          Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
abstract  void setPixels(int x, int y, int w, int h, float[] pixels)
          Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
abstract  void setPixels(int x, int y, int w, int h, int[] pixels)
          Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
 void setRasterData(ProductData rasterData)
          Deprecated. Since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
 void setScalingFactor(double scalingFactor)
          Sets the scaling factor which is applied to raw ProductData.
 void setScalingOffset(double scalingOffset)
          Sets the scaling offset which is applied to raw ProductData.
 void setSourceImage(com.bc.ceres.glevel.MultiLevelImage sourceImage)
          Sets the source image associated with this RasterDataNode.
 void setSourceImage(RenderedImage sourceImage)
          Sets the source image associated with this RasterDataNode.
 void setStx(Stx stx)
          Sets the statistics.
 void setValidPixelExpression(String validPixelExpression)
          Sets the expression that is used to determine whether a pixel is valid or not.
 void unloadRasterData()
          Deprecated. since BEAM 4.11. No replacement.
 void updateExpression(String oldExternalName, String newExternalName)
          Asks a product node to replace all occurences of and references to the node name given by oldExternalName with oldExternalName.
 void writePixels(int x, int y, int w, int h, double[] pixels)
           
abstract  void writePixels(int x, int y, int w, int h, double[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Writes the range of given pixels specified to the specified coordinates as doubles.
 void writePixels(int x, int y, int w, int h, float[] pixels)
           
abstract  void writePixels(int x, int y, int w, int h, float[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Writes the range of given pixels specified to the specified coordinates as floats.
 void writePixels(int x, int y, int w, int h, int[] pixels)
           
abstract  void writePixels(int x, int y, int w, int h, int[] pixels, com.bc.ceres.core.ProgressMonitor pm)
          Writes the range of given pixels specified to the specified coordinates as integers.
 void writeRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData)
          Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
abstract  void writeRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData, com.bc.ceres.core.ProgressMonitor pm)
          Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.
 void writeRasterDataFully()
           
abstract  void writeRasterDataFully(com.bc.ceres.core.ProgressMonitor pm)
          Writes the complete underlying raster data.
 
Methods inherited from class org.esa.beam.framework.datamodel.DataNode
checkDataCompatibility, createCompatibleProductData, fireProductNodeDataChanged, getData, getDataElems, getDataElemSize, getDataType, getNumDataElems, getRawStorageSize, getUnit, isReadOnly, isSynthetic, setData, setDataElems, setReadOnly, setSynthetic, setUnit
 
Methods inherited from class org.esa.beam.framework.datamodel.ProductNode
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setOwner, toString
 
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_NAME_IMAGE_INFO

public static final String PROPERTY_NAME_IMAGE_INFO
See Also:
Constant Field Values

PROPERTY_NAME_LOG_10_SCALED

public static final String PROPERTY_NAME_LOG_10_SCALED
See Also:
Constant Field Values

PROPERTY_NAME_ROI_DEFINITION

@Deprecated
public static final String PROPERTY_NAME_ROI_DEFINITION
Deprecated. since BEAM 4.11, no replacement
See Also:
Constant Field Values

PROPERTY_NAME_SCALING_FACTOR

public static final String PROPERTY_NAME_SCALING_FACTOR
See Also:
Constant Field Values

PROPERTY_NAME_SCALING_OFFSET

public static final String PROPERTY_NAME_SCALING_OFFSET
See Also:
Constant Field Values

PROPERTY_NAME_NO_DATA_VALUE

public static final String PROPERTY_NAME_NO_DATA_VALUE
See Also:
Constant Field Values

PROPERTY_NAME_NO_DATA_VALUE_USED

public static final String PROPERTY_NAME_NO_DATA_VALUE_USED
See Also:
Constant Field Values

PROPERTY_NAME_VALID_PIXEL_EXPRESSION

public static final String PROPERTY_NAME_VALID_PIXEL_EXPRESSION
See Also:
Constant Field Values

PROPERTY_NAME_GEOCODING

public static final String PROPERTY_NAME_GEOCODING
See Also:
Constant Field Values

PROPERTY_NAME_STX

public static final String PROPERTY_NAME_STX
See Also:
Constant Field Values

NO_DATA_TEXT

public static final String NO_DATA_TEXT
Text returned by the getPixelString(int, int) method if no data is available at the given pixel position.

See Also:
Constant Field Values

INVALID_POS_TEXT

public static final String INVALID_POS_TEXT
Text returned by the getPixelString(int, int) method if no data is available at the given pixel position.

See Also:
Constant Field Values

IO_ERROR_TEXT

public static final String IO_ERROR_TEXT
Text returned by the getPixelString(int, int) method if an I/O error occurred while pixel data was reloaded.

See Also:
Constant Field Values
Constructor Detail

RasterDataNode

protected RasterDataNode(String name,
                         int dataType,
                         int width,
                         int height)
Constructs an object of type RasterDataNode.

Parameters:
name - the name of the new object
dataType - the data type used by the raster, must be one of the multiple ProductData.TYPE_X constants, with the exception of ProductData.TYPE_UINT32
width - the width of the raster in pixels
height - the height of the raster in pixels
Method Detail

getSceneRasterWidth

public int getSceneRasterWidth()
Returns the width in pixels of the scene represented by this product raster. By default, the method simply returns getRasterWidth().

Returns:
the scene width in pixels

getSceneRasterHeight

public int getSceneRasterHeight()
Returns the height in pixels of the scene represented by this product raster. By default, the method simply returns getRasterHeight().

Returns:
the scene height in pixels

getRasterWidth

public final int getRasterWidth()
Returns the width of the raster used by this product raster.

Returns:
the width of the raster

getRasterHeight

public final int getRasterHeight()
Returns the height of the raster used by this product raster.

Returns:
the height of the raster

setModified

public void setModified(boolean modified)
Description copied from class: ProductNode
Sets this node's modified flag.

If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.

Overrides:
setModified in class ProductNode
Parameters:
modified - whether or not this node is beeing marked as modified.
See Also:
Product.fireNodeChanged(org.esa.beam.framework.datamodel.ProductNode, java.lang.String, java.lang.Object, java.lang.Object)

getGeoCoding

public GeoCoding getGeoCoding()
Returns the geo-coding of this RasterDataNode.

Returns:
the geo-coding

setGeoCoding

public void setGeoCoding(GeoCoding geoCoding)
Sets the geo-coding for this RasterDataNode. Also sets the geo-coding of the parent Product if it has no geo-coding yet.

On property change, the method calls ProductNode.fireProductNodeChanged(String) with the property name PROPERTY_NAME_GEOCODING.

Parameters:
geoCoding - the new geo-coding
See Also:
Product.setGeoCoding(GeoCoding)

createPointing

protected Pointing createPointing()
Creates a Pointing applicable for this raster.

Returns:
the pointing object, or null if a pointing is not available

getPointing

public Pointing getPointing()
Gets a Pointing if one is available for this raster. The methods calls createPointing() if a pointing has not been set so far or if its GeoCoding changed since the last creation of this raster's Pointing instance.

Returns:
the pointing object, or null if a pointing is not available

canBeOrthorectified

public boolean canBeOrthorectified()
Tests if this raster data node can be orthorectified.

Returns:
true, if so

isFloatingPointType

public boolean isFloatingPointType()
Returns true if the pixel data contained in this band is "naturally" a floating point number type.

Overrides:
isFloatingPointType in class DataNode
Returns:
true, if so

getGeophysicalDataType

public int getGeophysicalDataType()
Returns the geophysical data type of this RasterDataNode. The value returned is always one of the ProductData.TYPE_XXX constants.

Returns:
the geophysical data type
See Also:
ProductData, isScalingApplied()

getScalingFactor

public final double getScalingFactor()
Gets the scaling factor which is applied to raw ProductData. The default value is 1.0 (no factor).

Returns:
the scaling factor
See Also:
isScalingApplied()

setScalingFactor

public final void setScalingFactor(double scalingFactor)
Sets the scaling factor which is applied to raw ProductData.

Parameters:
scalingFactor - the scaling factor
See Also:
isScalingApplied()

getScalingOffset

public final double getScalingOffset()
Gets the scaling offset which is applied to raw ProductData. The default value is 0.0 (no offset).

Returns:
the scaling offset
See Also:
isScalingApplied()

setScalingOffset

public final void setScalingOffset(double scalingOffset)
Sets the scaling offset which is applied to raw ProductData.

Parameters:
scalingOffset - the scaling offset
See Also:
isScalingApplied()

isLog10Scaled

public final boolean isLog10Scaled()
Gets whether or not the ProductData of this band has a negative binominal distribution and thus the common logarithm (base 10) of the values is stored in the raw data. The default value is false.

Returns:
whether or not the data is logging-10 scaled
See Also:
isScalingApplied()

setLog10Scaled

public final void setLog10Scaled(boolean log10Scaled)
Sets whether or not the ProductData of this band has a negative binominal distribution and thus the common logarithm (base 10) of the values is stored in the raw data.

Parameters:
log10Scaled - whether or not the data is logging-10 scaled
See Also:
isScalingApplied()

isScalingApplied

public final boolean isScalingApplied()
Tests whether scaling of raw raster data values is applied before they are returned as geophysically meaningful pixel values.

The methods which return geophysical pixel values are all getPixels(int, int, int, int, int[]), setPixels(int, int, int, int, int[]), readPixels(int, int, int, int, int[]) and writePixels(int, int, int, int, int[]) methods as well as the getPixel<Type> and setPixel<Type> methods such as getPixelFloat(int, int) * and setPixelFloat(int, int, float).

Returns:
true if a conversion is applyied to raw data samples before the are retuned.
See Also:
getScalingOffset(), getScalingFactor(), isLog10Scaled()

isValidMaskProperty

public static boolean isValidMaskProperty(String propertyName)
Tests if the given name is the name of a property which is relevant for the computation of the valid mask.

Parameters:
propertyName - the name to test
Returns:
true, if so.
Since:
BEAM 4.2

isNoDataValueSet

public boolean isNoDataValueSet()
Tests whether or not a no-data value has been specified. The no-data value is not-specified unless either setNoDataValue(double) or setGeophysicalNoDataValue(double) is called.

Returns:
true, if so
See Also:
isNoDataValueUsed(), setNoDataValue(double)

clearNoDataValue

public void clearNoDataValue()
Clears the no-data value, so that isNoDataValueSet() will return false.


isNoDataValueUsed

public boolean isNoDataValueUsed()
Tests whether or not the no-data value is used.

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

Returns:
true, if so
See Also:
setNoDataValueUsed(boolean), isNoDataValueSet()

setNoDataValueUsed

public void setNoDataValueUsed(boolean noDataValueUsed)
Sets whether or not the no-data value is used. If the no-data value is enabled and the no-data value has not been set so far, a default no-data value it is set with a value of to zero.

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

On property change, the method calls ProductNode.fireProductNodeChanged(String) with the property name PROPERTY_NAME_NO_DATA_VALUE_USED.

Parameters:
noDataValueUsed - true, if so
See Also:
isNoDataValueUsed()

getNoDataValue

public double getNoDataValue()
Gets the no-data value as a primitive double.

Note that the value returned is NOT necessarily the same as the value returned by getGeophysicalNoDataValue() because no scaling is applied.

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

The method returns 0.0, if no no-data value has been specified so far.

Returns:
the no-data value. It is returned as a double in order to cover all other numeric types.
See Also:
setNoDataValue(double), isNoDataValueSet()

setNoDataValue

public void setNoDataValue(double noDataValue)
Sets the no-data value as a primitive double.

Note that the given value is related to the "raw", un-scaled raster data. In order to set the geophysical, scaled no-data value use the method setGeophysicalNoDataValue(double).

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

On property change, the method calls ProductNode.fireProductNodeChanged(String) with the property name PROPERTY_NAME_NO_DATA_VALUE.

Parameters:
noDataValue - the no-data value. It is passed as a double in order to cover all other numeric types.
See Also:
getNoDataValue(), isNoDataValueSet()

getGeophysicalNoDataValue

public double getGeophysicalNoDataValue()
Gets the geophysical no-data value which is simply the scaled "raw" no-data value returned by getNoDataValue().

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

Returns:
the geophysical no-data value
See Also:
setGeophysicalNoDataValue(double)

setGeophysicalNoDataValue

public void setGeophysicalNoDataValue(double noDataValue)
Sets the geophysical no-data value which is simply the scaled "raw" no-data value returned by getNoDataValue().

The no-data value is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

On property change, the method calls ProductNode.fireProductNodeChanged(String) with the property name PROPERTY_NAME_NO_DATA_VALUE.

Parameters:
noDataValue - the new geophysical no-data value
See Also:
setGeophysicalNoDataValue(double), isNoDataValueSet()

getValidPixelExpression

public String getValidPixelExpression()
Gets the expression that is used to determine whether a pixel is valid or not. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

Returns:
the valid mask expression.

setValidPixelExpression

public void setValidPixelExpression(String validPixelExpression)
Sets the expression that is used to determine whether a pixel is valid or not.

The valid-pixel expression is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

On property change, the method calls ProductNode.fireProductNodeChanged(String) with the property name PROPERTY_NAME_VALID_PIXEL_EXPRESSION.

Parameters:
validPixelExpression - the valid mask expression, can be null

isValidMaskUsed

public boolean isValidMaskUsed()
Tests whether or not this raster data node uses a data-mask in order to determine valid pixels. The method returns true if either isValidPixelExpressionSet() or isNoDataValueUsed() returns true.

The data-mask is used to determine valid pixels. For more information on valid pixels, please refer to the documentation of the isPixelValid(int, int, javax.media.jai.ROI) method.

Returns:
true, if so

resetValidMask

public void resetValidMask()
Resets the valid mask of this raster. The mask will be lazily regenerated when requested the next time.


getValidMaskExpression

public String getValidMaskExpression()
Gets the expression used for the computation of the mask which identifies valid pixel values. It recognizes the value of the noDataValue and the validPixelExpression properties, if any. The method returns null, if none of these properties are set.

Returns:
The expression used for the computation of the mask which identifies valid pixel values, or null.
Since:
BEAM 4.2
See Also:
getValidPixelExpression(), getNoDataValue()

updateExpression

public void updateExpression(String oldExternalName,
                             String newExternalName)
Asks a product node to replace all occurences of and references to the node name given by oldExternalName with oldExternalName. Such references most often occur in band arithmetic expressions.

Overrides:
updateExpression in class ProductNode
Parameters:
oldExternalName - The old node name.
newExternalName - The new node name.

getSceneRasterData

@Deprecated
public abstract ProductData getSceneRasterData()
Deprecated. since BEAM 4.11, use getSourceImage() instead.

Gets a raster data holding this dataset's pixel data for an entire product scene. If the data has'nt been loaded so far the method returns null.

In oposite to the getRasterData method, this method returns raster data that has at least getBandOutputRasterWidth()*getBandOutputRasterHeight() elements of the given data type to store the scene's pixels.

Returns:
raster data covering the pixels for a complete scene
See Also:
getRasterData(), getRasterWidth(), getRasterHeight(), getSceneRasterWidth(), getSceneRasterHeight()

hasRasterData

@Deprecated
public boolean hasRasterData()
Deprecated. since BEAM 4.11. No replacement.

Returns true if the raster data of this RasterDataNode is loaded or elsewhere available, otherwise false.

Returns:
true, if so.

getRasterData

@Deprecated
public ProductData getRasterData()
Deprecated. Since BEAM 4.11. Use getSourceImage() or the various readPixels() method variants to retrieve or read raster data.

Gets the raster data for this dataset. If the data hasn't been loaded so far the method returns null.

Returns:
the raster data for this band, or null if data has not been loaded

setRasterData

@Deprecated
public void setRasterData(ProductData rasterData)
Deprecated. Since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Sets the raster data of this dataset.

Note that this method does not copy data at all. If the supplied raster data is compatible with this product raster, then simply its reference is stored. Modifications in the supplied raster data will also affect this dataset's data!

Parameters:
rasterData - the raster data for this dataset
See Also:
getRasterData()

loadRasterData

@Deprecated
public void loadRasterData()
                    throws IOException
Deprecated. since BEAM 4.11. No replacement.

Throws:
IOException - if an I/O error occurs
See Also:
loadRasterData(com.bc.ceres.core.ProgressMonitor)

loadRasterData

@Deprecated
public void loadRasterData(com.bc.ceres.core.ProgressMonitor pm)
                    throws IOException
Deprecated. since BEAM 4.11. No replacement.

Loads the raster data for this RasterDataNode. After this method has been called successfully, hasRasterData() should always return true and getRasterData() should always return a valid ProductData instance with at least getRasterWidth()*getRasterHeight() elements (samples).

The default implementation of this method does nothing.

Parameters:
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs
See Also:
unloadRasterData()

unloadRasterData

@Deprecated
public void unloadRasterData()
Deprecated. since BEAM 4.11. No replacement.

Un-loads the raster data for this RasterDataNode.

It is up to the implementation whether after this method has been called successfully, the hasRasterData() method returns false or true.

The default implementation of this method does nothing.

See Also:
loadRasterData()

dispose

public void dispose()
Releases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.

This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to dispose() are undefined.

Overrides of this method should always call super.dispose(); after disposing this instance.

Overrides:
dispose in class DataNode

isPixelValid

public boolean isPixelValid(int x,
                            int y)
Checks whether or not the pixel located at (x,y) is valid. A pixel is assumed to be valid either if validMaskImage is null or or if the bit corresponding to (x,y) is set within the returned mask image.

Note: Implementation changed by Norman (2011-08-09) in order to increase performance since a synchronised block was used due to problem with the JAI ROI class that has been used in the former implementation.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
Returns:
true if the pixel is valid
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds
See Also:
isPixelValid(int, int, javax.media.jai.ROI), setNoDataValueUsed(boolean), setNoDataValue(double), setValidPixelExpression(String)

getSampleInt

public int getSampleInt(int x,
                        int y)
Gets a geo-physical sample value at the given pixel coordinate as int value.

Note: This method does not belong to the public API. It has been added by Norman (2011-08-09) in order to perform performance tests.

Parameters:
x - pixel X coordinate
y - pixel Y coordinate
Returns:
The geo-physical sample value.

getSampleFloat

public float getSampleFloat(int x,
                            int y)
Gets a geo-physical sample value at the given pixel coordinate as float value.

Note: This method does not belong to the public API. It has been added by Norman (2011-08-09) in order to perform performance tests.

Parameters:
x - pixel X coordinate
y - pixel Y coordinate
Returns:
The geo-physical sample value.

isPixelValid

public boolean isPixelValid(int pixelIndex)
Checks whether or not the pixel located at (x,y) is valid. A pixel is assumed to be valid either if validMaskImage is null or or if the bit corresponding to (x,y) is set within the returned mask image.

Parameters:
pixelIndex - the linear pixel index in the range 0 to width * height - 1
Returns:
true if the pixel is valid
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds
Since:
4.1
See Also:
isPixelValid(int, int, javax.media.jai.ROI), setNoDataValueUsed(boolean), setNoDataValue(double), setValidPixelExpression(String)

isPixelValid

public boolean isPixelValid(int x,
                            int y,
                            javax.media.jai.ROI roi)
Checks whether or not the pixel located at (x,y) is valid. The method first test whether a pixel is valid by using the isPixelValid(int, int) method, and secondly, if the pixel is within the ROI (if any).

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
roi - the ROI, if null the method returns isPixelValid(int, int)
Returns:
true if the pixel is valid
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds
See Also:
isPixelValid(int, int), setNoDataValueUsed(boolean), setNoDataValue(double), setValidPixelExpression(String)

getPixelInt

@Deprecated
public abstract int getPixelInt(int x,
                                           int y)
Deprecated. since BEAM 4.11. Use getSampleInt(int, int) instead.

Returns the pixel located at (x,y) as an integer value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
Returns:
the pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

getPixelFloat

@Deprecated
public abstract float getPixelFloat(int x,
                                               int y)
Deprecated. since BEAM 4.11. Use getSampleFloat(int, int) instead.

Returns the pixel located at (x,y) as a float value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
Returns:
the pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

getPixelDouble

@Deprecated
public abstract double getPixelDouble(int x,
                                                 int y)
Deprecated. since BEAM 4.11. Use getSampleFloat(int, int) instead.

Returns the pixel located at (x,y) as a double value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
Returns:
the pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

setPixelInt

@Deprecated
public abstract void setPixelInt(int x,
                                            int y,
                                            int pixelValue)
Deprecated. since BEAM 4.11. No replacement.

Sets the pixel located at (x,y) to the given integer value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
pixelValue - the new pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

setPixelFloat

@Deprecated
public abstract void setPixelFloat(int x,
                                              int y,
                                              float pixelValue)
Deprecated. since BEAM 4.11. No replacement.

Sets the pixel located at (x,y) to the given float value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
pixelValue - the new pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

setPixelDouble

@Deprecated
public abstract void setPixelDouble(int x,
                                               int y,
                                               double pixelValue)
Deprecated. since BEAM 4.11. No replacement.

Sets the pixel located at (x,y) to the given double value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
pixelValue - the new pixel value at (x,y)
Throws:
ArrayIndexOutOfBoundsException - if the co-ordinates are not in bounds

getPixels

@Deprecated
public int[] getPixels(int x,
                                  int y,
                                  int w,
                                  int h,
                                  int[] pixels)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

See Also:
getPixels(int, int, int, int, int[], ProgressMonitor)

getPixels

@Deprecated
public abstract int[] getPixels(int x,
                                           int y,
                                           int w,
                                           int h,
                                           int[] pixels,
                                           com.bc.ceres.core.ProgressMonitor pm)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the range of pixels specified by the coordinates as integer array. Throws exception when the data is not read from disk yet. If the given array is null a new one was created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read.
pixels - integer array to be filled with data
pm - a monitor to inform the user about progress

getPixels

@Deprecated
public float[] getPixels(int x,
                                    int y,
                                    int w,
                                    int h,
                                    float[] pixels)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

See Also:
getPixels(int, int, int, int, float[], ProgressMonitor)

getPixels

@Deprecated
public abstract float[] getPixels(int x,
                                             int y,
                                             int w,
                                             int h,
                                             float[] pixels,
                                             com.bc.ceres.core.ProgressMonitor pm)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the range of pixels specified by the coordinates as float array. Throws exception when the data is not read from disk yet. If the given array is null a new one is created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read.
pixels - float array to be filled with data
pm - a monitor to inform the user about progress

getPixels

@Deprecated
public double[] getPixels(int x,
                                     int y,
                                     int w,
                                     int h,
                                     double[] pixels)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

See Also:
getPixels(int, int, int, int, double[], ProgressMonitor)

getPixels

@Deprecated
public abstract double[] getPixels(int x,
                                              int y,
                                              int w,
                                              int h,
                                              double[] pixels,
                                              com.bc.ceres.core.ProgressMonitor pm)
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the range of pixels specified by the coordinates as double array. Throws exception when the data is not read from disk yet. If the given array is null a new one is created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read.
pixels - double array to be filled with data
pm - a monitor to inform the user about progress

setPixels

@Deprecated
public abstract void setPixels(int x,
                                          int y,
                                          int w,
                                          int h,
                                          int[] pixels)
Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Sets a range of pixels specified by the coordinates as integer array. Copies the data to the memory buffer of data at the specified location. Throws exception when the target buffer is not in memory.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written.
pixels - integer array to be written
Throws:
NullPointerException - if this band has no raster data

setPixels

@Deprecated
public abstract void setPixels(int x,
                                          int y,
                                          int w,
                                          int h,
                                          float[] pixels)
Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Sets a range of pixels specified by the coordinates as float array. Copies the data to the memory buffer of data at the specified location. Throws exception when the target buffer is not in memory.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written.
pixels - float array to be written
Throws:
NullPointerException - if this band has no raster data

setPixels

@Deprecated
public abstract void setPixels(int x,
                                          int y,
                                          int w,
                                          int h,
                                          double[] pixels)
Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Sets a range of pixels specified by the coordinates as double array. Copies the data to the memory buffer of data at the specified location. Throws exception when the target buffer is not in memory.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written.
pixels - double array to be written
Throws:
NullPointerException - if this band has no raster data

readPixels

public int[] readPixels(int x,
                        int y,
                        int w,
                        int h,
                        int[] pixels)
                 throws IOException
Throws:
IOException
See Also:
readPixels(int, int, int, int, int[], ProgressMonitor)

readPixels

@Deprecated
public abstract int[] readPixels(int x,
                                            int y,
                                            int w,
                                            int h,
                                            int[] pixels,
                                            com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the band data at the given offset (x, y), width and height as int data. If the data is already in memory, it merely copies the data to the buffer provided. If not, it calls the attached product reader to retrieve the data from the disk file. If the given buffer is null a new one was created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read
pixels - array to be filled with data
pm - a progress monitor
Returns:
the pixels read
Throws:
IOException

readPixels

@Deprecated
public float[] readPixels(int x,
                                     int y,
                                     int w,
                                     int h,
                                     float[] pixels)
                   throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Throws:
IOException
See Also:
readPixels(int, int, int, int, float[], ProgressMonitor)

readPixels

@Deprecated
public abstract float[] readPixels(int x,
                                              int y,
                                              int w,
                                              int h,
                                              float[] pixels,
                                              com.bc.ceres.core.ProgressMonitor pm)
                            throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the band data at the given offset (x, y), width and height as float data. If the data is already in memory, it merely copies the data to the buffer provided. If not, it calls the attached product reader to retrieve the data from the disk file. If the given buffer is null a new one was created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read
pixels - array to be filled with data
pm - a progress monitor
Returns:
the pixels read
Throws:
IOException

readPixels

@Deprecated
public double[] readPixels(int x,
                                      int y,
                                      int w,
                                      int h,
                                      double[] pixels)
                    throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Throws:
IOException
See Also:
readPixels(int, int, int, int, double[], ProgressMonitor)

readPixels

@Deprecated
public abstract double[] readPixels(int x,
                                               int y,
                                               int w,
                                               int h,
                                               double[] pixels,
                                               com.bc.ceres.core.ProgressMonitor pm)
                             throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Retrieves the band data at the given offset (x, y), width and height as double data. If the data is already in memory, it merely copies the data to the buffer provided. If not, it calls the attached product reader to retrieve the data from the disk file. If the given buffer is null a new one was created and returned.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be read
h - height of the pixel array to be read
pixels - array to be filled with data
pm - a progress monitor
Returns:
the pixels read
Throws:
IOException

writePixels

public void writePixels(int x,
                        int y,
                        int w,
                        int h,
                        int[] pixels)
                 throws IOException
Throws:
IOException
See Also:
writePixels(int, int, int, int, int[], ProgressMonitor)

writePixels

public abstract void writePixels(int x,
                                 int y,
                                 int w,
                                 int h,
                                 int[] pixels,
                                 com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Writes the range of given pixels specified to the specified coordinates as integers.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written
pixels - array of pixels to write
pm - a progress monitor
Throws:
IOException

writePixels

public void writePixels(int x,
                        int y,
                        int w,
                        int h,
                        float[] pixels)
                 throws IOException
Throws:
IOException
See Also:
writePixels(int, int, int, int, float[], ProgressMonitor)

writePixels

public abstract void writePixels(int x,
                                 int y,
                                 int w,
                                 int h,
                                 float[] pixels,
                                 com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Writes the range of given pixels specified to the specified coordinates as floats.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written
pixels - array of pixels to write
pm - a progress monitor
Throws:
IOException

writePixels

public void writePixels(int x,
                        int y,
                        int w,
                        int h,
                        double[] pixels)
                 throws IOException
Throws:
IOException
See Also:
writePixels(int, int, int, int, double[], ProgressMonitor)

writePixels

public abstract void writePixels(int x,
                                 int y,
                                 int w,
                                 int h,
                                 double[] pixels,
                                 com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Writes the range of given pixels specified to the specified coordinates as doubles.

Parameters:
x - x offset into the band
y - y offset into the band
w - width of the pixel array to be written
h - height of the pixel array to be written
pixels - array of pixels to write
pm - a progress monitor
Throws:
IOException

readValidMask

public boolean[] readValidMask(int x,
                               int y,
                               int w,
                               int h,
                               boolean[] validMask)
                        throws IOException
Throws:
IOException

readRasterDataFully

@Deprecated
public void readRasterDataFully()
                         throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Throws:
IOException - if an I/O error occurs
See Also:
readRasterDataFully(ProgressMonitor)

readRasterDataFully

@Deprecated
public abstract void readRasterDataFully(com.bc.ceres.core.ProgressMonitor pm)
                                  throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Reads the complete underlying raster data.

After this method has been called successfully, hasRasterData() should always return true and getRasterData() should always return a valid ProductData instance with at least getRasterWidth()*getRasterHeight() elements (samples).

In opposite to the loadRasterData method, the readRasterDataFully method always reloads the data of this product raster, independently of whether its has already been loaded or not.

Parameters:
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs
See Also:
loadRasterData(), readRasterData(int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)

readRasterData

@Deprecated
public void readRasterData(int offsetX,
                                      int offsetY,
                                      int width,
                                      int height,
                                      ProductData rasterData)
                    throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

Reads raster data from the node's associated data source into the given data buffer.

Parameters:
offsetX - the X-offset in the raster co-ordinates where reading starts
offsetY - the Y-offset in the raster co-ordinates where reading starts
width - the width of the raster data buffer
height - the height of the raster data buffer
rasterData - a raster data buffer receiving the pixels to be read
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if the raster is null
IllegalStateException - if this product raster was not added to a product so far, or if the product to which this product raster belongs to, has no associated product reader
See Also:
ProductReader.readBandRasterData(Band, int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)

readRasterData

@Deprecated
public abstract void readRasterData(int offsetX,
                                               int offsetY,
                                               int width,
                                               int height,
                                               ProductData rasterData,
                                               com.bc.ceres.core.ProgressMonitor pm)
                             throws IOException
Deprecated. since BEAM 4.11. Use getSourceImage() instead.

The method behaves exactly as readRasterData(int, int, int, int, ProductData), but clients can additionally pass a ProgressMonitor.

Parameters:
offsetX - the X-offset in the raster co-ordinates where reading starts
offsetY - the Y-offset in the raster co-ordinates where reading starts
width - the width of the raster data buffer
height - the height of the raster data buffer
rasterData - a raster data buffer receiving the pixels to be read
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if the raster is null
IllegalStateException - if this product raster was not added to a product so far, or if the product to which this product raster belongs to, has no associated product reader

writeRasterDataFully

public void writeRasterDataFully()
                          throws IOException
Throws:
IOException

writeRasterDataFully

public abstract void writeRasterDataFully(com.bc.ceres.core.ProgressMonitor pm)
                                   throws IOException
Writes the complete underlying raster data.

Parameters:
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs

writeRasterData

@Deprecated
public void writeRasterData(int offsetX,
                                       int offsetY,
                                       int width,
                                       int height,
                                       ProductData rasterData)
                     throws IOException
Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Throws:
IOException

writeRasterData

@Deprecated
public abstract void writeRasterData(int offsetX,
                                                int offsetY,
                                                int width,
                                                int height,
                                                ProductData rasterData,
                                                com.bc.ceres.core.ProgressMonitor pm)
                              throws IOException
Deprecated. since BEAM 4.11. Use setSourceImage() or the various readPixels() method variants to set or write raster data.

Writes data from this product raster into the specified region of the user-supplied raster.

It is important to know that this method does not change this product raster's internal state nor does it write into this product raster's internal raster.

Parameters:
rasterData - a raster data buffer receiving the pixels to be read
offsetX - the X-offset in raster co-ordinates where reading starts
offsetY - the Y-offset in raster co-ordinates where reading starts
width - the width of the raster data buffer
height - the height of the raster data buffer
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if the raster is null
IllegalStateException - if this product raster was not added to a product so far, or if the product to which this product raster belongs to, has no associated product reader
See Also:
ProductReader.readBandRasterData(Band, int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)

createCompatibleRasterData

public ProductData createCompatibleRasterData()
Creates raster data that is compatible to this dataset's data type. The data buffer returned contains exactly getRasterWidth()*getRasterHeight() elements of a compatible data type.

Returns:
raster data compatible with this product raster
See Also:
createCompatibleSceneRasterData()

createCompatibleSceneRasterData

public ProductData createCompatibleSceneRasterData()
Creates raster data that is compatible to this dataset's data type. The data buffer returned contains exactly getBandOutputRasterWidth()*getBandOutputRasterHeight() elements of a compatible data type.

Returns:
raster data compatible with this product raster
See Also:
createCompatibleRasterData()

createCompatibleRasterData

public ProductData createCompatibleRasterData(int width,
                                              int height)
Creates raster data that is compatible to this dataset's data type. The data buffer returned contains exactly width*height elements of a compatible data type.

Parameters:
width - the width of the raster data to be created
height - the height of the raster data to be created
Returns:
raster data compatible with this product raster
See Also:
createCompatibleRasterData(), createCompatibleSceneRasterData()

isCompatibleRasterData

@Deprecated
public boolean isCompatibleRasterData(ProductData rasterData,
                                                 int w,
                                                 int h)
Deprecated. since BEAM 4.11. No replacement.

Tests whether the given parameters specify a compatible raster or not.

Parameters:
rasterData - the raster data
w - the raster width
h - the raster height
Returns:
true if so

checkCompatibleRasterData

@Deprecated
public void checkCompatibleRasterData(ProductData rasterData,
                                                 int w,
                                                 int h)
Deprecated. since BEAM 4.11. No replacement.

Throws an IllegalArgumentException if the given parameters dont specify a compatible raster.

Parameters:
rasterData - the raster data
w - the raster width
h - the raster height

hasIntPixels

public boolean hasIntPixels()
Determines whether this raster data node contains integer samples.

Returns:
true if this raster data node contains integer samples.

createTransectProfileData

public TransectProfileData createTransectProfileData(Shape shape)
                                              throws IOException
Creates a transect profile for the given shape (-outline).

Parameters:
shape - the shape
Returns:
the profile data
Throws:
IOException - if an I/O error occurs

acceptVisitor

public abstract void acceptVisitor(ProductVisitor visitor)
Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.

Specified by:
acceptVisitor in class DataNode
Parameters:
visitor - the visitor, must not be null

getImageInfo

public ImageInfo getImageInfo()
Gets the image information for image display.

Returns:
the image info or null

setImageInfo

public void setImageInfo(ImageInfo imageInfo)
Sets the image information for image display.

Parameters:
imageInfo - the image info, can be null

setImageInfo

protected void setImageInfo(ImageInfo imageInfo,
                            boolean change)

fireImageInfoChanged

public void fireImageInfoChanged()
Notifies listeners that the image (display) information has changed.

Since:
BEAM 4.7

getImageInfo

public final ImageInfo getImageInfo(com.bc.ceres.core.ProgressMonitor pm)
Returns the image information for this raster data node.

The method simply returns the value of ensureValidImageInfo(null, ProgressMonitor.NULL).

Parameters:
pm - A progress monitor.
Returns:
A valid image information instance.
Since:
BEAM 4.2
See Also:
getImageInfo(double[], ProgressMonitor)

getImageInfo

public final ImageInfo getImageInfo(double[] histoSkipAreas,
                                    com.bc.ceres.core.ProgressMonitor pm)
Gets the image creation information.

If no image information has been assigned before, the createDefaultImageInfo(double[], com.bc.ceres.core.ProgressMonitor) method is called with the given parameters passed to this method.

Parameters:
histoSkipAreas - Only used, if new image info is created (see createDefaultImageInfo(double[], com.bc.ceres.core.ProgressMonitor) method).
pm - A progress monitor.
Returns:
The image creation information.
Since:
BEAM 4.2

createDefaultImageInfo

public ImageInfo createDefaultImageInfo(double[] histoSkipAreas,
                                        com.bc.ceres.core.ProgressMonitor pm)
Creates a default image information instance.

An IllegalStateException is thrown in the case that this raster data node has no raster data.

Parameters:
histoSkipAreas - the left (at index 0) and right (at index 1) normalized areas of the raster data histogram to be excluded when determining the value range for a linear constrast stretching. Can be null, in this case {0.01, 0.04} resp. 5% of the entire area is skipped.
pm - a monitor to inform the user about progress
Returns:
a valid image information instance, never null.

createDefaultImageInfo

public final ImageInfo createDefaultImageInfo(double[] histoSkipAreas,
                                              Histogram histogram)
Creates an instance of a default image information.

An IllegalStateException is thrown in the case that this raster data node has no raster data.

Parameters:
histoSkipAreas - the left (at index 0) and right (at index 1) normalized areas of the raster data histogram to be excluded when determining the value range for a linear constrast stretching. Can be null, in this case {0.01, 0.04} resp. 5% of the entire area is skipped.
histogram - the histogram to create the image information.
Returns:
a valid image information instance, never null.

getOverlayMaskGroup

public ProductNodeGroup<Mask> getOverlayMaskGroup()
Returns:
The overlay mask group.

createColorIndexedImage

public BufferedImage createColorIndexedImage(com.bc.ceres.core.ProgressMonitor pm)
                                      throws IOException
Creates an image for this raster data node. The method simply returns ProductUtils.createColorIndexedImage(this, null).

Parameters:
pm - a monitor to inform the user about progress
Returns:
a greyscale/palette-based image for this raster data node
Throws:
IOException - if the raster data is not loaded so far and reload causes an I/O error
See Also:
setImageInfo(ImageInfo)

createRgbImage

public BufferedImage createRgbImage(com.bc.ceres.core.ProgressMonitor pm)
                             throws IOException
Creates an RGB image for this raster data node.

Parameters:
pm - a monitor to inform the user about progress
Returns:
a greyscale/palette-based image for this raster data node
Throws:
IOException - if the raster data is not loaded so far and reload causes an I/O error
See Also:
setImageInfo(ImageInfo)

quantizeRasterData

public byte[] quantizeRasterData(double newMin,
                                 double newMax,
                                 double gamma,
                                 com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Throws:
IOException

quantizeRasterData

public void quantizeRasterData(double newMin,
                               double newMax,
                               double gamma,
                               byte[] samples,
                               int offset,
                               int stride,
                               com.bc.ceres.core.ProgressMonitor pm)
                        throws IOException
Throws:
IOException

createPixelValidator

public IndexValidator createPixelValidator(int lineOffset,
                                           javax.media.jai.ROI roi)
                                    throws IOException
Creates a validator which can be used to validate indexes of pixels in a flat raster data buffer.

Parameters:
lineOffset - the absolute line offset, zero based
roi - an optional ROI
Returns:
a new validator instance, never null
Throws:
IOException - if an I/O error occurs

scale

public final double scale(double v)
Applies the scaling v * scalingFactor + scalingOffset the the given input value. If the log10Scaled property is true, the result is taken to the power of 10 after the actual scaling.

Specified by:
scale in interface Scaling
Parameters:
v - the input value
Returns:
the scaled value

scaleInverse

public final double scaleInverse(double v)
Applies the inverse scaling (v - scalingOffset) / scalingFactor the the given input value. If the log10Scaled property is true, the common logarithm is applied to the input before the actual scaling.

Specified by:
scaleInverse in interface Scaling
Parameters:
v - the input value
Returns:
the scaled value

getPixelString

public String getPixelString(int x,
                             int y)
Returns the pixel located at (x,y) as a string value.

Parameters:
x - the X co-ordinate of the pixel location
y - the Y co-ordinate of the pixel location
Returns:
the pixel value at (x,y) as string or an error message text

isSourceImageSet

public boolean isSourceImageSet()
Returns whether the source image is set on this RasterDataNode.

Returns:
whether the source image is set.
Since:
BEAM 4.5
See Also:
getSourceImage(), setSourceImage(java.awt.image.RenderedImage), setSourceImage(com.bc.ceres.glevel.MultiLevelImage), createSourceImage()

getSourceImage

public com.bc.ceres.glevel.MultiLevelImage getSourceImage()
Gets the source image associated with this RasterDataNode.

Returns:
The source image. Never null. In the case that isSourceImageSet() returns false, the method createSourceImage() will be called in order to set and return a valid source image.
Since:
BEAM 4.2
See Also:
createSourceImage(), isSourceImageSet()

createSourceImage

protected abstract RenderedImage createSourceImage()
Creates the source image associated with this RasterDataNode. This shall preferably be a MultiLevelImage instance.

Returns:
A new source image instance.
Since:
BEAM 4.5

setSourceImage

public void setSourceImage(RenderedImage sourceImage)
Sets the source image associated with this RasterDataNode.

Parameters:
sourceImage - The source image. Can be null. If so, isSourceImageSet() will return false.
Since:
BEAM 4.2

setSourceImage

public void setSourceImage(com.bc.ceres.glevel.MultiLevelImage sourceImage)
Sets the source image associated with this RasterDataNode.

Parameters:
sourceImage - The source image. Can be null. If so, isSourceImageSet() will return false.
Since:
BEAM 4.6

isGeophysicalImageSet

public boolean isGeophysicalImageSet()
Returns whether the geophysical image is set on this RasterDataNode.

This method belongs to preliminary API and may be removed or changed in the future.

Returns:
whether the geophysical image is set.
Since:
BEAM 4.6

getGeophysicalImage

public com.bc.ceres.glevel.MultiLevelImage getGeophysicalImage()
Returns:
The geophysical source image.
Since:
BEAM 4.5

isValidMaskImageSet

public boolean isValidMaskImageSet()
Returns wether the valid mask image is set on this RasterDataNode.

Returns:
Wether the source image is set.
Since:
BEAM 4.5

getValidMaskImage

public com.bc.ceres.glevel.MultiLevelImage getValidMaskImage()
Gets the valid-mask image associated with this RasterDataNode.

Returns:
The rendered image.
Since:
BEAM 4.2

isStxSet

public boolean isStxSet()

getStx

public Stx getStx()
Gets the statistics. If statistcs are not yet available, the method will compute (possibly inaccurate) statistics and return those.

If accurate statistics are required, the getStx(boolean, com.bc.ceres.core.ProgressMonitor) shall be used instead.

This method belongs to preliminary API and may be removed or changed in the future.

Returns:
The statistics.
Since:
BEAM 4.2, revised in BEAM 4.5
See Also:
getStx(boolean, com.bc.ceres.core.ProgressMonitor), setStx(Stx)

getStx

public Stx getStx(boolean accurate,
                  com.bc.ceres.core.ProgressMonitor pm)
Gets the statistics. If the statistics have not been set before they are computed using the given progress monitor pm and then set. This method belongs to preliminary API and may be removed or changed in the future.

Parameters:
accurate - If true, accurate statistics are computed.
pm - A progress monitor which is used to compute the new statistics, if required.
Returns:
The statistics.
Since:
since BEAM 4.5

setStx

public void setStx(Stx stx)
Sets the statistics. It is the responsibility of the caller to ensure that the given statistics are really related to this RasterDataNode's raster data. The method fires a property change event for the property PROPERTY_NAME_STX. This method belongs to preliminary API and may be removed or changed in the future.

Parameters:
stx - The statistics.
Since:
BEAM 4.2, revised in BEAM 4.5

computeStxImpl

protected Stx computeStxImpl(int level,
                             com.bc.ceres.core.ProgressMonitor pm)
Computes the statistics. May be overridden. This method belongs to preliminary API and may be removed or changed in the future.

Parameters:
level - The resolution level.
pm - A progress monitor.
Returns:
The statistics.
Since:
BEAM 4.5

getValidShape

public Shape getValidShape()
Gets the shape of the area where this raster data contains valid samples. The method returns null, if the entire raster contains valid samples.

Returns:
The shape of the area where the raster data has samples, can be null.
Since:
BEAM 4.7

getRoiMaskGroup

@Deprecated
public ProductNodeGroup<Mask> getRoiMaskGroup()
Deprecated. since BEAM 4.10 (no replacement)

Returns:
The roi mask group.

processRasterData

@Deprecated
protected void processRasterData(String message,
                                            RasterDataNode.RasterDataProcessor processor,
                                            com.bc.ceres.core.ProgressMonitor pm)
                          throws IOException
Deprecated. since BEAM 4.5. No direct replacement, implement a GPF operator or a SingleBandedOpImage instead.

Throws:
IOException


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.