Developing an Operator OperatorsThe Operator interface is simple to extend. An Operator basically takes a source product as input and creates a new target product within initialize(). The algorithm implementation for what your operator does will go inside computTile() or computeTiles(). Operators work on the data tile by tile. The size of the tile may be dependent on the requests of other Operators in the graph. public interface Operator { The computeTile and computeTileStack methods express different application requirements. Clients may either implement computeTile or computeTileStack or both. In general, the algorithm dictates which of the methods will be implemented. Some algorithms can compute their output bands independently (band-arithmetic, radiance to reflectance conversion), other cannot. The GPF selects the method which best fits the application requirements:
Maven GPF ArchetypeThe Maven 2 Archetype Plugin for NEST GPF modules is used to create archetypes for NEST GPF modules.
Before beginning, make sure that you have built the NEST source code and do a maven install to ensure that all dependencies are in the repository.
where
Please also refer to the documentation of the Maven 2 Archetype Plugin. Example
Publishing an OperatorOperator implementations are published via the Java service provider interface (SPI). A JAR publishes its operators in the resource file META-INF/services/org.esa.beam.framework.gpf.OperatorSpi. In this file add your operator SPI eg: org.esa.nest.gpf.MultilookOp$Spi
public static class Spi extends OperatorSpi { public Spi() { super(MultilookOp.class); } } Adding Menu Item ActionsIn the modules.xml file found in the resources folder of the package, add an Action to create a menu item in the DAT. State the class of the Action to be called and the text to show in the menu item. <action> <id>SlantRangeGroundRangeOp</id> <class>org.esa.nest.dat.SRGROpAction</class> <text>Slant Range to Ground Range</text> <shortDescr>Converts a product to/from slant range to/from ground range</shortDescr> <parent>geometry</parent> <helpId>SRGROp</helpId> </action> The Action class should extend AbstractVisatAction and override the handler for actionPerformed
public void actionPerformed(CommandEvent event) {
dialog = new DefaultSingleTargetProductDialog("SRGR", getAppContext(), "Slant Range to Ground Range", getHelpId()); dialog.setTargetProductNameSuffix("_GR"); } dialog.show();
|