Help with sen2cor and SNAP

is your installation directory really D:\sen2cor-2.2.1?

I have it two locations. one in D:\ and another one in the downloads folder.

This picture shows the path that I specified during the installation.

how did you install it?
It is actually under C:\Anaconda\Lib\site-packages\sen2cor-2.2.1-py2.7.egg\sen2cor

Could be that it cannot be found because of this.

What happens when you type L2A_Process in your command line?

This is what I get as result:

that looks fine.
Can you run the tool from the command line?

Just open your command line in the folder where the folder with your S2 data (.safe) is located and type
L2A_Process --resolution 60 nameofthefolder

Hey again,
here is where I have the sentinel data. what folder should I put on that command?

the one which would be one level above. It is created when you extract the data.
But the original path S2A_OPER…safe is needed.

see here, page 40

Thanks Braun. I went through that pdf.
where do should I specify the path in this picture? (C:\Program Files\Anaconda2\Lib\site-packages\sen2cor-2.2.1-py2.7.egg\sen2cor).

Could you possibly, explain what this is doing: It is a screenshot from page 40 of the pdf.

where can I find the L1C Product Directory on my computer?

this is the directory you download and extract to any folder you want. It is just required to not change the name of the folder

L2A_Process runs the correction from outside SNAP. It however requires a resolution and the name of the folder.

For example:

  1. You download the data in C:\Downloads\
  2. Then you extract the data here. This creates data in one subfolder wth the data (AUX_DATA…) you showed above. Leave the name as it is: C:\Downloads\S2A_OPER_BWI…
  3. You start the correction from the command line in this folder: C:\Downloads\ like this L2A_Process --resolution 60 S2A_OPER_BWI...
    You can recall the total name of the subfolder with the tabulator key so you won’t need to type it in manually.

Am I doing something wrong here? In specifying the L1C Level directory

I am using windows 7

Again here is where I have the files:

as stated in the error message: You may not rename the folder in which the data is located (S2A_10_6 in your case). It has to stay like it is extracted.

Extract it in your Project folder, so there is the S2A_OPER_BWI[...].safe folder. Run the command from outside this folder. Then it should work.

This time I renamed the folders as you said. But when I run the L2A Process command, I get this error.

can you please again post a screenshot of your folder?

this is how it works for me from the command line:

Get the data
the zip-file is in
in my case

Extract the data
The data is now located in

Open the command line in this superior folder, D:\S2 in my case. Don’t navigate in the data folder.

Type L2A_Process --resolution 60 S2A_OPER_PRD_MSIL1C_PDMC_20160721T183022_R065_V20160721T102059_20160721T102059.SAFE

You don’t need to type the whole folder name manually, just hit the tabulator button after the "60 " (indicated by the red x) and you will be given all names of the available files and folders. Make sure you select the folder (.SAFE) and not the zip-file.

Hit ENTER and it should run - given that sen2cor is installed correctly. Otherwise there was an error in the installation, the file structure, the data or your system variables.

Show us the error if it occurs.

Otherwise you will receive this:

A new folder is created: S2A_USER_PRD_MSIL2A_PDMC_20160721T183022_R065_V20160721T102059_20160721T102059.SAFE

It can be opened in SNAP.
They are optically alike but you can see the changes in a scatter plot, for example.

There is also a classification file. It is an indicator if sen2cor performed correcly (although there are many clouds in my example)

1 Like

Thanks! which snap version are you using?

the latest available
S1TBX 4.0.4
S2TBX 4.0.2

1 Like