Gamma Earth logo Gamma Earth · Documentation

S2DR3 SDK Manual

Document date: 2025-12-18

Installation

Requires: Linux, Python 3.12 or later

GPUs tested: NVIDIA T4, P100, V100, A100; 16GB VRAM

1) Install NVIDIA Drivers

https://developer.nvidia.com/cuda-downloads

2) Install GDAL and the S2DR3 module wheel

% apt install -qq pip gdal-bin
% pip -q install https://storage.googleapis.com/0x7ff601307fa5/s2dr3-20251218.1-cp312-cp312-linux_x86_64.whl

3) Configure paths in infer.py

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.

Example:

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

Options

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

Output logfile

{
  "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

Limitations