I am trying to implement sen2cor from python. The script i am using is
import snappy
from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
s=ProductIO.readProduct(‘C:\Program Files\snap\S2A_MSIL1C_20170910T090021_N0205_R007_T35SMD_20170910T090725.SAFE’)
HashMap = snappy.jpy.get_type(‘java.util.HashMap’)
snappy.GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis()
parameters = HashMap()
parameters.put(‘resolution’, 60)
L2A_image = snappy.GPF.createProduct(‘Sen2Cor’, parameters, s)
I get the following error.
Traceback (most recent call last):
File “C:\Python34\doriforikes\test.py”, line 32, in
L2A_image = snappy.GPF.createProduct(‘Sen2Cor’, parameters, s)
RuntimeError: org.esa.snap.core.gpf.OperatorException: Unknown operator ‘Sen2Cor’. Note that operator aliases are case sensitive.
I tried the script but it didn t work.
Also i tried the combination snap beta 6 and sen2cor and it didn t work.
I tried to install sen2cor and now i get the following error C:\Python27\lib\site-packages\glymur\config.py:153: UserWarning: Neither the openjp2 nor the openjpeg library could be loaded.
I already installed glymur library supposed to have openjpeg.
Which version of sen2cor are you using? Is it version 2.4.0?
This brings its own python and should interfere with the one you already have installed. At least as far as I understood this.