Best way to develop and debug a new engine Processor


#1

I want to create some new processors to be integrated into snap. Preferably I would like to use Java in order to make sure all dependencies are met, since as I read in the python guide: “* ensure same Python configuration (used libraries) on the user system as the developer uses”, which is something quite hard to obtain. Is this statement true?

I found information about how to integrate a new processor in confluence.
However, I have several doubts:

  1. The example in github referenced in the documentation here does not have anything in common with the documentation. It does not implemente computeTile or computeTileStack methods. Is there an up to date version or am I missing something? I have found some useful code in the s1tbx code like here

  2. The steps to integrate a processor are explained, however I do not see how to finally make it available in my snap installation after I finally create it. I mean, I guess I will need to take the .jar and place it somewhere. Am I right?

  3. In the perfect scenario, I would also like to debug my code while I implement it. I see two options for this:

    • Develop the processor disconnected from the snap desktop and just test and debug the application writting my own unit tests. In this case, how can I extract the tiles from a Product to pass them to my Operator methods?
    • Directly build the sources of snap and launch in my IDE the whole desktop app
    • Run in “debug” mode my Operator inside snap desktop in some sort of esoteric way. Is this possible?

Thanks in advance, and in case you have any other reference to documentation or code… I would really appreciate it


#2

Hi,
I am going to try to answer your questions.

  1. That example extends the class PixelOperator, which implements the missing method, please see: https://github.com/senbox-org/snap-engine/blob/master/snap-gpf/src/main/java/org/esa/snap/core/gpf/pointop/PixelOperator.java
    When you extend this class, the abstract method you need to implement is the computePixel method
  2. To integrate you processor, when you build it using maven you can generate a nbm file that then you can install as a plugin in SNAP via Menu->Tools->Plugin
  3. To debug it, I recommend you to follow the steps here:
    https://senbox.atlassian.net/wiki/spaces/SNAP/pages/24051775/IntelliJ+IDEA
    You have to add your plugin to the --patches and --clusters options.