Sen2coral_python


#1

Is there any possibility of running sen2coral from python so i can use it in batch mode for multiple images?


#2

It should work using snappy. Please see:
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/19300362/How+to+use+the+SNAP+API+from+Python

Another option for running SNAP in batch mode is the Graph Processing Tool (GPT) that is included in the SNAP installation.
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503590/Creating+a+GPF+Graph


#3

Thank you for your answer. One more question but how i can call the plugin of sen2coral since it is a build plugin (you call it from IntelliJ IDEA programm)?


#4

If you have built it properly, then you will have some .nbm files in the target/netbeans-site folder of the sen2coral-kit. You can use these files for installing the sen2coral plugin in SNAP: Tools->Plugin->Downloaded->AddPlugins…

If you prefer, you can also execute it directly from IntelliJ.


#5

I have build the application and i have installed the plugin in snap. I have installed jython.

I was trying to implement this code for the Depth Invariant Indices :
import snappy
from snappy import *
from snappy import GPF
from snappy import jpy
from snappy import HashMap
from snappy import ProductIO

product=ProductIO.readProduct(‘F:\sen2coral\polygona_deep_geom.dim’)
HashMap = jpy.get_type(‘java.util.HashMap’)

last=str(product)
parameters = HashMap()
parameters.put(‘sourceBands’, ‘B2,B3’)
parameters.put(‘deepWaterVector’,‘geom_1’)
parameters.put(‘sameBottomVectors’, ‘deep’)
c1=GPF.createProduct(‘test’,parameters)
p=ProductIO.writeProduct(c1,‘F:\sen2coral\test1000.dim’,‘BEAM-DIMAP’)

How i can call in this script the Depth Invariant Indices?