org.esa.beam.framework.gpf
Class GPF

java.lang.Object
  extended by org.esa.beam.framework.gpf.GPF

public class GPF
extends Object

The facade for the Graph Processing Framework.

The Graph Processing Framework makes extensive use of Java Advanced Imaging (JAI). Therefore, configuring the JAI TileCache and TileScheduler will also affect the overall performance of the Graph Processing Framework.

This class may be overridden in order to alter product creation behaviour of the static createProduct methods of the GPF instance. The current instance can be set by setDefaultInstance(GPF).

Since:
4.1
Author:
Norman Fomferra

Field Summary
static String DISABLE_TILE_CACHE_PROPERTY
           
static RenderingHints.Key KEY_TILE_SIZE
          Key for GPF tile size RenderingHints.
static Map<String,Object> NO_PARAMS
          An unmodifiable empty Map.
static Map<String,Product> NO_SOURCES
          An unmodifiable empty Map.
static String SOURCE_PRODUCT_FIELD_NAME
           
static String TARGET_PRODUCT_FIELD_NAME
           
static String TILE_COMPUTATION_OBSERVER_PROPERTY
           
static String USE_FILE_TILE_CACHE_PROPERTY
           
 
Constructor Summary
protected GPF()
          Constructor.
 
Method Summary
 Operator createOperator(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints)
          Creates an operator instance by using the given operator (alias) name.
static Product createProduct(String operatorName, Map<String,Object> parameters)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Product... sourceProducts)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Product sourceProduct)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Product[] sourceProducts, RenderingHints renderingHints)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, Product sourceProduct, RenderingHints renderingHints)
          Creates a product by using the operator specified by the given name.
static Product createProduct(String operatorName, Map<String,Object> parameters, RenderingHints renderingHints)
          Creates a product by using the operator specified by the given name.
 Product createProductNS(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints)
          Creates a product by using the operator specified by the given name.
static GPF getDefaultInstance()
          Gets the default GPF instance.
 OperatorSpiRegistry getOperatorSpiRegistry()
          Gets the registry for operator SPIs.
static void setDefaultInstance(GPF defaultInstance)
          Sets the default GPF instance.
 void setOperatorSpiRegistry(OperatorSpiRegistry spiRegistry)
          Sets the registry for operator SPIs.
static void writeProduct(Product product, File file, String formatName, boolean incremental, com.bc.ceres.core.ProgressMonitor pm)
          Writes a product with the specified format to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLE_TILE_CACHE_PROPERTY

public static final String DISABLE_TILE_CACHE_PROPERTY
See Also:
Constant Field Values

USE_FILE_TILE_CACHE_PROPERTY

public static final String USE_FILE_TILE_CACHE_PROPERTY
See Also:
Constant Field Values

TILE_COMPUTATION_OBSERVER_PROPERTY

public static final String TILE_COMPUTATION_OBSERVER_PROPERTY
See Also:
Constant Field Values

SOURCE_PRODUCT_FIELD_NAME

public static final String SOURCE_PRODUCT_FIELD_NAME
See Also:
Constant Field Values

TARGET_PRODUCT_FIELD_NAME

public static final String TARGET_PRODUCT_FIELD_NAME
See Also:
Constant Field Values

KEY_TILE_SIZE

public static final RenderingHints.Key KEY_TILE_SIZE
Key for GPF tile size RenderingHints.

The value for this key must be an instance of Dimension with both width and height positive.


NO_PARAMS

public static final Map<String,Object> NO_PARAMS
An unmodifiable empty Map.

Can be used for convenience as a parameter for createProduct() if no parameters are needed for the operator.

See Also:
createProduct(String, Map), createProduct(String, Map, Product ...), createProduct(String, Map, Map)

NO_SOURCES

public static final Map<String,Product> NO_SOURCES
An unmodifiable empty Map.

Can be used for convenience as a parameter for createProduct(String, Map, Map) if no source products are needed for the operator.

See Also:
createProduct(String, Map, Map)
Constructor Detail

GPF

protected GPF()
Constructor.

Method Detail

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    RenderingHints renderingHints)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
renderingHints - the rendering hints may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Product sourceProduct)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProduct - a source product.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Product sourceProduct,
                                    RenderingHints renderingHints)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProduct - the source product.
renderingHints - the rendering hints may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Product... sourceProducts)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the source products.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Product[] sourceProducts,
                                    RenderingHints renderingHints)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the source products.
renderingHints - the rendering hints may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Map<String,Product> sourceProducts)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the map of named source products.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProduct

public static Product createProduct(String operatorName,
                                    Map<String,Object> parameters,
                                    Map<String,Product> sourceProducts,
                                    RenderingHints renderingHints)
                             throws OperatorException
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the map of named source products.
renderingHints - the rendering hints, may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createProductNS

public Product createProductNS(String operatorName,
                               Map<String,Object> parameters,
                               Map<String,Product> sourceProducts,
                               RenderingHints renderingHints)
Creates a product by using the operator specified by the given name. The resulting product can be used as input product for a further call to createProduct(). By concatenating multiple calls it is possible to set up a processing graph.

All static createProduct methods delegate to this non-static (= NS) version. It can be overriden by clients in order to alter product creation behaviour of the static createProduct methods of the current GPF instance.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the map of named source products.
renderingHints - the rendering hints, may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.

createOperator

public Operator createOperator(String operatorName,
                               Map<String,Object> parameters,
                               Map<String,Product> sourceProducts,
                               RenderingHints renderingHints)
Creates an operator instance by using the given operator (alias) name.

Parameters:
operatorName - the name of the operator to use.
parameters - the named parameters needed by the operator.
sourceProducts - the map of named source products.
renderingHints - the rendering hints, may be null.
Returns:
the product created by the operator.
Throws:
OperatorException - if the product could not be created.
Since:
BEAM 4.9

getOperatorSpiRegistry

public OperatorSpiRegistry getOperatorSpiRegistry()
Gets the registry for operator SPIs.

Returns:
the registry for operator SPIs.

setOperatorSpiRegistry

public void setOperatorSpiRegistry(OperatorSpiRegistry spiRegistry)
Sets the registry for operator SPIs.

Parameters:
spiRegistry - the registry for operator SPIs.

getDefaultInstance

public static GPF getDefaultInstance()
Gets the default GPF instance.

Returns:
the singelton instance.

setDefaultInstance

public static void setDefaultInstance(GPF defaultInstance)
Sets the default GPF instance.

Parameters:
defaultInstance - the GPF default instance.

writeProduct

public static void writeProduct(Product product,
                                File file,
                                String formatName,
                                boolean incremental,
                                com.bc.ceres.core.ProgressMonitor pm)
Writes a product with the specified format to the given file.

Parameters:
product - the product
file - the product file
formatName - the name of a supported product format, e.g. "HDF5". If null, the default format "BEAM-DIMAP" will be used
incremental - switch the product writer in incremental mode or not.
pm - a monitor to inform the user about progress


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