Sentinel-2 MSI Synthetic Raw Data Generator

Status: Deployed Stack: Python 3.11 · NumPy · Zarr · CCSDS-122 Reference: Sentinel-2 L1 ATBD (public)

Generated Synthetic Raw Data

Overview

Runs S2B L1B backwards through the exact inverse of the operational L0→L1B radiometric chain to reconstruct the full EOPF product chain — L1A → L0plus (CCSDS-122 ISP) → Synthetic L0 (focal-plane DN img, 12 detectors × 13 bands). The Synthetic L0 is validated directly against the reference ESA L0 img, agreeing to ≤ ~4 DN on the ten 10 m + 20 m bands.

The inversion undoes every ON forward step — radiometric offset, relative-response/PRNU, dark, un-bin, SWIR re-arrangement, defective pixels, crosstalk, on-board equalization. MTF-deconvolution is OFF in the operational chain, so PSF re-blur and noise are not re-applied. Built from the public L1 ATBD — no external processor.

It also derives a calibration database (EOPF ADFs) consumed by the downstream msi-processor.

Architecture

flowchart LR
    IN[("S2B L1B<br/>EOPF product")]
    ADFsrc[("ADF sources<br/>GIPP - PSF - SRF")]
    subgraph GEN["s2_msi_raw_generator — reverse chain"]
        REV["reverse_l1b_to_l0"]
        L1A["write L1A"]
        C122["CCSDS-122 lossless"]
        PKT["ISP packetize → L0plus"]
        CAL["calibration.py"]
    end
    L0plus[("L0plus compressed ISPs")]
    L0[("Synthetic L0 decoded img")]
    REFL0[("reference ESA L0 img")]
    CALDB[("cal-DB EOPF ADFs")]
    VAL["validate: Synthetic L0 vs reference ESA L0 ≤ ~4 DN"]
    IN --> REV --> L1A --> C122 --> PKT
    PKT --> L0plus --> L0
    CAL --> CALDB
    L0 -.-> VAL
    REFL0 -.-> VAL

Key technical work

Results

Synthetic L1A vs reference ESA L0 img — detector d05:

band B02 B03 B04 B05 B06 B07 B08 B8A B11 B12
RMSE (DN) 0.8 1.5 1.8 1.1 1.0 0.9 0.8 1.1 4.2 3.9
resolution 10 m 10 m 10 m 20 m 20 m 20 m 10 m 20 m 20 m 20 m

All ten 10 m + 20 m bands agree to ≤ ~4 DN. Native-60 m bands (B01/B09/B10) have higher RMSE because reverse un-bin is ×3 line replication — sub-pixel detail averaged away by forward binning is irrecoverable.

Forward step Reverse op ADF / GIPP
radiometric offset + RADIO_ADD_OFFSET (−100) R2PARA
binning (60 m) ×3 un-bin (replication)
defective pixels re-stamp NoData R2DEPI
SWIR re-arrangement re-introduce staggered readout RSWIR
relative response impress G⁻¹ R2EQOG
crosstalk add back RCRCO
dark + L0-domain dark × DSNU shape R2EQOG COEFF_D
on-board equalization re-apply bilinear non-linearity REOB2

Documentation (GitHub Pages)

Project documentation

Management & assurance

User documentation

← All projects