Sen2Cor 2.8 in the windows command line

Hello

I am trying to process a time series of S2 images between 2015-2016 with Sen2Cor 2.8. In some cases it works pretty much fine, but in others I get an strange error message:

D:/Software/Sen2Cor-02.08.00-win64/L2A_Process.bat --resolution 20 --GIP_L2A D:/Software/Sen2Cor-02.08.00-win64/L2A_GIPP.xml --output_dir D:/trials-sen2/repL2 D:/trials-sen2/repL1/34TEQ/S2A_MSIL1C_20150729T092006_N0204_R093_T34TEQ_20150729T092004.SAFE
Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.8.0, created: 2019.02.20, supporting Level-1C product version 14.2 - 14.5 started ...
Old product version 14.2 detected, - will be updated to 14.5
Processing baseline will also be updated
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]:  0.00 : Generating datastrip metadata
L1C datastrip found, L2A datastrip successfully generated
Selected resolution: 20 m
[Error 183] Cannot create a file when that file already exists
Traceback (most recent call last):
  File "D:\Software\Sen2Cor-02.08.00-win64\\Lib\site-packages\sen2cor\L2A_Process.py", line 495, in main
    if tile.process() == True:
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_ProcessTileToolbox.py", line 128, in process
    if not self.process_resolution(20):
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_ProcessTileToolbox.py", line 139, in process_resolution
    self.tables = L2A_Tables(self.config)
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_Tables.py", line 174, in __init__
    os.path.join(self._L2A_QualityDataDir, fnOut))
WindowsError: [Error 183] Cannot create a file when that file already exists
Progress[%]: 100.00 : Application terminated with at least one error.

I tried with a fresh output folder but the results are pretty much the same. Does anybody know what might be the source of this error?

In general to call the sen2cor from the console, you should add it your path, it seems that you didn’t add it,

I don’t know how it runs properly before as you said!

Add sen2cor to your path as below,

recall it by adding up the directory of your input,

L2A_Process.bat --resolution 20 --GIP_L2A /D:/S2.

Hello, thank you for your quick answer

I added the folder to the path as instructed, however, I am afraid I get the same message

C:\Users\biom7>D:/Software/Sen2Cor-02.08.00-win64/L2A_Process.bat --resolution 20 --GIP_L2A D:/Software/Sen2Cor-02.08.00-win64/L2A_GIPP.xml --output_dir D:/trials-sen2/repL2 D:/trials-sen2/repL1/34TEQ/S2A_MSIL1C_20150729T092006_N0204_R093_T34TEQ_20150729T092004.SAFE
Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.8.0, created: 2019.02.20, supporting Level-1C product version 14.2 - 14.5 started ...
Old product version 14.2 detected, - will be updated to 14.5
Processing baseline will also be updated
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]:  0.00 : Generating datastrip metadata
L1C datastrip found, L2A datastrip successfully generated
Selected resolution: 20 m
[Error 183] Cannot create a file when that file already exists
Traceback (most recent call last):
  File "D:\Software\Sen2Cor-02.08.00-win64\\Lib\site-packages\sen2cor\L2A_Process.py", line 495, in main
    if tile.process() == True:
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_ProcessTileToolbox.py", line 128, in process
    if not self.process_resolution(20):
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_ProcessTileToolbox.py", line 139, in process_resolution
    self.tables = L2A_Tables(self.config)
  File "D:\Software\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_Tables.py", line 174, in __init__
    os.path.join(self._L2A_QualityDataDir, fnOut))
WindowsError: [Error 183] Cannot create a file when that file already exists
Progress[%]: 100.00 : Application terminated with at least one error.

I think you didn’t add the path as I mentioned in previous post, to be sure the path is added up correctly, aftermath typing

L2A_Process.bat --help

This should be the result,

Okay, this is weird. I did add the path, I checked. If I call the suggested command I get nothing… However, if I am running the cmd as administrator, it does produce the output you mention:

Basically you should unzip the file in C: then you’ll get this folder,

image

Delete the zip file, and then add up the path as you did, after adding up the path you could call the sen2cor from the console as I mentioned in the previous post,

For more details about the plugin, please take a look at the following thread,

Source of the thread

It’s also explained under following item,

4.1New stand-alone installers(since release 2.4.0)

In here,

Source

Also please take a look at following (Edit and add path in windows)

Source

Hey @borlafgis,

I notice that you’re trying to process older sentinel-2 images (2015). Sen2Cor 2.8 doesn’t work well with older images from my personal experience. Try Sen2Cor 2.55 instead.