i try to run sen2cor via snappy.
Sen2cor is installed in the snap desktop aplication (as Plugin). I use Python 2.7.
The newest versions of SNAP and Sen2cor are installed.
The code i am trying to run is:
import snappy
from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
I receive the following error message:
Traceback (most recent call last):
File , line 13, in
GPF.createProduct(‘Sen2Cor’, “parameters”, s)
RuntimeError: no matching Java method overloads found
The last line is line 13.
Can anybody tell me what that error is about.
Thank you really much in advance.
I was running it before without quotes and recieved the following error message:
GPF.createProduct(‘Sen2Cor’, parameters, s)
RuntimeError: org.esa.snap.core.gpf.OperatorException: Operator ‘ToolAdapterOp’: Value for ‘Resolution’ must be of type ‘String’.
I have executed the script and it is working here. Please, @Leddow11, could you try to execute Sen2Cor directly from SNAP Desktop to be sure that everything is properly installed?
It finnaly works. But the L2A product is just avo ihave to run the process first in 20m and then 10m. Or is this done automaticly like in the desktop aplication?
I recieve the following message in the end of the process:
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 49.20 : PID-4492, L2A_Tables: band VIS exported, elapsed time[s]: 1.015, total: 0:19:31.651000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Process L2A_ProcessTile-1:
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Traceback (most recent call last):
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\lib\multiprocessing\process.py”, line 258, in _bootstrap
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: self.run()
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 136, in run
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: if not self.process_10():
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 179, in process_10
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: if not self.process_20():
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 158, in process_20
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: return self.process()
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 229, in process
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: if self.postprocess() == False:
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_ProcessTile.py”, line 311, in postprocess
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: if not self.tables.exportBandList():
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: File “C:\Users\Niels.snap\auxdata\Sen2Cor-02.05.05-win64\Lib\site-packages\sen2cor\L2A_Tables.py”, line 2307, in exportBandList
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: fn = os.path.basename(self._L2A_Tile_PVI_File)
SEVERE: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: AttributeError: ‘L2A_Tables’ object has no attribute ‘_L2A_Tile_PVI_File’
INFO: org.hsqldb.persist.Logger: Database closed
That is my code to run sen2cor via snappy (python 2.7, sen2cor2.05.05, SNAP 6.0):
import snappy
from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
I try to run a other operator (SaviOp):
import snappy
from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
A new one occured. Do i have to define the directory were the GPF.createproduct is creating a folder for my file. For Sen2cor it was working automaticly.
Running the script know i recieve the following error:
Actually GPF.createproductdoes not write to the disk automatically. Only if you use it with the write operator. Writing to disk is also done if you use ProductIO.writeProduct()
For the latter one it depends on the concrete writer implementation. But in general it would be good if the directory already exists.