Sen2cor supporting processing baseline 05.11

Thanks @diana_harosa for your reply, I had missed that post. What is the minimum SNAP version necessary to run this new Sen2Cor release?

If you want to run sen2cor from SNAP, the plugin adapter is available only for SNAP 10

Dear Step forum community,

We use a dockerized version of sen2cor based on mundialis docker-sen2cor.
Below is the Dockerfile we are using to upgrade to sen2cor v2.12

FROM geographica/gdal2
RUN apt-get update -y && apt-get install -y \
    python-pip \
    python-dev \
    curl \
    unzip \
    wget && \
    rm -rf /var/lib/apt/lists/*

# Upgrade pip
RUN pip install --upgrade pip

# Set the working directory to /app
WORKDIR /app

### Sen2cor Version 2.12.0
RUN wget http://step.esa.int/thirdparties/sen2cor/2.12.0/Sen2Cor-02.12.03-Linux64.run && \
    chmod +x Sen2Cor-02.12.03-Linux64.run && \
    bash /app/Sen2Cor-02.12.03-Linux64.run --target /home && \
    rm /app/Sen2Cor-02.12.03-Linux64.run

ENV PATH $PATH:/home/bin/

# Setting environment variables
ENV PYTHONUNBUFFERED 1

The container is initializing well but, as soon as we try to launch a calibration process we are having an “Illegal instruction (core dumped)”

root@c25af48beb79:/app# /home/bin/L2A_Process --resolution 10 S2A_MSIL1C_20240730T201911_N0511_R085_T05KRA_20240731T010644.SAFE
Sen2Cor. Version: 02.12.03, created: 2024.09.09, supporting Level-1C product version 14.2 - 15.0 started …
Product version: 15.0
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]: 0.00 : Generating datastrip metadata
L2A datastrip successfully generated
Selected resolution: 10 m
Progress[%]: 0.62 : PID-12770, L2A_ProcessTile: 20 m resolution must be processed first, elapsed time[s]: 14.777, total: 0:00:48.012287
Progress[%]: 0.81 : PID-12770, L2A_ProcessTile: processing with resolution 20 m, elapsed time[s]: 4.698, total: 0:00:52.710357
Progress[%]: 0.81 : PID-12770, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.001, total: 0:00:52.711235
Progress[%]: 0.92 : PID-12770, L2A_Tables: start import, elapsed time[s]: 2.571, total: 0:00:55.282067
Illegal instruction (core dumped)

Does anyone have any idea where the problem might be coming from?

I am having this issue as well, from official ubuntu (22.04, 24.04) docker images. It seems this is only affecting docker images because when I try to run from my local machine, it works. And also, it seems that only this sen2cor 2.12 is causing issues because I tried processing the same product with sen2cor 2.11 with no issue.

I did a Google search for related, and it seems the issue may have to do with how sen2cor 2.12 was compiled. It seems v2.12 was compiled with a different machine and/or cpu architecture than the other versions of sen2cor.

Can someone from the dev team please take a look into this as this is a serious regression from previous versions of Sen2cor.

Does Sen2Cor account for 1000 offset after PB4 or do I have to manually correct it using (DN-1000)/10000 to get the reflectance?

Dear @AyeshaJunaid

Thank you for your message.

Yes Sen2Cor knows how to handle internally the L1C inputs after PB04.00.
Sen2Cor L2A outputs will follow the same encoding with the radiometric offset of 1000.

For further downstream application using surface reflectance, you need to convert L2A digital numbers (L2A_DN) according to the formula given in the point 4) of Sen2Cor Frequently Asked Questions

4) Radiometric offset

Since Processing Baseline (PB) 04.00 (25/01/2022), a radiometric offset has been introduced in order to preserve/provide negative radiometric values.
For these products, please be sure to perform the correct conversion when moving from Digital Number (DN) to Surface Reflectance (SR):
L2A_SR = (L2A_DN + BOA_ADD_OFFSET) / QUANTIFICATION_VALUE

For PB 04.00, 05.00, 05.09, 05.10 & 05.11 the actual values are:
L2A_SR = (L2A_DN - 1000) / 10000

Please refer to the following links (section: Level-2A processing): Processing Baseline - Sentiwiki and Copernicus Dashboard - Processors Releases | ESA

Cheers,
@Sen2cor_dev_team

1 Like