S2DR3 SDK Manual (2025-05-22)
Installation
Requires: Linux, Python 3.12 or later
GPUs tested: NVIDIA T4, P100, V100, A100; 16GB VRAM
- Install NVIDIA Drivers: https://developer.nvidia.com/cuda-downloads
- Install GDAL and S2DR3 module wheel as follows:
% apt install -qq pip gdal-bin
% pip -q install https://storage.googleapis.com/0x7ff601307fa5/s2dr3-20250905.1-cp312-cp312-linux_x86_64.whl
3: In infer.py configure default paths for input data (downloaded Sentinel-2 data), output data (super-resolved data), as well as logs to the desired locations on your file system. Note: Sentinel-2 will be automatically downloaded to the <datapath> folder.
parser.add_argument('--datapath', type=str, default='/home/ubuntu/data/datapath', help='Input image or folder')
parser.add_argument('--savepath', type=str, default='/home/ubuntu/data/savepath', help='Output image or folder')
parser.add_argument('--logpath', type=str, default='/home/ubuntu/data/logs', help='Path for logging')
Inference (GPU)
% cd <path-to-the-infer.py>
% python infer.py -f --date <YYYY-MM-DD> --aoi <W S E N>
Examples:
% python infer.py -f --date 2021-08-15 --aoi 30.8520 50.3993 30.8750 50.4131
% python infer.py -f --date 2022-07-18 --aoi -47.8103 -21.2284 -47.7000 -21.1312
% python infer.py -f --date 2022-07-18 --geojson /content/input.geojson
% python infer.py -f --date_range 2021-08-01 2021-09-30 --aoi 30.8520 50.3993 30.8750 50.4131
% python infer.py -f --date_range 2022-10-01 2022-10-30 --mgrs 32TLS
% python infer.py -f --date 2022-10-30 --mgrs 32TLS --NM 3 4 --output_bands B02 B03 B04 B05 B08
% python infer.py -f --date 2022-10-30 --geojson /input-path/aoi.geojson
Main parameters
--date— Exact date of the Sentinel-2 scene (will fail if the scene does not exist)--aoi— Bounding box of the Area-of-interest. Should fit entirely within the Sentinel-2 scene. Should not exceed 10×10 km (100 sq. km) in this dev version.--geojson— Input GeoJSON file with collection of AOI polygons--mgrs— MGRS tile index--iso— 2-digit ISO country code--NM— Indices of MGRS subsubtile on the 9×9 grid--UV— Indices of MGRS subtile on the 3×3 grid--datapath— Path for storing original Sentinel-2 data (default: /content/datapath)--savepath— Path to the output super-resolved data (default: /content/savepath)--logpath— Log file path (default: /content)--bands_out— Spectral bands to generate in the Sentinel-2 format (defaults to BGRN: B02 B03 B04 B08)
Options
-g, --coreg— Coregistration with ESRI basemap-f, --force— Force re-processing of existing products-t, --get_tile— Force downloading entire S2 MGRS tile-d, --debug— Print debugging information-q, --quiet— Run completely quiet-s, --simulate— Simulate on a small test tile
AWS Credentials
AWS credentials may be updated by setting the following environmental variables:
$AWS_ACCESS_KEY_ID = *****
$AWS_SECRET_ACCESS_KEY = *************
Inputs
Automatically downloaded Sentinel-2 L2A
Outputs
- 10-channel MS 16-bit uint16 GeoTIFF in original UTM projection
- 4-channel BGRN (B2,B3,B4,B8) 16-bit uint16 GeoTIFF in original UTM projection
- 4-channel RGBA 8-bit GeoTIFF in Web-mercator projection
Output logfile example
{
"PID": "T33VXL-20220625",
"mode": "mgrs",
"date": "20220625",
"MGRS": "33VXL",
"ISO": "SE",
"dimensions": [11430, 11340],
"bbox": [17.80895790985397, 63.460773781104685, 18.018729265308803, 63.54632126474991],
"bands": ["B02", "B03", "B04", "B08"],
"save_path_MS": "/content/savepath/SE/T33VXL/T33VXL-20220625/S2L2Ax10_T33VXL-20220625-00_MS.tif",
"save_path_TCI": "/content/savepath/SE/T33VXL/T33VXL-20220625/S2L2Ax10_T33VXL-20220625-00_TCI.tif",
"overlap": 1.0,
"boa_bias": "false"
}
System requirements
- Ubuntu Linux (tested on Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic)
- GPU 16GB (tested on Tesla P100-PCIE-16GB)
- RAM 16GB (at least, preferably 32GB)
Limitations
- Exact date of the Sentinel-2 scene (will fail if the scene does not exist)
- Bounding box of the Area-of-interest should fit entirely within the Sentinel-2 scene.
- AOI should not exceed 10×10 km (1000×1000px, 1MPx, 100 sq. km) in this dev version.
- SentinelHub has a limitation of width/height = 2500px