Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Even though SNAP is based on the Java programming language it supports also the development of operator plugins written in Python. This is made possible by the snappy module. It enables Python developers to write operators for SNAP. In the background, snappy uses the library jpy which builds a bridge between Java and Python.
The intention of this page is to point out where writing an operator in Python is different from writing an operator in Java and what you need to consider. In general, the concepts presented in How to create a new operator How to integrate an operator, and Operator Implementation Guidelines also apply here. This page will focus on pointing out where they are different. A working example of a Python operator plugin can be found in the snap-examples repository on GitHub. The RUT project provides an example of a Python-based Operator in operational use. As you will use the Java API of SNAP Engine via snappy, you should familiarize yourself with this API, or at least know where and how to look things up. 

...

In order to make the development easier, we recommend PyCharm as your IDE. Also, before starting to implement an operator you should make sure that you have followed the procedure described in Configure Python to use the SNAP-Python (snappy) interface (SNAP versions <= 9).

Project Structure

The recommended basic project structure differs slightly from the structure of a Java project. It looks as shown in the following code block.

...