@OperatorMetadata(alias="Convert-Datatype", category="Raster/Data Conversion", authors="Jun Lu, Luis Veci", copyright="Copyright (C) 2015 by Array Systems Computing Inc.", description="Convert product data type") public class ConvertDataTypeOp extends Operator
Modifier and Type | Class and Description |
---|---|
static class |
ConvertDataTypeOp.ScalingType |
static class |
ConvertDataTypeOp.Spi
The SPI is used to register this operator in the graph processing framework
via the SPI configuration file
META-INF/services/org.esa.snap.core.gpf.OperatorSpi . |
Modifier and Type | Field and Description |
---|---|
static String |
SCALING_LINEAR |
static String |
SCALING_LINEAR_CLIPPED |
static String |
SCALING_LINEAR_PEAK_CLIPPED |
static String |
SCALING_LOGARITHMIC |
static String |
SCALING_TRUNCATE |
Constructor and Description |
---|
ConvertDataTypeOp() |
Modifier and Type | Method and Description |
---|---|
void |
computeTile(Band targetBand,
Tile targetTile,
ProgressMonitor pm)
Called by the framework in order to compute a tile for the given target band.
|
static Band[] |
getSourceBands(Product sourceProduct,
String[] sourceBandNames,
boolean includeVirtualBands)
get the selected bands
|
void |
initialize()
Initializes this operator and sets the one and only target product.
|
void |
setScaling(String newScaling) |
void |
setTargetDataType(String newType) |
checkForCancellation, computeTileStack, createMultiSizeException, deactivateComputeTileMethod, dispose, doExecute, execute, finalize, getId, getLogger, getParameter, getParameter, getSourceProduct, getSourceProduct, getSourceProductId, getSourceProducts, getSourceTile, getSourceTile, getSpi, getTargetProduct, getTargetProperty, setLogger, setParameter, setParameterDefaultValues, setRequiresAllBands, setSourceProduct, setSourceProduct, setSourceProducts, setSpi, setTargetProduct, stopTileComputationObservation, update
public static final String SCALING_TRUNCATE
public static final String SCALING_LINEAR
public static final String SCALING_LINEAR_CLIPPED
public static final String SCALING_LINEAR_PEAK_CLIPPED
public static final String SCALING_LOGARITHMIC
public void initialize() throws OperatorException
The target product can be either defined by a field of type Product
annotated with the
TargetProduct
annotation or
by calling Operator.setTargetProduct(org.esa.snap.core.datamodel.Product)
method.
The framework calls this method after it has created this operator. Any client code that must be performed before computation of tile data should be placed here.
initialize
in class Operator
OperatorException
- If an error occurs during operator initialisation.Operator.getTargetProduct()
public static Band[] getSourceBands(Product sourceProduct, String[] sourceBandNames, boolean includeVirtualBands) throws OperatorException
sourceProduct
- the input productsourceBandNames
- the select band namesincludeVirtualBands
- include virtual bands by defaultOperatorException
- if source band not foundpublic void computeTile(Band targetBand, Tile targetTile, ProgressMonitor pm) throws OperatorException
The default implementation throws a runtime exception with the message "not implemented".
computeTile
in class Operator
targetBand
- The target band.targetTile
- The current tile associated with the target band to be computed.pm
- A progress monitor which should be used to determine computation cancelation requests.OperatorException
- If an error occurs during computation of the target raster.public void setTargetDataType(String newType)
public void setScaling(String newScaling)
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.