Hi,
After processing sen2cor for L1C I got part of the image which is not the same from L1C product ? any one knows what happen to get this? I used the same resampling resolution 60m for both!
Please @ChristianSeverin if you could help in this issue, your help and time much appreciated!
Thanks,
D
Did you receive any message that showed you that sen2cor was finished? It looks like only some tiles were processed.
I only use sen2cor with the command window and this works usually fine:
L2A_Process --resolution 20
No I did not recieve any message, it was just as the window below as I have to close the first windows becaiuse it took long time without seeing any progress!


How I can use the command window with sen2cor? any idea where I should open the window and any available scripts for this ? Your help is much appreciated !
Thanks
Hello Daniel
You can find the answer to your quesiton in the following topic:
sen2cor
If you want to run your directly in the command window:
- Type
cmd
in the search field and choose cmd.exe
- Type e.q. L2A_Process --resolution 20 C:<path to your S2 main directory> and klick Enter.

If you would like to use it in a python script (e.g. if you have multiple files you need to process), then you could add the following prompts into your script:
import os
cmd = 'L2A_Process --resolution 20 C:/S2/S2A_OPER_PRD_M..._20151211T084342'
os.system(cmd)
If you wish, then I could provide you with a script.
I hope this helps.
Cheers,
Andreas
2 Likes
Thanks a lot @abgbaumann
Could you please provide me with the script for python!
Your help is much appreciated!
Thanks,
D
Ok, but first I have to rewrite it properly. Otherwise nobody is able to decipher it. 
1 Like
OK, appreciate your time and help 
i used it the windows command but i get a message “Metadata file is invalid, see logfile for details.”
any ideas please
Sorry for the delay. It took a little longer to fix it. The python script should work under WINDOWS without problems (LINUX not operational at the moment). 
script.zip (5.1 KB)
Run the script in the command window:
> python C:\...\examples\run_sen2cor.py <S2_L1C_Collection_in_path> <resolution> <S2_L2A_Collection_out_path>
Parameters:
<S2_L1C_Collection_in_path> : Mandatory, e.g. C:\S2-Collection
<resolution> : Optional, Default = 10
<S2_L2A_Collection_out_path> : Optional, Default = <S2_L1C_Collection_in_path>
Cheers,
Andreas
1 Like
Thanks @abgbaumann ! Appreciated your help and time!
Hi @abgbaumann,
Regarding running your python script in cmd windos , could you please correct my code as below, as I am keeping getting error, I am typing the following
Python C:\Users\user\Documents\script\examples\run_sen2cor.py C:\Users\user\Documents\Sentinel\S2A_L1C_20160606\S2A_OPER_MTD_SAFL1C_PDMC_20160606T223859_R137_V20160606T110624_20160606T110624.xml resolution (60) C:\Users\user\Documents\Sentinel\
Thanks a lot !
D
Good morning,
my code was made for the old sen2cor version. With the new versions 2.x.x not everything works properly anymore: The change of the output directory does not work anymore and I need to figure out how to change it in the new version. But in your case it does not really matter because input is equal to output:
Python C:\Users\user\Documents\script\examples\run_sen2cor.py C:\Users\user\Documents\Sentinel\S2A_L1C_20160606 60
The input link can go to the main directory where you stored your sentinel-2 files. And you don’t need to write resolution (60).
I hope it works.
Andreas
Thanks @abgbaumann for the explanation…
Btw. in your case it is not needed to use a script, because:
- You only want to run one file.
- You dont change the output.
These were the reasons why I made a python script.
For your case it is enough to run it directly in the command window with:
L2A_Process --resolution 60 C:\Users\user\Documents\Sentinel\S2A_L1C_20160606
Best regards,
Andreas
@abgbaumann
I tried to run but getting this error:
Sentinel-2 Level 2A Prototype Processor (Sen2Cor), 2.0.6, created: 2015.12.02 started …
Fatal error occurred, see tracefile for details.
My windows is 10 -64bit
Thanks for your help,
D
Hi Daniel
Then something with your installation went wrong and my script will not run either. But in any case you still have to old version of sen2cor. You should update it and it will most probably run properly again.
You can find the newest version here (2.2.1):
http://step.esa.int/main/third-party-plugins-2/sen2cor/