Skip to main content

Geology-1 satellite data preprocessing algorithms

Project description

dzsat

dzsat is a Python toolkit for preprocessing Geology-1 satellite imagery, developed at China University of Geosciences. The library focuses on geometric correction and band-to-band coregistration, with plans to expand to radiometric calibration and other preprocessing workflows.


Features

  • Band-to-band coregistration — Local cross-correlation coregistration (via arosics) across all 16 spectral bands of Geology-1 Level-3 products.
  • Sobel gradient preprocessing — Eliminates spectral contrast-reversal artifacts between VNIR bands before NCC matching.
  • Bad-data masking — Automatically excludes zero-fill and nodata regions from tie-point computation.
  • Tie-point thinning — Spatially thins low-displacement tie points to accelerate DESHIFTER interpolation without sacrificing accuracy.
  • Configurable resampling — Supports nearest, bilinear, cubic, cubic_spline, and lanczos resampling algorithms for the warping step.
  • Displacement vector field plots — Optionally saves per-band quiver plots showing tie-point shifts and statistics (enable with save_plot=True).
  • Fully parameterised — All matching parameters (grid resolution, window size, max shift, reliability threshold, etc.) are exposed as function arguments.

Installation

pip install dzsat

Dependencies

Package Purpose
numpy Array operations
GDAL Geospatial raster I/O
rasterio GeoTIFF read/write
scipy Sobel gradient computation
arosics Local coregistration engine
geoarray Geo-referenced array wrapper
Pillow Image utilities

Note: GDAL must be installed before pip install dzsat. On Windows it is recommended to install GDAL via OSGeo4W or a pre-built wheel from Christoph Gohlke's repository.


Quick Start

Coregister all bands in a scene folder

from dzsat.geometry.registration import coregister_folder

coregister_folder(
    folder_path=r"D:\data\DZ01V_L3_E30.2_S25.9_20260211_01_T1",
    ref_band=9,          # reference band (default: B9)
)

Output is written to folder_path + "_registration".

Coregister a single band pair

from dzsat.geometry.registration import coregister_scene

coregister_scene(
    ref_path=r"D:\data\scene\B9.TIF",
    warp_path=r"D:\data\scene\B7.TIF",
    out_path=r"D:\data\output\B7_coreg.TIF",
)

Advanced — custom parameters

coregister_folder(
    folder_path=r"D:\data\scene",
    ref_band=9,
    grid_res=64,                  # coarser grid → faster
    window_size=(80, 80),         # smaller matching window
    max_shift=50,                 # allow larger displacements
    min_reliability=70,           # stricter NCC quality filter
    preprocess_gradient=True,     # Sobel preprocessing (recommended)
    thin_low_shift=True,          # thin tie points in low-shift areas
    thin_shift_threshold_m=28.0,  # threshold ≈ 2 px at 14 m GSD
    thin_factor=3,                # keep 1/9 of low-shift tie points
    resamp_alg='bilinear',        # resampling algorithm for warping
    save_plot=False,              # save displacement vector field plot
)

API Reference

coregister_folder

coregister_folder(folder_path, ref_band=9, grid_res=48, window_size=(120,120),
                  max_shift=30, min_reliability=60, tieP_filter_level=2,
                  preprocess_gradient=True, thin_low_shift=True,
                  thin_shift_threshold_m=28.0, thin_factor=3,
                  resamp_alg='bilinear', save_plot=False)

Coregisters all 16 bands in folder_path using cascading (chain) registration: bands are processed in two passes from the reference band toward shorter and longer wavelengths respectively. Each step uses the previous step's registered output as the new reference, exploiting the higher spectral similarity between adjacent bands for more robust NCC matching. The reference band is copied directly to the output. Results are saved to folder_path + "_registration".

Parameter Type Default Description
folder_path str Directory containing *B<n>.TIF files
ref_band int 9 Reference band number (1–16)
grid_res int 48 Tie-point grid spacing in pixels
window_size tuple (120,120) NCC matching window in pixels
max_shift int 30 Maximum allowed shift in pixels
min_reliability float 60 Minimum NCC reliability (0–100)
tieP_filter_level int 2 Tie-point filter level (0–3)
preprocess_gradient bool True Use Sobel gradient images for matching
thin_low_shift bool True Thin tie points in low-shift regions
thin_shift_threshold_m float 28.0 Displacement threshold for thinning (m)
thin_factor int 3 Thinning step size
resamp_alg str 'bilinear' Resampling algorithm ('nearest', 'bilinear', 'cubic', 'cubic_spline', 'lanczos')
save_plot bool False Save displacement vector field plot

coregister_scene

Same parameters as above (excluding folder_path / ref_band), plus:

Parameter Type Default Description
ref_path str Path to the reference GeoTIFF
warp_path str Path to the target GeoTIFF
out_path str Output path for the corrected GeoTIFF
plot_dir str None Directory for plots; defaults to coreg_plots/ beside out_path

Project Structure

dzsat/
├── dzsat/
│   ├── __init__.py
│   └── geometry/
│       ├── __init__.py
│       └── registration.py   # coregistration algorithms
├── pyproject.toml
└── README.md

Roadmap

  • Radiometric calibration (DN → Radiance → Reflectance)
  • Atmospheric correction
  • Orthorectification
  • Cloud / shadow masking
  • Multi-scene mosaicking

License

MIT © HaixuHe, China University of Geosciences

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dzsat-1.0.8.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dzsat-1.0.8-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file dzsat-1.0.8.tar.gz.

File metadata

  • Download URL: dzsat-1.0.8.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for dzsat-1.0.8.tar.gz
Algorithm Hash digest
SHA256 6a2f265c4f0ca8245128d1daeb0c83d391a76b9a897ee56368fc779846959fa4
MD5 83b4f85af01a3375b470a3db45bdb931
BLAKE2b-256 2dbe3972d6371b2d98447280ca1c11d6327fe1c75fb3990e2ea23ff9f40a0afd

See more details on using hashes here.

File details

Details for the file dzsat-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: dzsat-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for dzsat-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 bf1981396392978719bfebe5693ef767f6eb1eac66da2e07f8c6b69fc173ae24
MD5 f0e7846eeb746c4c2d742b746220b9b4
BLAKE2b-256 b46188d369bd3f7a8f950de3e13da18ab60e19a3e2cec753d394f4605ca0729a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page