Sen2Cor 2.4.0, Stand-Alone Installers, How To Install

This is the installation procedure for the new Sen2Cor stand-alone installers, first released with V2.4.0.

After download and installation these packages will work fully autonomously, isolated, and do not need any further installation of Anaconda, GDAL, OpenJPEG or any other python packages.

The installation procedure is as follows:
Download the package of your choice from the ESA STEP website which is accessible here:

http://step.esa.int/main/third-party-plugins-2/sen2cor/

  • Sen2Cor-2.4.0-win64.zip
  • Sen2Cor-2.4.0-Linux64.run
  • Sen2Cor-2.4.0-Darwin64.run

On Windows: extract the zipped archive with an unzip tool. This will create a folder named: Sen2Cor-2.4.0-win64.

Edit: Please have a look at these instructions: Sen2cor 2.4.0 on SNAP 6.0

You can place the extracted folder in your user account at your choice. Then, change into the directory Sen2Cor-2.4.0-win64 using the windows command line interpreter and call the command ā€œL2A_Process.bat ā€“helpā€. It shall show:

C:\Users\example_user\AppData\Local\Sen2Cor-2.4.0-win64\L2A_Process.bat --help
usage: L2A_Process.py [-h] [ā€“resolution {10,20,60}] [ā€“sc_only] [ā€“cr_only]
[ā€“refresh] [ā€“GIP_L2A GIP_L2A]
[ā€“GIP_L2A_SC GIP_L2A_SC] [ā€“GIP_L2A_AC GIP_L2A_AC]
directory

If the processor replies as shown above without any error, you are ready to process. If you add the directory containing the L2A_Process.bat file to your path, you can call the processor directly from the directory where you host the Level-1C user products.

The configuration data of the processor are by default copied into the folder ā€œsen2corā€ inside the Document directory of your home folder.

On Linux and macOS: extract the compressed archive with the system command:
ā€œbash Sen2Cor-2.4.0-Linux64.runā€, or
ā€œbash Sen2Cor-2.4.0-Darwin64.runā€

The installers will then create the folder: Sen2Cor-2.4.0-Linux64, respective Sen2Cor-2.4.0-Darwin64 under the current directory. There is also an option to specify the target folder during installation time, and to give an appropriate name for the installation directory:

Example (for Linux, Mac follows the same principle):

To use a different installation directory use the --target option:
ā€œbash ./Sen2Cor-2.4.0-Linux64.run --target /tmp/sen2cor240ā€

Then, change into the directory Sen2Cor-2.4.0-Linux64 using the Linux bash shell. Confirm that Sen2Cor is correctly installed with the following command:

bash: bin/L2A_Process --help
usage: L2A_Process.py [-h] [ā€“resolution {10,20,60}] [ā€“sc_only] [ā€“cr_only]
[ā€“refresh] [ā€“GIP_L2A GIP_L2A]
[ā€“GIP_L2A_SC GIP_L2A_SC] [ā€“GIP_L2A_AC GIP_L2A_AC]
directory

If the processor replies as shown above, you are ready to process. Optionally, you can source the script L2A_Bashrc located in the root folder of the installation automatically from your .bashrc or .profile. Thereafter, you can call the processor directly from the directory where you host the Level-1C user products. The configuration data of the processor are by default copied into the folder ā€œsen2corā€ inside of your home folder.

The uninstallation of the packages is simply done by removing the installed folder. There are no further leftovers except the sen2cor configuration in your home folder, which can also simply be removed.

If you observe any issues during installation or usage of the standalone installers, please reply here, under this thread, with an explicit information on which operating system the issue occurred. Please, do not open a new thread for this purpose, as it will be difficult for us to track the problems, if multiple threads with the same issues exist.

with best regards,
Sen2Cor Development Team

Update on 21/09/2017: the macOS standalone package of sen2cor 2.4.0 contained a bug preventing it from being used along with an existing install of anaconda and glymur. This has been fixed. If you get the following warning on MacOS : libopenjp2.dylib could not be loaded , please download the package Sen2Cor-2.4.0-Darwin64.run again from the website and install it again.

We are very sorry for the inconvenience,
Sen2Cor Development Team

8 Likes

Do you mean adding the path to the environment variables?

Yes, that is what is meant.

Tried the standalone installer, works fine - good job!

Adding the directory to PATH variable made it available from anwhere.

Thanks Uwe,
Sen2cor can now be Installed fast and works at once on a Fedora Linux computer. Good work !
Does the new version includes algorithm improvements ? I just noticed a few bug corrections that will affect the results.
Best regards,
Olivier

Hi Olivier & Andreas, thanks for the flowers, the stand alone installer has been developed by CS, so I will forward the compliment to them. About algorithm improvements: The following three fixes have in fact a slight impact on the output results compared to V.2.3.1: SIIMPC-952, 957, 998 and 1015 (see release note). Bigger Alogithmic improvements are planned for the next release 2.5.0 (already under development) for cirrus correction and AOT.
Cheers,
Uwe

3 Likes

Hello,
I installed the standalone and added the directory in the PATH variables as suggested. When I try the command line, itā€™s working and it can actually work from anywhere.
However, I canā€™t run Sen2Cor in SNAP. Somehow, there is always that SNAP extension running in place. Any tips on how to run the new standalone version in SNAP? or maybe a detailed explanation on how to process an image using the command prompt? Thanks in advance and sorry if my question is too ā€œdumbā€ :confused:

Thanks,
Confiance

1 Like

