public class BandArithmetic extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areRastersEqualInSize(Product[] products,
int defaultProductIndex,
String... expressions)
Determines whether all rasters which are referenced in the given expressions are compatible.
|
static boolean |
areRastersEqualInSize(Product product,
String... expressions)
Determines whether all rasters which are referenced in the given expressions are compatible.
|
static boolean |
areRastersEqualInSize(Term term)
Determines whether all rasters which are referenced in a term are compatible.
|
static WritableNamespace |
createDefaultNamespace(Product[] products,
int contextProductIndex)
Creates a default namespace for the product(s) given in an array.
|
static WritableNamespace |
createDefaultNamespace(Product[] products,
int contextProductIndex,
ProductNamespacePrefixProvider... prefixProviders)
Creates a default namespace for the product(s) given in an array.
|
static String |
createExternalName(String name)
Create an external name from the given name.
|
static void |
deregisterFunction(Function f)
De-registers an existing global function.
|
static void |
deregisterSymbol(Symbol s)
De-registers an existing global symbol.
|
static String |
getProductNodeNamePrefix(Product product)
Gets a symbol name prefix for the names of bands, tie point grids, flags, etc. of the given product.
|
static RasterDataSymbol[] |
getRefRasterDataSymbols(Term... terms)
Utility method which returns all raster data symbols referenced in a given compiled
band math expressions.
|
static RasterDataNode[] |
getRefRasters(String expression,
Product... products)
Utility method which returns all raster data nodes referenced in the given
band math expressions.
|
static RasterDataNode[] |
getRefRasters(String expression,
Product[] products,
int contextProductIndex)
Utility method which returns all raster data nodes referenced in the given
band math expressions.
|
static RasterDataNode[] |
getRefRasters(Term... terms)
Utility method which returns all raster data nodes referenced in the given
compiled band math expressions.
|
static String |
getValidMaskExpression(String expression,
Product[] products,
int contextProductIndex,
String validMaskExpression) |
static String |
getValidMaskExpression(String expression,
Product product,
String validMaskExpression) |
static Term |
parseExpression(String expression,
Product contextProduct)
Parses the given expression.
|
static Term |
parseExpression(String expression,
Product[] products,
int contextProductIndex)
Parses the given expression.
|
static void |
registerFunction(Function f)
Registers a new global function.
|
static void |
registerSymbol(Symbol s)
Registers a new global symbol.
|
public static void registerSymbol(Symbol s)
s
- the symbolpublic static void deregisterSymbol(Symbol s)
s
- the symbolpublic static void registerFunction(Function f)
f
- the functionpublic static void deregisterFunction(Function f)
f
- the functionpublic static Term parseExpression(String expression, Product contextProduct) throws ParseException
expression
- the expressioncontextProduct
- the context productParseException
- if a parse error occurspublic static Term parseExpression(String expression, Product[] products, int contextProductIndex) throws ParseException
expression
- the expressionproducts
- the array of source products which form the valid namespace for the expressioncontextProductIndex
- the index of the context product for which also symbols without the
product prefix $ref-no
are registered in the namespaceParseException
- if a parse error occurspublic static WritableNamespace createDefaultNamespace(Product[] products, int contextProductIndex)
products
- the array of source products which form the valid namespace for the expressioncontextProductIndex
- the index of the context product for which also symbols without the
product prefix $ref-no
are registered in the namespacenull
public static WritableNamespace createDefaultNamespace(Product[] products, int contextProductIndex, ProductNamespacePrefixProvider... prefixProviders)
products
- the array of source products which form the valid namespace for the expressioncontextProductIndex
- the index of the context product for which also symbols without the
product prefix $ref-no
are registered in the namespaceprefixProviders
- a list of product prefix providersnull
public static RasterDataNode[] getRefRasters(String expression, Product... products) throws ParseException
expression
- the expressionproducts
- the array of source products which form the valid namespace for the expressionParseException
public static RasterDataNode[] getRefRasters(String expression, Product[] products, int contextProductIndex) throws ParseException
expression
- the expressionproducts
- the array of source products which form the valid namespace for the expressioncontextProductIndex
- the index of the context product for which also symbols without the
product prefix $ref-no
are registered in the namespaceParseException
public static RasterDataNode[] getRefRasters(Term... terms)
terms
- the array of terms to be analysedpublic static RasterDataSymbol[] getRefRasterDataSymbols(Term... terms)
terms
- the compiled band math expressionsnull
but may be emptypublic static String getValidMaskExpression(String expression, Product product, String validMaskExpression) throws ParseException
ParseException
public static String getValidMaskExpression(String expression, Product[] products, int contextProductIndex, String validMaskExpression) throws ParseException
ParseException
public static String createExternalName(String name)
The method simply delgates to Tokenizer.createExternalName(String)
.
name
- the namepublic static String getProductNodeNamePrefix(Product product)
"$refNo."
where refNo is the product's reference
number returned by Product.getRefNo()
.product
- the product, must not be null
public static boolean areRastersEqualInSize(Term term)
term
- The term in questionpublic static boolean areRastersEqualInSize(Product product, String... expressions) throws ParseException
product
- The product to which the expressions can referexpressions
- the expressions in questionParseException
- if a parse error occurspublic static boolean areRastersEqualInSize(Product[] products, int defaultProductIndex, String... expressions) throws ParseException
products
- The product to which the expressions can referdefaultProductIndex
- The index of the default productexpressions
- the expressions in questionParseException
- if a parse error occursCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.