org.esa.beam.framework.dataio
Class ProductSubsetBuilder

java.lang.Object
  extended by org.esa.beam.framework.dataio.AbstractProductReader
      extended by org.esa.beam.framework.dataio.AbstractProductBuilder
          extended by org.esa.beam.framework.dataio.ProductSubsetBuilder
All Implemented Interfaces:
ProductReader

public class ProductSubsetBuilder
extends AbstractProductBuilder

A special-purpose product reader used to build subsets of data products.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Field Summary
 
Fields inherited from class org.esa.beam.framework.dataio.AbstractProductBuilder
bandMap, newProductDesc, newProductName, sceneRasterHeight, sceneRasterWidth, sourceProduct, sourceProductOwner
 
Constructor Summary
ProductSubsetBuilder()
           
ProductSubsetBuilder(boolean sourceProductOwner)
           
 
Method Summary
protected  void addBandsToProduct(Product product)
           
protected  void addGeoCodingToProduct(Product product)
           
protected  void addTiePointGridsToProduct(Product product)
           
static Product createProductSubset(Product sourceProduct, boolean sourceProductOwner, ProductSubsetDef subsetDef, String name, String desc)
           
static Product createProductSubset(Product sourceProduct, ProductSubsetDef subsetDef, String name, String desc)
           
protected  void readBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, int sourceStepX, int sourceStepY, Band destBand, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, com.bc.ceres.core.ProgressMonitor pm)
          The template method which is called by the readBandRasterDataSubSampling method after an optional spatial subset has been applied to the input parameters.
protected  Product readProductNodesImpl()
          Reads a data product and returns a in-memory representation of it.
 
Methods inherited from class org.esa.beam.framework.dataio.AbstractProductBuilder
addAttribString, addFlagCodingsToProduct, addIndexCodingsToProduct, addMetadataToProduct, cloneFlags, cloneIndexes, cloneMetadataAttributes, cloneMetadataElements, cloneMetadataElementsAndAttributes, close, disposeBandMap, getSceneRasterHeight, getSceneRasterWidth, getSourceProduct, isInstanceOfValidInputType, isSourceProductOwner, readProductNodes, setNewProductDesc, setNewProductName
 
Methods inherited from class org.esa.beam.framework.dataio.AbstractProductReader
configurePreferredTileSize, createTiePointGrid, getGridDiscontinutity, getInput, getProductComponents, getReaderPlugIn, getSubsetDef, isMetadataIgnored, isNodeAccepted, readBandRasterData, readProductNodes, setInput, setSubsetDef, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProductSubsetBuilder

public ProductSubsetBuilder()

ProductSubsetBuilder

public ProductSubsetBuilder(boolean sourceProductOwner)
Method Detail

createProductSubset

public static Product createProductSubset(Product sourceProduct,
                                          ProductSubsetDef subsetDef,
                                          String name,
                                          String desc)
                                   throws IOException
Throws:
IOException

createProductSubset

public static Product createProductSubset(Product sourceProduct,
                                          boolean sourceProductOwner,
                                          ProductSubsetDef subsetDef,
                                          String name,
                                          String desc)
                                   throws IOException
Throws:
IOException

readProductNodesImpl

protected Product readProductNodesImpl()
                                throws IOException
Reads a data product and returns a in-memory representation of it. This method was called by readProductNodes(input, subsetInfo) of the abstract superclass.

Specified by:
readProductNodesImpl in class AbstractProductBuilder
Returns:
a new product instance
Throws:
IllegalArgumentException - if input type is not one of the supported input sources.
IOException - if an I/O error occurs

readBandRasterDataImpl

protected void readBandRasterDataImpl(int sourceOffsetX,
                                      int sourceOffsetY,
                                      int sourceWidth,
                                      int sourceHeight,
                                      int sourceStepX,
                                      int sourceStepY,
                                      Band destBand,
                                      int destOffsetX,
                                      int destOffsetY,
                                      int destWidth,
                                      int destHeight,
                                      ProductData destBuffer,
                                      com.bc.ceres.core.ProgressMonitor pm)
                               throws IOException
The template method which is called by the readBandRasterDataSubSampling method after an optional spatial subset has been applied to the input parameters.

The destination band, buffer and region parameters are exactly the ones passed to the original readBandRasterDataSubSampling call. Since the destOffsetX and destOffsetY parameters are already taken into acount in the sourceOffsetX and sourceOffsetY parameters, an implementor of this method is free to ignore them.

Specified by:
readBandRasterDataImpl in class AbstractProductReader
Parameters:
sourceOffsetX - the absolute X-offset in source raster co-ordinates
sourceOffsetY - the absolute Y-offset in source raster co-ordinates
sourceWidth - the width of region providing samples to be read given in source raster co-ordinates
sourceHeight - the height of region providing samples to be read given in source raster co-ordinates
sourceStepX - the sub-sampling in X direction within the region providing samples to be read
sourceStepY - the sub-sampling in Y direction within the region providing samples to be read
destBand - the destination band which identifies the data source from which to read the sample values
destBuffer - the destination buffer which receives the sample values to be read
destOffsetX - the X-offset in the band's raster co-ordinates
destOffsetY - the Y-offset in the band's raster co-ordinates
destWidth - the width of region to be read given in the band's raster co-ordinates
destHeight - the height of region to be read given in the band's raster co-ordinates
pm - a monitor to inform the user about progress
Throws:
IOException - if an I/O error occurs
See Also:
AbstractProductReader.getSubsetDef()

addBandsToProduct

protected void addBandsToProduct(Product product)

addTiePointGridsToProduct

protected void addTiePointGridsToProduct(Product product)

addGeoCodingToProduct

protected void addGeoCodingToProduct(Product product)


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