I donā€™t think it is dumb at all. I also wondered how SNAP ā€˜findsā€™ sen2cor if it is just used as standalone software.

1 Like

SNAP 6 will come with a Sen2Cor stand-alone plugin; when you launch the Sen2Cor via SNAP for the first time, it will ask you if you want to download the plugin. If itā€™s already downloaded you will be able to tell SNAP itā€™s location. SNAP 5 works with classic Sen2Cor.
Launching stand-alone Sen2Cor with SNAP 5 would requires to change the SNAP adapter (change the executable path, the command lineā€¦).

1 Like

I am on Ubuntu 16.04 LTS
The install process went smoothly but I struggled to get it to work. The bash script is in the bin folder, only this worked:

~/Software/Sen2Cor-2.4.0-Linux64/bin$ bash L2A_Process --help
usage: L2A_Process.py [-h] [--resolution {10,20,60}] [--sc_only] [--cr_only]
                      [--refresh] [--GIP_L2A GIP_L2A]
                      [--GIP_L2A_SC GIP_L2A_SC] [--GIP_L2A_AC GIP_L2A_AC]
                      directory

Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.4.0, created: 2017.06.05,
supporting Level-1C product version: 14.

positional arguments:
  directory             Directory where the Level-1C input files are located

optional arguments:
  -h, --help            show this help message and exit
  --resolution {10,20,60}
                        Target resolution, can be 10, 20 or 60m. If omitted,
                        all resolutions will be processed
  --sc_only             Performs only the scene classification at 60 or 20m
                        resolution
  --cr_only             Performs only the creation of the L2A product tree, no
                        processing
  --refresh             Performs a refresh of the persistent configuration
                        before start
  --GIP_L2A GIP_L2A     Select the user GIPP
  --GIP_L2A_SC GIP_L2A_SC
                        Select the scene classification GIPP
  --GIP_L2A_AC GIP_L2A_AC
                        Select the atmospheric correction GIPP

Just to make people like me save some time :slight_smile:
Thanks for the new version

Thanks for the hint, I have updated the installation procedure accordingly.

Hello

Today in order to process the new L2B data, Iā€™ve unistalled SNAP 5 and sen2cor 2.3.0, Iā€™ve installed the new sen2cor 4.0 standalone (using the procedure that I read in this post and all seem OK) and then Iā€™ve installed the beta version 6.0 of SNAP.

Iā€™ve read above that when I launch the Sen2Cor via SNAP 6.0 for the first time, it will ask me if I want to download the plugin. If itā€™s already downloaded I have to tell SNAP itā€™s location.

This non happened to meā€¦ When I search sen2cor in ā€œOptical -> thematic land processingā€ I canā€™t find it and SNAP donā€™t ask me to download the plugin.
If I go in ā€œtools -> Pluginsā€ I canā€™t find sen2cor in any tags (Availeble Plugins, Downloaded, Installed ecc.).

Any idea on how to run the new standalone version in SNAP 6.0?
How can I add to SNAP the sen2cor location?

Thanks in advance

Roberto

Hi,

I found something much more simple for my Ubuntu 16.04 configā€¦ I had forgotten about the command source (or ā€˜.ā€™)
Either in the bashrc or before you start your script, you can do:
source /home/user/sen2cor/L2A_Bashrc
or
. /home/user/sen2cor/L2A_Bashrc

L2A_Process command should now work from anywhere.

Cheers

L2A_Process script in bin directory already does the source ./L2A_Bashrc. Maybe this file could be removed in future release and put all those env setting inside bin/L2A_Process.
Users then only have to call L2A_Processs with full path, alias, or adding PATH or sen2cor240/bin to system PATH

@umwilm, any thoughts ?

1 Like

I do not use sen2cor, I think I should install correctly, but when I go to run it the following error appears:
"Before executing the tool, please correct the errors below: - Working path does not exist: $SEN2COR_HOME

  • Variable SEN2COR_HOME is not set "

I need help, urgently!!!

so did you set this variable already?

How to set it correctly is explained in multipe topics: http://forum.step.esa.int/search?q=sen2cor_home

Hi there !

Iā€™ve a problem too with the installation. Iā€™m on windows 10 - 64bits.
As you can see here, everything is fine about the Sen2cor file. It is situated in the Users documents.
The command displays the right message :

Then Iā€™ve set the PATH into the environment variables :

And after this step, I launch SNAP but there is no Sen2Cor tool in ā€œOptical -> thematic land processingā€. Did I miss something or something is wrong with my installation ?

Thanks in advance

Remi

1 Like

Would anyone please make a Youtube video showing the installation and running of the stand alone Sen2Cor plugin in windows as it would help many users to
follow and do it the right way Please!

3 Likes

I am trying to install on armv71 architecture (64bit, Raspberry PI 3) but I get

bin/python2.7: cannot execute binary file: Exec format error

and ELF errors, which suggest the compilation is not working for this kind of architecture. Since sen2cor is not really open source, there is supposedly no possibility to compile from source. Do you intend to release a binary version for armv71?

Guido

you can get sen2cor 2.4.0 sources but not for atcor. ATCOR is proprietary of DLR and is only released in binary form by ESA.
Here you must pay attention to ā€œbinary formā€. Sen2cor is expected to run on three major platforms namely Windows, GNU/Linux, OSX. Unfortunately, the list doesnā€™t include any RPIs.

Adding RPI to list of ā€œsupportedā€ will be more maintenance without almost zero benefit.
because there are some memory requirements when it comes to Sen2Cor processing. I

What is your actual use case of sen2cor in RPI? just curious?