Add SARscape Go wrapper workflow
This commit is contained in:
@@ -1,17 +1,50 @@
|
||||
# GF3 L1A to L2 Pipeline
|
||||
|
||||
This repository contains a Python package and CLI for converting GF3 L1A
|
||||
products to L2 GeoTIFF outputs.
|
||||
This repository contains two GF-3 L1A to L2 processing paths:
|
||||
|
||||
The heavy work is still handled by GDAL, Rasterio, and NumPy. The package adds
|
||||
pipeline structure around the original script: explicit configuration, safe path
|
||||
handling, logging, restart-friendly skipping, per-scene error isolation, and
|
||||
block-based radiometric calibration.
|
||||
- **SARscape Go wrapper**: Windows-oriented production wrapper around ENVI/IDL Runtime and SARscape. This is the recommended path when SARscape is available.
|
||||
- **Python pipeline**: GDAL/Rasterio/NumPy implementation kept as a pure Python package and CLI.
|
||||
|
||||
## Install
|
||||
The SARscape wrapper currently has the more complete operational workflow for GF-3 scene import, multilook/filter/geocode processing, batch directory discovery, saved defaults, and progress reporting.
|
||||
|
||||
Use an environment that already has a working GDAL/OSGeo Python binding. On
|
||||
Windows, Conda/Miniforge is usually the least fragile route.
|
||||
## Repository Layout
|
||||
|
||||
```text
|
||||
dist/windows/ Prebuilt Windows executable
|
||||
docs/ Operational documentation
|
||||
src/gf3_l1a2l2/ Python package
|
||||
tests/ Python unit tests and small fixtures
|
||||
tools/gf3_sarscape_wrapper/ Go wrapper source and embedded SAV asset
|
||||
tools/gf3_sarscape_wrapper/idl/ IDL/SARscape source scripts
|
||||
```
|
||||
|
||||
Large GF-3 archives, extracted scenes, SARscape outputs, and local runtime files are intentionally not tracked in Git.
|
||||
|
||||
## Recommended: SARscape Go Wrapper
|
||||
|
||||
Use the prebuilt executable:
|
||||
|
||||
```powershell
|
||||
.\dist\windows\gf3wrapper.exe `
|
||||
-input "D:\GF3\L1A_BATCH" `
|
||||
-output "E:\GF3\L2_SARscape" `
|
||||
-dem "D:\DEM\COPDEM_GLO30_China_4326_DEM" `
|
||||
-pol "HH,HV"
|
||||
```
|
||||
|
||||
Supported input forms:
|
||||
|
||||
- A single `*.tar.gz` GF-3 L1A package.
|
||||
- A single `*.meta.xml` scene metadata file.
|
||||
- A directory containing multiple `*.tar.gz` or `*.meta.xml` scenes.
|
||||
|
||||
The wrapper writes one output subdirectory per scene. On successful runs it saves defaults next to the executable in `gf3wrapper.json`, so double-click interactive mode can reuse the previous input/output/DEM/polarization settings.
|
||||
|
||||
More details: [docs/sarscape_go_wrapper.md](docs/sarscape_go_wrapper.md)
|
||||
|
||||
## Python Pipeline
|
||||
|
||||
Use an environment that already has working GDAL/OSGeo Python bindings. On Windows, Conda/Miniforge is usually the least fragile route.
|
||||
|
||||
```powershell
|
||||
conda env create -f environment.yml
|
||||
@@ -19,7 +52,7 @@ conda activate gf3-l1a2l2
|
||||
pip install -e . --no-deps
|
||||
```
|
||||
|
||||
## Run
|
||||
Run:
|
||||
|
||||
```powershell
|
||||
gf3-l1a2l2 run --input D:\GF3\L1A_BATCH --output E:\GF3\L2_Image --dem .\GMTED2010.jp2
|
||||
@@ -38,22 +71,29 @@ gf3-l1a2l2 run `
|
||||
--dst-srs EPSG:4326
|
||||
```
|
||||
|
||||
By default, output files are written under one subdirectory per discovered
|
||||
scene. Use `--flat-output` to write all outputs directly into the output
|
||||
directory.
|
||||
|
||||
The legacy files are now compatibility wrappers:
|
||||
Legacy wrappers remain available:
|
||||
|
||||
```powershell
|
||||
python gf3_L1A_To_L2.py run --input D:\GF3\L1A_BATCH --output E:\GF3\L2_Image --dem .\GMTED2010.jp2
|
||||
python Decompression.py D:\GF3\L1A_BATCH
|
||||
```
|
||||
|
||||
## Notes
|
||||
## Development Checks
|
||||
|
||||
- The CLI extracts `.tar.gz` and `.zip` products before processing unless
|
||||
`--skip-decompress` is used.
|
||||
- Existing L2 outputs are skipped unless `--overwrite` is used.
|
||||
- Logs are written to `<output>\logs`.
|
||||
- Without representative GF3 products, verification is limited to parser unit
|
||||
tests and Python syntax/import checks.
|
||||
Python:
|
||||
|
||||
```powershell
|
||||
python -m pytest
|
||||
```
|
||||
|
||||
Go wrapper:
|
||||
|
||||
```powershell
|
||||
cd .\tools\gf3_sarscape_wrapper
|
||||
$env:GOTELEMETRY = "off"
|
||||
go build -o ..\..\dist\windows\gf3wrapper.exe .
|
||||
```
|
||||
|
||||
## Data Policy
|
||||
|
||||
Do not commit production GF-3 archives or generated products. Keep large data on NAS/storage and document the path in run notes. Only small sanitized fixtures should be added under `tests/fixtures`.
|
||||
|
||||
Reference in New Issue
Block a user