API/SDK

Python SDK Latest Release s2dr3-20260907

Install and run the S2DR3 Python SDK, including the latest parameters and COG output option.

This article covers the S2DR3 Python SDK release identified as s2dr3-20260907.1.

Requirements

  • Linux (x86, x64).
  • Python 3.13 or later.
  • NVIDIA GPU tested by Gamma Earth: T4, P100, V100, or A100.
  • 16 GB VRAM.
  • 16 GB RAM minimum; 32 GB RAM preferred.

Install the SDK

Install GDAL and the S2DR3 wheel:

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

Configure infer.py

For instructions on how to generate your API key, see API Access & Keys.

Set up the API_KEY and the default paths for input data, output data, and logs:


os.environ['GE_API_KEY'] = <YOUR-API-KEY>

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

Sentinel-2 data is automatically downloaded to datapath.

Run GPU Inference

cd <path-to-the-infer.py>
python infer.py -f --date <YYYY-MM-DD> --aoi <W S E N>

Example:

python infer.py -f --date 2021-08-15 --aoi 30.8520 50.3993 30.8750 50.4131

Main Parameters

ParameterDescription
--dateExact Sentinel-2 scene date. The run fails if the scene does not exist.
--date_rangeNumber of days back from the target date to search.
--aoiBounding box AOI. It should fit entirely within the Sentinel-2 scene.
--max_cloudsMaximum cloud cover allowed in the date search.
--geojsonInput GeoJSON file with AOI polygons.
--mgrsMGRS tile index.
--iso2-digit ISO country code.
--NMMGRS subsubtile indices on the 9x9 grid.
--UVMGRS subtile indices on the 3x3 grid.
--datapathPath for storing original Sentinel-2 data.
--savepathPath for generated super-resolved data.
--logpathLog file path.
--bands_outSpectral bands to generate in Sentinel-2 format.

Options

OptionDescription
-c, --cogsGenerate COG outputs for TCI, NDVI, and IRP.
-f, --forceForce re-processing of existing products.
-t, --get_tileForce downloading the entire Sentinel-2 MGRS tile.
-d, --debugPrint debugging information.
-q, --quietRun completely quiet.
-s, --simulateSimulate on a small test tile.

Changelog

The s2dr3-20260907.1 release is built for Python 3.13 and ships as a cp313 wheel. Earlier releases were built for Python 3.12, so an existing environment has to be upgraded to Python 3.13 before this wheel will install.

The following were introduced in the earlier s2dr3-20251218 release and are still current:

  • Main parameter --date_range: number of days back from the target date to search.
  • Main parameter --max_clouds: maximum cloud cover allowed in the date search.
  • Option -c, --cogs: generate COG outputs for TCI, NDVI, and IRP.

Outputs

The SDK can produce:

  • 10-channel MS 16-bit uint16 GeoTIFF in original UTM projection.
  • 4-channel BGRN 16-bit uint16 GeoTIFF in original UTM projection.
  • 4-channel RGBA 8-bit GeoTIFF in Web Mercator projection.

Limitations

  • Exact-date runs fail if the Sentinel-2 scene does not exist.
  • The bounding-box AOI should fit entirely within the Sentinel-2 scene.
  • The current SDK manual says AOI should not exceed 10x10 km / 100 km2 in this dev version.
  • SentinelHub has a width/height limit of 2500 px.

Related