Adding an external module cluster to SNAP
SNAP consists of multiple modules and can be extended by further more. Many of the modules are grouped in so called 'clusters'. Simply spoken just a bunch of modules. The toolboxes and SNAP it self are clusters. The clusters are located in the installation directory. The folders snap, s1tbx, s2tbx and s3tbx are all clusters.
A SNAP installation can be extended by additional clusters. A cluster is created during the build process of project. More on this at the end
Adding a cluster to SNAP Desktop
In order to let SNAP desktop start with an additional cluster you need to edit the snap.conf (located in the etc
folder of the SNAP installation directory) file.
Please note that you need admin rights in order to edit the file on Windows. Within this file you find the property extra_clusters
.
# Extra cluster paths separated by semicolon ';' #extra_clusters=""
Add the path to the cluster directory and remove the '#' at the line start. For example like
extra_clusters="D:\my_clusters\extra"
If the path ends with 'extra' depends on the project configuration it can have some other name.
You can add multiple extra clusters by adding multiple paths.
SNAP desktop should now start with the new clusters and the new functionality will be available.
Adding a cluster to gpt
In order to configure gpt to use an extra cluster, the following needs to be done.
Open the file gpt.vmoptions
(admin rights needed on Windows ) and add the line
-Dsnap.extraClusters=G:/snap-extension/extra
Instead of adding the parameter to the gpt.vmoptions
file, it can be specified directly on the command line when gpt is invoked, like
gpt -J-Dsnap.extraClusters=G:/snap-extension/extra Graph.xml -t D:\data\output.nc D:\data\input.nc
Creating a cluster
A cluster is created during the build process. How a project should be setup and how it is build is described in How to develop an extension module.
So, an invocation of the maven command mvn package
will create a directory in the build target folder which will have the following structure.
C:\MyProject\target\nbm └───netbeans └───extra ├───config │ └───Modules ├───modules │ ├───docs │ └───ext └───update_tracking
The folder named 'extra' here is the cluster. It can be copied to some other location and the path can be specied for SNAP Desktop and gpt as described as above.