public abstract class RasterDataNode extends DataNode implements Scaling, SceneTransformProvider
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.Modifier and Type | Class and Description |
---|---|
static interface |
RasterDataNode.RasterDataProcessor
A raster data processor which is called for a set of raster lines to be processed.
|
PROPERTY_NAME_DATA, PROPERTY_NAME_READ_ONLY, PROPERTY_NAME_SYNTHETIC, PROPERTY_NAME_UNIT
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
Modifier | Constructor and Description |
---|---|
protected |
RasterDataNode(String name,
int dataType,
long numElems)
Constructs an object of type
RasterDataNode . |
Modifier and Type | Method and Description |
---|---|
abstract void |
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.
|
void |
addAncillaryVariable(RasterDataNode variable,
String... relations)
Adds an associated ancillary variable and sets its relation names.
|
boolean |
canBeOrthorectified()
Tests if this raster data node can be orthorectified.
|
void |
checkCompatibleRasterData(ProductData rasterData,
int w,
int h)
Throws an
IllegalArgumentException if the given parameters dont specify a compatible raster. |
void |
clearNoDataValue()
Clears the no-data value, so that
isNoDataValueSet() will return false . |
protected Stx |
computeStxImpl(int level,
ProgressMonitor pm)
Computes the statistics.
|
BufferedImage |
createColorIndexedImage(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,
ProgressMonitor pm)
Creates a default image information instance.
|
MultiLevelModel |
createMultiLevelModel()
Create a multi-level image model suited for source and geo-physical images returned by this
RasterDataNode |
protected Pointing |
createPointing()
Creates a
Pointing applicable for this raster. |
BufferedImage |
createRgbImage(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.
|
String[] |
getAncillaryRelations()
Gets the names of an ancillary relations to another raster data node.
|
RasterDataNode |
getAncillaryVariable(String... relations)
Finds the first associated ancillary band for the specified relations.
|
RasterDataNode[] |
getAncillaryVariables(String... relations)
Finds any associated ancillary band for the specified relation.
|
GeoCoding |
getGeoCoding()
Returns the geo-coding of this
RasterDataNode . |
int |
getGeophysicalDataType()
Returns the geophysical data type of this
RasterDataNode . |
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,
ProgressMonitor pm)
Gets the image creation information.
|
ImageInfo |
getImageInfo(ProgressMonitor pm)
Returns the image information for this raster data node.
|
AffineTransform |
getImageToModelTransform()
Gets the transformation used to convert this raster's image (pixel) coordinates to model coordinates
used for rendering the image together with other images and vector data.
|
MathTransform2D |
getModelToSceneTransform()
Gets the transformation that transforms from local
RasterDataNode model coordinates
to the Product 's scene coordinates. |
MultiLevelModel |
getMultiLevelModel()
Gets the multi-level image (image pyramid) model that describes an image pyramid layout.
|
double |
getNoDataValue()
Gets the no-data value as a primitive
double . |
ProductNodeGroup<Mask> |
getOverlayMaskGroup() |
abstract double |
getPixelDouble(int x,
int y)
Returns the pixel located at (x,y) as a double value.
|
abstract float |
getPixelFloat(int x,
int y)
Returns the pixel located at (x,y) as a float value.
|
abstract int |
getPixelInt(int x,
int y)
Returns the pixel located at (x,y) as an integer value.
|
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,
ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as double array.
|
float[] |
getPixels(int x,
int y,
int w,
int h,
float[] pixels) |
abstract float[] |
getPixels(int x,
int y,
int w,
int h,
float[] pixels,
ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as float array.
|
int[] |
getPixels(int x,
int y,
int w,
int h,
int[] pixels) |
abstract int[] |
getPixels(int x,
int y,
int w,
int h,
int[] pixels,
ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as integer array.
|
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()
Gets the raster data for this dataset.
|
abstract int |
getRasterHeight() |
Dimension |
getRasterSize() |
abstract int |
getRasterWidth() |
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 . |
MathTransform2D |
getSceneToModelTransform()
Gets the transformation that transforms from the
Product 's scene coordinates
to the local RasterDataNode model coordinates. |
MultiLevelImage |
getSourceImage()
Gets the source image associated with this
RasterDataNode . |
Stx |
getStx()
Gets the statistics.
|
Stx |
getStx(boolean accurate,
ProgressMonitor pm)
Gets the statistics.
|
TimeCoding |
getTimeCoding()
Gets the time-coding of this
RasterDataNode . |
String |
getValidMaskExpression()
Gets the expression used for the computation of the mask which identifies valid pixel values.
|
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()
Returns true if the raster data of this
RasterDataNode is loaded or elsewhere available, otherwise
false. |
boolean |
isCompatibleRasterData(ProductData rasterData,
int w,
int h)
Tests whether the given parameters specify a compatible raster or not.
|
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 binomial 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() |
void |
loadRasterData(ProgressMonitor pm)
Loads the raster data for this
RasterDataNode . |
void |
processRasterData(String message,
RasterDataNode.RasterDataProcessor processor,
ProgressMonitor pm)
Processes the raster's data.
|
void |
quantizeRasterData(double newMin,
double newMax,
double gamma,
byte[] samples,
int offset,
int stride,
ProgressMonitor pm) |
byte[] |
quantizeRasterData(double newMin,
double newMax,
double gamma,
ProgressMonitor pm) |
double[] |
readPixels(int x,
int y,
int w,
int h,
double[] pixels) |
abstract double[] |
readPixels(int x,
int y,
int w,
int h,
double[] pixels,
ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as int data.
|
float[] |
readPixels(int x,
int y,
int w,
int h,
float[] pixels) |
abstract float[] |
readPixels(int x,
int y,
int w,
int h,
float[] pixels,
ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as int data.
|
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,
ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as int data.
|
void |
readRasterData(int offsetX,
int offsetY,
int width,
int height,
ProductData rasterData)
Reads raster data from the node's associated data source into the given data
buffer.
|
abstract void |
readRasterData(int offsetX,
int offsetY,
int width,
int height,
ProductData rasterData,
ProgressMonitor pm)
The method behaves exactly as
readRasterData(int, int, int, int, ProductData) ,
but clients can additionally pass a ProgressMonitor . |
void |
readRasterDataFully() |
abstract void |
readRasterDataFully(ProgressMonitor pm)
Reads the complete underlying raster data.
|
boolean[] |
readValidMask(int x,
int y,
int w,
int h,
boolean[] validMask) |
void |
removeAncillaryVariable(RasterDataNode variable)
Removes an associated ancillary variable.
|
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 |
setAncillaryRelations(String... relations)
Sets the names of an ancillary relations to another raster data node.
|
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 |
setImageToModelTransform(AffineTransform imageToModelTransform)
Sets the transformation used to convert this raster's image (pixel) coordinates to model coordinates
used for rendering the image together with other images and vector data.
|
void |
setLog10Scaled(boolean log10Scaled)
Sets whether or not the
ProductData of this band has a negative binomial distribution and
thus the common logarithm (base 10) of the values is stored in the raw data. |
void |
setModelToSceneTransform(MathTransform2D modelToSceneTransform)
Sets a
MathTransform2D from the local model CRS of this RasterDataNode to
a Product 's scene coordinate reference system. |
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)
Sets the pixel located at (x,y) to the given double value.
|
abstract void |
setPixelFloat(int x,
int y,
float pixelValue)
Sets the pixel located at (x,y) to the given float value.
|
abstract void |
setPixelInt(int x,
int y,
int pixelValue)
Sets the pixel located at (x,y) to the given integer value.
|
abstract void |
setPixels(int x,
int y,
int w,
int h,
double[] pixels)
Sets a range of pixels specified by the coordinates as double array.
|
abstract void |
setPixels(int x,
int y,
int w,
int h,
float[] pixels)
Sets a range of pixels specified by the coordinates as float array.
|
abstract void |
setPixels(int x,
int y,
int w,
int h,
int[] pixels)
Sets a range of pixels specified by the coordinates as integer array.
|
void |
setRasterData(ProductData rasterData)
Sets the raster data of this dataset.
|
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 |
setSceneToModelTransform(MathTransform2D sceneToModelTransform)
Sets a
MathTransform2D from a Product 's scene coordinate reference system to
the local model CRS of this RasterDataNode . |
void |
setSourceImage(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 |
setTimeCoding(TimeCoding timeCoding)
Sets the time-coding for this
RasterDataNode . |
void |
setValidPixelExpression(String validPixelExpression)
Sets the expression that is used to determine whether a pixel is valid or not.
|
void |
unloadRasterData()
Un-loads the raster data for this
RasterDataNode . |
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,
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,
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,
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) |
abstract void |
writeRasterData(int offsetX,
int offsetY,
int width,
int height,
ProductData rasterData,
ProgressMonitor pm)
Writes data from this product raster into the specified region of the user-supplied raster.
|
void |
writeRasterDataFully() |
abstract void |
writeRasterDataFully(ProgressMonitor pm)
Writes the complete underlying raster data.
|
checkDataCompatibility, createCompatibleProductData, fireProductNodeDataChanged, getData, getDataElems, getDataElemSize, getDataType, getNumDataElems, getRawStorageSize, getUnit, isReadOnly, isSynthetic, setData, setDataElems, setReadOnly, setSynthetic, setUnit
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setOwner, toString
getExtension
public static final String PROPERTY_NAME_IMAGE_INFO
public static final String PROPERTY_NAME_LOG_10_SCALED
public static final String PROPERTY_NAME_SCALING_FACTOR
public static final String PROPERTY_NAME_SCALING_OFFSET
public static final String PROPERTY_NAME_NO_DATA_VALUE
public static final String PROPERTY_NAME_NO_DATA_VALUE_USED
public static final String PROPERTY_NAME_VALID_PIXEL_EXPRESSION
public static final String PROPERTY_NAME_GEO_CODING
public static final String PROPERTY_NAME_TIME_CODING
public static final String PROPERTY_NAME_STX
public static final String PROPERTY_NAME_ANCILLARY_VARIABLES
public static final String PROPERTY_NAME_ANCILLARY_RELATIONS
public static final String PROPERTY_NAME_IMAGE_TO_MODEL_TRANSFORM
public static final String PROPERTY_NAME_MODEL_TO_SCENE_TRANSFORM
public static final String PROPERTY_NAME_SCENE_TO_MODEL_TRANSFORM
public static final String NO_DATA_TEXT
getPixelString(int, int)
method if no data is available at the given pixel
position.public static final String INVALID_POS_TEXT
getPixelString(int, int)
method if no data is available at the given pixel
position.public static final String IO_ERROR_TEXT
getPixelString(int, int)
method if an I/O error occurred while pixel data was
reloaded.protected RasterDataNode(String name, int dataType, long numElems)
RasterDataNode
.name
- the name of the new objectdataType
- the data type used by the raster, must be one of the multiple ProductData.TYPE_X
constants, with the exception of ProductData.TYPE_UINT32
numElems
- the number of elements in this data node.public abstract int getRasterWidth()
public abstract int getRasterHeight()
public Dimension getRasterSize()
public void setModified(boolean modified)
ProductNode
If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.
setModified
in class ProductNode
modified
- whether or not this node is beeing marked as modified.Product.fireNodeChanged(org.esa.snap.core.datamodel.ProductNode, java.lang.String, java.lang.Object, java.lang.Object)
public AffineTransform getImageToModelTransform()
If this raster data node's (source image is set
)
the image-to-model transformation
of the image pyramid's
lowest level image is returned.
Otherwise the transformation which has been set using the setImageToModelTransform(AffineTransform)
is returned.
If the transformation was not set explicitly, the method tries to determine it from geo-codings.
If this fails, the identity transform is returned.
ProductNode.getProduct()
,
Product.getSceneCRS()
,
setImageToModelTransform(AffineTransform)
,
getSourceImage()
,
getGeoCoding()
public void setImageToModelTransform(AffineTransform imageToModelTransform)
The method call will fail if this raster data node has already a source image which uses a different image-to-model transformation.
WARNING: This method belongs to a preliminary API and may change in an incompatible way or may even be removed in a next SNAP release.
imageToModelTransform
- The new image-to-model transformationIllegalStateException
- If a source image is already set which uses a different image-to-model transformation.getImageToModelTransform()
,
createSourceImage()
public MathTransform2D getModelToSceneTransform()
RasterDataNode
model coordinates
to the Product
's scene coordinates.
If no model-to-scene transformation has been explicitly set but a scene-to-model transformation
exists, then the latter's inverse()
is returned.
getModelToSceneTransform
in interface SceneTransformProvider
null
if no such exists.Product.getSceneCRS()
,
getImageToModelTransform()
public void setModelToSceneTransform(MathTransform2D modelToSceneTransform)
MathTransform2D
from the local model CRS of this RasterDataNode
to
a Product
's scene coordinate reference system. If the sceneToModelTransform is not the inverse
of this transform or cannot be derived from it, it must be set using setSceneToModelTransform()
.
Only use this method when you know that the model CRS of this RasterDataNode
is different
than the Product
's scene CRS or when you want to model a special relationship between
different RasterDataNode
's. When no transformation from local model to scene is possible, use
MathTransform2D.NULL
.modelToSceneTransform
- The MathTransform2D
to convert local model coordinates to
product scene coordinatessetSceneToModelTransform(MathTransform2D)
public MathTransform2D getSceneToModelTransform()
Product
's scene coordinates
to the local RasterDataNode
model coordinates.
If no scene-to-model transformation has been explicitly set but a model-to-scene transformation
exists, then the latter's inverse()
is returned.
getSceneToModelTransform
in interface SceneTransformProvider
Product.getSceneCRS()
,
getImageToModelTransform()
public void setSceneToModelTransform(MathTransform2D sceneToModelTransform)
MathTransform2D
from a Product
's scene coordinate reference system to
the local model CRS of this RasterDataNode
. If the modelToSceneTransform is not the inverse
of this transformor cannot be derived from it, it must be set using setModelToSceneTransform()
.
Only use this method when you know that the model CRS of this RasterDataNode
is different
than the Product
's scene CRS or when you want to model a special relationship between
different RasterDataNode
's. When no transformation from scene to local model is possible, use
MathTransform2D.NULL
.sceneToModelTransform
- The MathTransform2D
to convert product scene coordinates
to local model coordinatessetModelToSceneTransform(MathTransform2D)
public GeoCoding getGeoCoding()
RasterDataNode
.null
if not available.public void setGeoCoding(GeoCoding geoCoding)
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_GEO_CODING
.
geoCoding
- the new geo-codingProduct.setSceneGeoCoding(GeoCoding)
public TimeCoding getTimeCoding()
RasterDataNode
.null
if not available.Product.getSceneTimeCoding()
public void setTimeCoding(TimeCoding timeCoding)
RasterDataNode
.timeCoding
- the new time-codingProduct.setSceneTimeCoding(TimeCoding)
protected Pointing createPointing()
Pointing
applicable for this raster.public Pointing getPointing()
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.public boolean canBeOrthorectified()
public boolean isFloatingPointType()
true
if the pixel data contained in this band is "naturally" a floating point number type.isFloatingPointType
in class DataNode
public int getGeophysicalDataType()
RasterDataNode
. The value returned is always one of the
ProductData.TYPE_XXX
constants.ProductData
,
isScalingApplied()
public final double getScalingFactor()
ProductData
. The default value is
1.0
(no factor).isScalingApplied()
public final void setScalingFactor(double scalingFactor)
ProductData
.scalingFactor
- the scaling factorisScalingApplied()
public final double getScalingOffset()
ProductData
. The default value is
0.0
(no offset).isScalingApplied()
public final void setScalingOffset(double scalingOffset)
ProductData
.scalingOffset
- the scaling offsetisScalingApplied()
public final boolean isLog10Scaled()
ProductData
of this band has a negative binomial distribution and
thus the common logarithm (base 10) of the values is stored in the raw data. The default value is
false
.isScalingApplied()
public final void setLog10Scaled(boolean log10Scaled)
ProductData
of this band has a negative binomial distribution and
thus the common logarithm (base 10) of the values is stored in the raw data.log10Scaled
- whether or not the data is logging-10 scaledisScalingApplied()
public final boolean isScalingApplied()
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)
.
true
if a conversion is applyied to raw data samples before the are retuned.getScalingOffset()
,
getScalingFactor()
,
isLog10Scaled()
public static boolean isValidMaskProperty(String propertyName)
propertyName
- the name to testtrue
, if so.public boolean isNoDataValueSet()
setNoDataValue(double)
or setGeophysicalNoDataValue(double)
is called.isNoDataValueUsed()
,
setNoDataValue(double)
public void clearNoDataValue()
isNoDataValueSet()
will return false
.public boolean isNoDataValueUsed()
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.
setNoDataValueUsed(boolean)
,
isNoDataValueSet()
public void setNoDataValueUsed(boolean noDataValueUsed)
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
.
noDataValueUsed
- true, if soisNoDataValueUsed()
public double getNoDataValue()
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.
double
in order to cover all other numeric types.setNoDataValue(double)
,
isNoDataValueSet()
public void setNoDataValue(double noDataValue)
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
.
noDataValue
- the no-data value. It is passed as a double
in order to cover all other numeric types.getNoDataValue()
,
isNoDataValueSet()
public double getGeophysicalNoDataValue()
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.
setGeophysicalNoDataValue(double)
public void setGeophysicalNoDataValue(double noDataValue)
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
.
noDataValue
- the new geophysical no-data valuesetGeophysicalNoDataValue(double)
,
isNoDataValueSet()
public String getValidPixelExpression()
isPixelValid(int, int, javax.media.jai.ROI)
method.public void setValidPixelExpression(String validPixelExpression)
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
.
validPixelExpression
- the valid mask expression, can be nullpublic boolean isValidMaskUsed()
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.
public void resetValidMask()
public String getValidMaskExpression()
noDataValue
and the
validPixelExpression
properties, if any.
The method returns null
, if none of these properties are set.null
.getValidPixelExpression()
,
getNoDataValue()
public void updateExpression(String oldExternalName, String newExternalName)
oldExternalName
with oldExternalName
. Such references most often occur
in band arithmetic expressions.updateExpression
in class ProductNode
oldExternalName
- The old node name.newExternalName
- The new node name.public boolean hasRasterData()
RasterDataNode
is loaded or elsewhere available, otherwise
false.public ProductData getRasterData()
null
.null
if data has not been loadedpublic void setRasterData(ProductData rasterData)
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.
rasterData
- The raster data for this raster data node.getRasterData()
public void loadRasterData() throws IOException
IOException
- if an I/O error occursloadRasterData(com.bc.ceres.core.ProgressMonitor)
public void loadRasterData(ProgressMonitor pm) throws IOException
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.
pm
- a monitor to inform the user about progressIOException
- if an I/O error occursunloadRasterData()
public void unloadRasterData()
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.
loadRasterData()
public void dispose()
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.
public boolean isPixelValid(int x, int y)
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.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationtrue
if the pixel is validArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsisPixelValid(int, int, javax.media.jai.ROI)
,
setNoDataValueUsed(boolean)
,
setNoDataValue(double)
,
setValidPixelExpression(String)
public int getSampleInt(int x, int y)
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.
x
- pixel X coordinatey
- pixel Y coordinatepublic float getSampleFloat(int x, int y)
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.
x
- pixel X coordinatey
- pixel Y coordinatepublic boolean isPixelValid(int pixelIndex)
validMaskImage
is null or
or if the bit corresponding to (x,y) is set within the returned mask image.pixelIndex
- the linear pixel index in the range 0 to width * height - 1true
if the pixel is validArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsisPixelValid(int, int, javax.media.jai.ROI)
,
setNoDataValueUsed(boolean)
,
setNoDataValue(double)
,
setValidPixelExpression(String)
public boolean isPixelValid(int x, int y, javax.media.jai.ROI roi)
isPixelValid(int, int)
method,
and secondly, if the pixel is within the ROI (if any).x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationroi
- the ROI, if null the method returns isPixelValid(int, int)
true
if the pixel is validArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsisPixelValid(int, int)
,
setNoDataValueUsed(boolean)
,
setNoDataValue(double)
,
setValidPixelExpression(String)
public abstract int getPixelInt(int x, int y)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic abstract float getPixelFloat(int x, int y)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic abstract double getPixelDouble(int x, int y)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixelInt(int x, int y, int pixelValue)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationpixelValue
- the new pixel value at (x,y)ArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixelFloat(int x, int y, float pixelValue)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationpixelValue
- the new pixel value at (x,y)ArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixelDouble(int x, int y, double pixelValue)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationpixelValue
- the new pixel value at (x,y)ArrayIndexOutOfBoundsException
- if the co-ordinates are not in boundsIllegalStateException
- if this object has no internal data bufferpublic int[] getPixels(int x, int y, int w, int h, int[] pixels)
public abstract int[] getPixels(int x, int y, int w, int h, int[] pixels, ProgressMonitor pm)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the readPixels(int, int, int, int, double[], ProgressMonitor)
method
to read or compute pixel values without a raster data buffer.
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be read.pixels
- integer array to be filled with datapm
- a progress monitorIllegalStateException
- if this object has no internal data bufferpublic float[] getPixels(int x, int y, int w, int h, float[] pixels)
#getPixels(int, int, int, int, float[], ProgressMonitor)}
public abstract float[] getPixels(int x, int y, int w, int h, float[] pixels, ProgressMonitor pm)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the readPixels(int, int, int, int, double[], ProgressMonitor)
method
to read or compute pixel values without a raster data buffer.
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be read.pixels
- float array to be filled with datapm
- a progress monitorIllegalStateException
- if this object has no internal data bufferpublic double[] getPixels(int x, int y, int w, int h, double[] pixels)
getSourceImage()
instead.public abstract double[] getPixels(int x, int y, int w, int h, double[] pixels, ProgressMonitor pm)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the readPixels(int, int, int, int, double[], ProgressMonitor)
method
to read or compute pixel values without a raster data buffer.
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be read.pixels
- double array to be filled with datapm
- a monitor to inform the user about progressIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixels(int x, int y, int w, int h, int[] pixels)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the writePixels(int, int, int, int, double[], ProgressMonitor)
method
to write pixels directly to the associated product writer
.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be written.pixels
- integer array to be writtenNullPointerException
- if this band has no raster dataIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixels(int x, int y, int w, int h, float[] pixels)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the writePixels(int, int, int, int, double[], ProgressMonitor)
method
to write pixels directly to the associated product writer
.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be written.pixels
- float array to be writtenNullPointerException
- if this band has no raster dataIllegalStateException
- if this object has no internal data bufferpublic abstract void setPixels(int x, int y, int w, int h, double[] pixels)
Note that this method can only be used if this object's internal raster data buffer has been
set
or loaded
.
You can use the writePixels(int, int, int, int, double[], ProgressMonitor)
method
to write pixels directly to the associated product writer
.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be written.pixels
- double array to be writtenNullPointerException
- if this band has no raster dataIllegalStateException
- if this object has no internal data bufferpublic int[] readPixels(int x, int y, int w, int h, int[] pixels) throws IOException
IOException
readPixels(int, int, int, int, int[], ProgressMonitor)
public abstract int[] readPixels(int x, int y, int w, int h, int[] pixels, ProgressMonitor pm) throws IOException
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be readpixels
- array to be filled with datapm
- a progress monitorIOException
- if an /IO error occursIllegalStateException
- if this object has no attached product reader
public float[] readPixels(int x, int y, int w, int h, float[] pixels) throws IOException
IOException
readPixels(int, int, int, int, float[], ProgressMonitor)
public abstract float[] readPixels(int x, int y, int w, int h, float[] pixels, ProgressMonitor pm) throws IOException
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be readpixels
- array to be filled with datapm
- a progress monitorIllegalStateException
- if this object has no attached product reader
IOException
public double[] readPixels(int x, int y, int w, int h, double[] pixels) throws IOException
IOException
readPixels(int, int, int, int, double[], ProgressMonitor)
public abstract double[] readPixels(int x, int y, int w, int h, double[] pixels, ProgressMonitor pm) throws IOException
If the pixels
array is null
a new one will be created and returned.
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be readh
- height of the pixel array to be readpixels
- array to be filled with datapm
- a progress monitorIllegalStateException
- if this object has no attached product reader
IOException
public void writePixels(int x, int y, int w, int h, int[] pixels) throws IOException
IOException
writePixels(int, int, int, int, int[], ProgressMonitor)
public abstract void writePixels(int x, int y, int w, int h, int[] pixels, ProgressMonitor pm) throws IOException
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be writtenpixels
- array of pixels to writepm
- a progress monitorIllegalStateException
- if this object has no attached product writer
IOException
- if an I/O error occurspublic void writePixels(int x, int y, int w, int h, float[] pixels) throws IOException
IOException
writePixels(int, int, int, int, float[], ProgressMonitor)
public abstract void writePixels(int x, int y, int w, int h, float[] pixels, ProgressMonitor pm) throws IOException
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be writtenpixels
- array of pixels to writepm
- a progress monitorIllegalStateException
- if this object has no attached product writer
IOException
- if an I/O error occurspublic void writePixels(int x, int y, int w, int h, double[] pixels) throws IOException
IOException
writePixels(int, int, int, int, double[], ProgressMonitor)
public abstract void writePixels(int x, int y, int w, int h, double[] pixels, ProgressMonitor pm) throws IOException
x
- x offset into the bandy
- y offset into the bandw
- width of the pixel array to be writtenh
- height of the pixel array to be writtenpixels
- array of pixels to writepm
- a progress monitorIllegalStateException
- if this object has no attached product writer
IOException
- if an I/O error occurspublic boolean[] readValidMask(int x, int y, int w, int h, boolean[] validMask) throws IOException
IOException
public void readRasterDataFully() throws IOException
IOException
- if an I/O error occursreadRasterDataFully(ProgressMonitor)
,
unloadRasterData()
public abstract void readRasterDataFully(ProgressMonitor pm) throws IOException
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.
pm
- a monitor to inform the user about progressIOException
- if an I/O error occursloadRasterData()
,
readRasterData(int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)
public void readRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData) throws IOException
offsetX
- the X-offset in the raster co-ordinates where reading startsoffsetY
- the Y-offset in the raster co-ordinates where reading startswidth
- the width of the raster data bufferheight
- the height of the raster data bufferrasterData
- a raster data buffer receiving the pixels to be readIOException
- if an I/O error occursIllegalArgumentException
- if the raster is nullIllegalStateException
- 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 readerProductReader.readBandRasterData(Band, int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)
public abstract void readRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData, ProgressMonitor pm) throws IOException
readRasterData(int, int, int, int, ProductData)
,
but clients can additionally pass a ProgressMonitor
.offsetX
- the X-offset in the raster co-ordinates where reading startsoffsetY
- the Y-offset in the raster co-ordinates where reading startswidth
- the width of the raster data bufferheight
- the height of the raster data bufferrasterData
- a raster data buffer receiving the pixels to be readpm
- a monitor to inform the user about progressIOException
- if an I/O error occursIllegalArgumentException
- if the raster is nullIllegalStateException
- 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 readerpublic void writeRasterDataFully() throws IOException
IOException
public abstract void writeRasterDataFully(ProgressMonitor pm) throws IOException
pm
- a monitor to inform the user about progressIOException
- if an I/O error occurspublic void writeRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData) throws IOException
IOException
public abstract void writeRasterData(int offsetX, int offsetY, int width, int height, ProductData rasterData, ProgressMonitor pm) throws IOException
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.
rasterData
- a raster data buffer receiving the pixels to be readoffsetX
- the X-offset in raster co-ordinates where reading startsoffsetY
- the Y-offset in raster co-ordinates where reading startswidth
- the width of the raster data bufferheight
- the height of the raster data bufferpm
- a monitor to inform the user about progressIOException
- if an I/O error occursIllegalArgumentException
- if the raster is nullIllegalStateException
- 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 readerProductReader.readBandRasterData(Band, int, int, int, int, ProductData, com.bc.ceres.core.ProgressMonitor)
public ProductData createCompatibleRasterData()
getRasterWidth()*getRasterHeight()
elements of a compatible data type.createCompatibleSceneRasterData()
public ProductData createCompatibleSceneRasterData()
getBandOutputRasterWidth()*getBandOutputRasterHeight()
elements of a compatible data type.createCompatibleRasterData()
public ProductData createCompatibleRasterData(int width, int height)
width*height
elements of a compatible data type.width
- the width of the raster data to be createdheight
- the height of the raster data to be createdcreateCompatibleRasterData()
,
createCompatibleSceneRasterData()
public boolean isCompatibleRasterData(ProductData rasterData, int w, int h)
rasterData
- the raster dataw
- the raster widthh
- the raster heighttrue
if sopublic void checkCompatibleRasterData(ProductData rasterData, int w, int h)
IllegalArgumentException
if the given parameters dont specify a compatible raster.rasterData
- the raster dataw
- the raster widthh
- the raster heightpublic boolean hasIntPixels()
public TransectProfileData createTransectProfileData(Shape shape) throws IOException
shape
- the shapeIOException
- if an I/O error occurspublic abstract void acceptVisitor(ProductVisitor visitor)
acceptVisitor
in class DataNode
visitor
- the visitor, must not be null
public ImageInfo getImageInfo()
null
public void setImageInfo(ImageInfo imageInfo)
imageInfo
- the image info, can be null
protected void setImageInfo(ImageInfo imageInfo, boolean change)
public void fireImageInfoChanged()
public final ImageInfo getImageInfo(ProgressMonitor pm)
The method simply returns the value of ensureValidImageInfo(null, ProgressMonitor.NULL)
.
pm
- A progress monitor.getImageInfo(double[], ProgressMonitor)
public final ImageInfo getImageInfo(double[] histoSkipAreas, ProgressMonitor pm)
If no image information has been assigned before, the
method is
called with the given parameters passed to this method.createDefaultImageInfo(double[], com.bc.ceres.core.ProgressMonitor)
histoSkipAreas
- Only used, if new image info is created (see createDefaultImageInfo(double[], com.bc.ceres.core.ProgressMonitor)
method).pm
- A progress monitor.public ImageInfo createDefaultImageInfo(double[] histoSkipAreas, ProgressMonitor pm)
An IllegalStateException
is thrown in the case that this raster data node has no raster data.
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 progressnull
.public final ImageInfo createDefaultImageInfo(double[] histoSkipAreas, Histogram histogram)
An IllegalStateException
is thrown in the case that this raster data node has no raster data.
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.null
.public ProductNodeGroup<Mask> getOverlayMaskGroup()
public BufferedImage createColorIndexedImage(ProgressMonitor pm) throws IOException
ProductUtils.createColorIndexedImage(this,
null)
.pm
- a monitor to inform the user about progressIOException
- if the raster data is not loaded so far and reload causes an I/O errorsetImageInfo(ImageInfo)
public BufferedImage createRgbImage(ProgressMonitor pm) throws IOException
pm
- a monitor to inform the user about progressIOException
- if the raster data is not loaded so far and reload causes an I/O errorsetImageInfo(ImageInfo)
public byte[] quantizeRasterData(double newMin, double newMax, double gamma, ProgressMonitor pm) throws IOException
IOException
public void quantizeRasterData(double newMin, double newMax, double gamma, byte[] samples, int offset, int stride, ProgressMonitor pm) throws IOException
IOException
public final double scale(double v)
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.public final double scaleInverse(double v)
(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.scaleInverse
in interface Scaling
v
- the input valuepublic String getPixelString(int x, int y)
x
- the X co-ordinate of the pixel locationy
- the Y co-ordinate of the pixel locationpublic boolean isSourceImageSet()
RasterDataNode
.getSourceImage()
,
setSourceImage(java.awt.image.RenderedImage)
,
setSourceImage(com.bc.ceres.glevel.MultiLevelImage)
,
createSourceImage()
public MultiLevelImage getSourceImage()
RasterDataNode
.null
. In the case that isSourceImageSet()
returns false
,
the method createSourceImage()
will be called in order to set and return a valid source image.createSourceImage()
,
isSourceImageSet()
protected abstract RenderedImage createSourceImage()
RasterDataNode
.
This shall preferably be a MultiLevelImage
instance which recognises this raster data node's
imageToModelTransform
property, if set.public void setSourceImage(RenderedImage sourceImage)
RasterDataNode
.sourceImage
- The source image.
Can be null
. If so, isSourceImageSet()
will return false
.public void setSourceImage(MultiLevelImage sourceImage)
RasterDataNode
.sourceImage
- The source image.
Can be null
. If so, isSourceImageSet()
will return false
.public boolean isGeophysicalImageSet()
RasterDataNode
.
This method belongs to preliminary API and may be removed or changed in the future.
public MultiLevelImage getGeophysicalImage()
public MultiLevelModel getMultiLevelModel()
createMultiLevelModel()
.createMultiLevelModel()
public MultiLevelModel createMultiLevelModel()
RasterDataNode
getMultiLevelModel()
,
Product.createMultiLevelModel()
public boolean isValidMaskImageSet()
RasterDataNode
.public MultiLevelImage getValidMaskImage()
RasterDataNode
.public boolean isStxSet()
public Stx getStx()
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.
getStx(boolean, com.bc.ceres.core.ProgressMonitor)
,
setStx(Stx)
public Stx getStx(boolean accurate, ProgressMonitor pm)
pm
and then set.
This method belongs to preliminary API and may be removed or changed in the future.accurate
- If true, accurate statistics are computed.pm
- A progress monitor which is used to compute the new statistics, if required.public void setStx(Stx stx)
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.stx
- The statistics.protected Stx computeStxImpl(int level, ProgressMonitor pm)
level
- The resolution level.pm
- A progress monitor.public Shape getValidShape()
null
, if the entire raster contains valid samples.null
.public RasterDataNode getAncillaryVariable(String... relations)
relations
- Names of relations such as "uncertainty"
, "variance"
, or null
(any).null
.public RasterDataNode[] getAncillaryVariables(String... relations)
relations
- Names of relations such as "uncertainty"
, "variance"
, or null
(any).public void addAncillaryVariable(RasterDataNode variable, String... relations)
variable
- The associated ancillary variable.relations
- The names of the relations, may be "uncertainty"
, "variance"
, or null
(not set).public void removeAncillaryVariable(RasterDataNode variable)
variable
- The associated ancillary variable.public String[] getAncillaryRelations()
addAncillaryVariable(RasterDataNode, String...)
,
removeAncillaryVariable(RasterDataNode)
,
getAncillaryVariable(String...)
public void setAncillaryRelations(String... relations)
relations
- The names of an ancillary relations.addAncillaryVariable(RasterDataNode, String...)
,
getAncillaryVariable(String...)
public void processRasterData(String message, RasterDataNode.RasterDataProcessor processor, ProgressMonitor pm) throws IOException
Users of this method may also consider implementing a GPF org.esa.snap.core.gpf.Operator
or a SingleBandedOpImage
instead.
message
- a task descriptionprocessor
- the raster processorpm
- a progress monitorIOException
Copyright © 2014–2016 European Space Agency (ESA). All rights reserved.