diff --git a/.gitignore b/.gitignore index 524f096..356a42c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Compiled class file *.class +target # Log file *.log diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README.md b/README.md index 61d1c3a..266cd34 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,94 @@ -# sen2vm-snap-plugin -Sen2VM SNAP plugin that calls the sen2vm-core standalone jar +# Sen2VM-snap-plugin + +Sen2VM SNAP plugin that calls the Sen2VM-Core standalone jar. For more details about the Sen2VM-Core, please refer to the following: https://github.com/sen2vm/sen2vm-core. + +### *Prerequisites* + +* build sen2vm-core +* create zip archive with the following structure +``` +sen2vm.zip + src/main/resources/orekit-data/ + sen2vm-core/ + sen2vm-core/sen2vm-core-0.0.1-SNAPSHOT.jar + sen2vm-core/configuration_example.json + sen2vm-core/params.json +``` + +### Build from sources + +* Build with maven and Java >11: + + ``mvn clean install`` + +### SNAP installation + +The bundle installation is not provided for now. You can distribute the archive with Python http.server to serve the zip file on the default SNAP URL: + + +`` python3 -m http.server 8000 `` + +Otherwise, you can choose local installation in the SNAP menu bundle installation. + + + +* Install plugin from snap menu: **Tools → Plugins** + +![img](doc/images/plugin_menu.png) + + + + + +Continue by **Downloaded → Add Plugins** and search for the nbm file in: + +sen2vm-snap-plugin/target/sen2vm-snap-plugin-1.0-SNAPSHOT.nbm + + + +![img](doc/images/install_plugin.png) + + + + + +![image-20250321112719642](doc/images/install_plugin_menu.png) + +At the end of the plugin installation, choose to restart SNAP to apply the changes. + + + +At this stage, only the plugin is installed. You need to install the installation bundle -> sen2vm.zip. At the first execution of the plugin, the installation bundle is proposed to the user. Otherwise, it is possible to install the bundle after the restart in the menu **Tools > Manage External Tools** + +![img](doc/images/manager_ext_tools_menu.png) + + + +Then, double click on **Sen2VM** + +![image-20250321113130636](doc/images/manager_ext_tools_view.png) + +Continue to **Bundled Binaries** and proceed to **Download and Install Now**. Then, click OK and exit from the **Manage External Tools**. + +![image-20250318171300788](doc/images/install_bundle_menu.png) + +![image-20250321113720087](doc/images/manager_ext_tools_view_green.png) + +### How to use it + +The sen2vm-snap-plugin is located in **Optical>Geometric>Sen2VM** + +Console output can be enabled via Display execution output. + +There are two ways to set the parameters. + +* Specify the path to configuration files: Configuration file and Parameters File. These parameters override all others. +> [!IMPORTANT] +> **Do not set them if you want to use the others.** +* Set the parameters and choose the detectors and bands to process + + + +![image-20250321114953248](doc/images/process.png) + +More details are available at: https://github.com/sen2vm/sen2vm-core diff --git a/doc/images/install_bundle_menu.png b/doc/images/install_bundle_menu.png new file mode 100644 index 0000000..7abeb0c Binary files /dev/null and b/doc/images/install_bundle_menu.png differ diff --git a/doc/images/install_plugin.png b/doc/images/install_plugin.png new file mode 100644 index 0000000..7f54c57 Binary files /dev/null and b/doc/images/install_plugin.png differ diff --git a/doc/images/install_plugin_menu.png b/doc/images/install_plugin_menu.png new file mode 100644 index 0000000..962a010 Binary files /dev/null and b/doc/images/install_plugin_menu.png differ diff --git a/doc/images/manager_ext_tools_menu.png b/doc/images/manager_ext_tools_menu.png new file mode 100644 index 0000000..ef85ef1 Binary files /dev/null and b/doc/images/manager_ext_tools_menu.png differ diff --git a/doc/images/manager_ext_tools_view.png b/doc/images/manager_ext_tools_view.png new file mode 100644 index 0000000..a6bd368 Binary files /dev/null and b/doc/images/manager_ext_tools_view.png differ diff --git a/doc/images/manager_ext_tools_view2.png b/doc/images/manager_ext_tools_view2.png new file mode 100644 index 0000000..7abeb0c Binary files /dev/null and b/doc/images/manager_ext_tools_view2.png differ diff --git a/doc/images/manager_ext_tools_view_green.png b/doc/images/manager_ext_tools_view_green.png new file mode 100644 index 0000000..e554ab2 Binary files /dev/null and b/doc/images/manager_ext_tools_view_green.png differ diff --git a/doc/images/plugin_menu.png b/doc/images/plugin_menu.png new file mode 100644 index 0000000..25d02e0 Binary files /dev/null and b/doc/images/plugin_menu.png differ diff --git a/doc/images/process.png b/doc/images/process.png new file mode 100644 index 0000000..37ad773 Binary files /dev/null and b/doc/images/process.png differ diff --git a/keystore/optical.ks b/keystore/optical.ks new file mode 100644 index 0000000..916c778 Binary files /dev/null and b/keystore/optical.ks differ diff --git a/pom.xml b/pom.xml index 53e8b64..e12bea6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,75 +1,127 @@ - - 4.0.0 + + 4.0.0 + org.esa + sen2vm + 1.0-SNAPSHOT + Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to L1B product images + sen2vm + https://github.com/sen2vm/sen2vm-snap-plugin + nbm + + UTF-8 + 11 + 11 + 11.0.0 + 1.0.0 + 2.0.05 + + + + snap-repo-public + Public Maven Repository for SNAP + https://nexus.snap-ci.ovh/repository/snap-maven-public/ + + true + warn + + + true + warn + + + + + + eu.esa.snap.netbeans + snap-help-system + ${snap-help-system.version} + + + org.esa.snap + snap-sta + ${snap.version} + + + org.esa.snap + snap-sta-ui + ${snap.version} + + + org.esa.snap + snap-rcp + ${snap.version} + + - esa.sen2vm - sen2vm-snap-plugin - 1.0-SNAPSHOT + + src/main/java + + + resources + + + + + + maven-dependency-plugin + 3.6.0 + + + - sen2vm-snap-plugin - - http://www.example.com + + + org.apache.netbeans.utilities + nbm-maven-plugin + 14.0 + true + + + javax.help + javahelp + ${javahelp.version} + + + + GPL 3 + LICENSE.txt + keystore/optical.ks + snap + snap-123 + true + + + + maven-compiler-plugin + 3.11.0 + + 11 + 11 + true + UTF-8 + + .gitignore + + + **/** + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.0 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + - - UTF-8 - 1.8 - 1.8 - - - - - org.junit.jupiter - junit-jupiter-engine - 5.10.2 - test - - - - - - - - - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - - - + \ No newline at end of file diff --git a/resources/META-INF/descriptor.xml b/resources/META-INF/descriptor.xml new file mode 100644 index 0000000..3db690c --- /dev/null +++ b/resources/META-INF/descriptor.xml @@ -0,0 +1,626 @@ + + sen2vm + org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterOp + Sen2VM + + 1.0.0 + Sentinel-2 Viewing Model tool goal is to compute and add geolocation information to + L1B product images + CSGroup + + false + false + Menu/Optical/Geometric + false + false + + $SEN2VM_JRE + + $SEN2VM_PLUGIN_DIR + + + + (^.*GRAVE|^.*SEVERE|^.*Exception)(.+) + + + + SEN2VM_PLUGIN_DIR + + $HOME/.snap/auxdata/sen2vm + $HOME/.snap/auxdata/sen2vm + false + true + + + + SEN2VM_JRE + $USER_HOME/esa-snap/jre/bin/java + false + + $USER_HOME/esa-snap/jre/bin/java + + false + + + + SEN2VM_JAR + $SEN2VM_PLUGIN_DIR/sen2vm-core/sen2vm-core-0.0.1-SNAPSHOT.jar + false + + $SEN2VM_PLUGIN_DIR/sen2vm-core/sen2vm-core-0.0.1-SNAPSHOT.jar + + false + + + + USERPROFILE + + false + + $USER_HOME + $HOME + false + + + + HOME + $USERPROFILE + false + $USERPROFILE + + + false + + + + USER_HOME + $USERPROFILE + false + $USERPROFILE + $HOME + $HOME + false + + + + + + + configurationFile + java.io.File + The use of the parameters configuration files takes priority over all + others + + + false + false + RegularParameter + + + parametersFile + java.io.File + The use of the parameters configuration files takes priority over all + others + + + false + false + RegularParameter + + + + operation + + java.lang.String + Type of operation + + direct + inverse + + false + false + RegularParameter + + + + L1B + + java.io.File + + Path to L1B product folder + false + false + FolderParameter + + + GIPP + + java.io.File + + Path to GIPP folder + false + false + FolderParameter + + + + dem + + java.io.File + + Path to DEM folder + false + false + FolderParameter + + + geoid + + java.lang.String + Path to GEOID file + + false + false + RegularParameter + + + + step10 + + java.lang.String + + Steps (pixels) for bands 10m + false + false + RegularParameter + + + step20 + + java.lang.String + + Steps (pixels) for bands 20m + false + false + RegularParameter + + + step60 + + java.lang.String + + Steps (pixels) for bands 60m + false + false + RegularParameter + + + + + output_folder + + java.lang.String + (mandatory for inverse loc) output folder + + false + false + RegularParameter + + + + referential + + java.lang.String + + (mandatory for inverse loc) referential + false + false + RegularParameter + + + lrx + + java.lang.String + + (mandatory for inverse loc) Lower Right X (referential unit) + false + false + RegularParameter + + + lry + + java.lang.String + + (mandatory for inverse loc) Lower Right Y (referential unit) + false + false + RegularParameter + + + ulx + + java.lang.String + + (mandatory for inverse loc) Upper Left X (referential unit) + false + false + RegularParameter + + + uly + + java.lang.String + + (mandatory for inverse loc) Upper Left Y (referential unit) + false + false + RegularParameter + + + + + iers + + java.lang.String + (optional) Path to IERS file + + false + false + RegularParameter + + + deactivate_gipp_check + + java.lang.Boolean + (optional) Deactivate the check of GIPP version; if select= "true", if not= + "false" + + false + false + RegularParameter + + + ignore_refining + + java.lang.Boolean + (optional) Allows to ignore refining parameters if they are available in + the Datastrip Metadata; if present= "true", if not= "false". + + false + false + RegularParameter + + + alt + + java.lang.Boolean + (optional) Export altitude in direct location grid; if select= "true", if + not= "false". + + false + false + RegularParameter + + + pod + + java.lang.String + (optional) Path to POD file/folder + + false + false + RegularParameter + + + + detector_01 + + java.lang.Boolean + Detector 01 to process + true + false + false + RegularParameter + + + detector_02 + + java.lang.Boolean + Detector 02 to process + true + false + false + RegularParameter + + + detector_03 + + java.lang.Boolean + Detector 03 to process + true + false + false + RegularParameter + + + detector_04 + + java.lang.Boolean + Detector 04 to process + true + false + false + RegularParameter + + + detector_05 + + java.lang.Boolean + Detector 05 to process + true + false + false + RegularParameter + + + detector_06 + + java.lang.Boolean + Detector 06 to process + true + false + false + RegularParameter + + + detector_07 + + java.lang.Boolean + Detector 07 to process + true + false + false + RegularParameter + + + detector_08 + + java.lang.Boolean + Detector 08 to process + true + false + false + RegularParameter + + + detector_09 + + java.lang.Boolean + Detector 09 to process + true + false + false + RegularParameter + + + detector_10 + + java.lang.Boolean + Detector 10 to process + true + false + false + RegularParameter + + + detector_11 + + java.lang.Boolean + Detector 11 to process + true + false + false + RegularParameter + + + detector_12 + + java.lang.Boolean + Detector 12 to process + true + false + false + RegularParameter + + + + band_01 + + java.lang.Boolean + Band 01 to process + true + false + false + RegularParameter + + + band_02 + + java.lang.Boolean + Band 02 to process + true + false + false + RegularParameter + + + band_03 + + java.lang.Boolean + Band 03 to process + true + false + false + RegularParameter + + + band_04 + + java.lang.Boolean + Band 04 to process + true + false + false + RegularParameter + + + band_05 + + java.lang.Boolean + Band 05 to process + true + false + false + RegularParameter + + + band_06 + + java.lang.Boolean + Band 06 to process + true + false + false + RegularParameter + + + band_07 + + java.lang.Boolean + Band 07 to process + true + false + false + RegularParameter + + + band_08 + + java.lang.Boolean + Band 08 to process + true + false + false + RegularParameter + + + band_8A + + java.lang.Boolean + Band 8A to process + true + false + false + RegularParameter + + + band_09 + + java.lang.Boolean + Band 09 to process + true + false + false + RegularParameter + + + band_10 + + java.lang.Boolean + Band 10 to process + true + false + false + RegularParameter + + + band_11 + + java.lang.Boolean + Band 11 to process + true + false + false + RegularParameter + + + band_12 + + java.lang.Boolean + Band 12 to process + true + false + false + RegularParameter + + + + targetProductFile + java.io.File + Output file + + false + false + RegularParameter + + + + + user + false + true + + NONE + REMOTE + + + + ZIP + + REMOTE + http://0.0.0.0:8000/sen2vm.zip + + arguments + java.io.File + + TemplateParameter + + + targetLocation + java.io.File + null + + RegularParameter + + +