Sen2Cor 2.4.0, Stand-Alone Installers, How To Install


#1

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


Is there anyone ever succeed with Sen2Cor on SNAP?
Sen2Cor 2.4.0, Anaconda based Version, Recent Issues
Sen2Cor doesn't run from command line
Error in install sen2cor2.4.0 in windows 8
Specify system variable PYTHON_BIN for Sen2Cor
Mosaicing tool to supervised clasification
Sen2cor2.3.1 using windows
Avoiding Anaconda installation
Sen2cor2.3.1 using windows
Sen2Cor 2.4.0, Anaconda based Version, Recent Issues
Warning in conversion to L2A user product
Sen2Cor: need for previous versions
Python_sen2cor
SNAP log file and errorr on exection
#2

Do you mean adding the path to the environment variables?


#3

Yes, that is what is meant.


#4

Tried the standalone installer, works fine - good job!

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


#5

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


#6

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


#7

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


#8

I don’t think it is dumb at all. I also wondered how SNAP ‘finds’ sen2cor if it is just used as standalone software.


#9

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…).


Sen2cor in Snap 6 beta
Sen2cor in windows 10
Error in install sen2cor2.4.0 in windows 8
#10

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


#11

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


#13

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


#14

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


#15

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 ?


#16

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!!!


#17

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


#18

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


#19

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!


#21

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


#22

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?