A Python processing script which takes the panchromatic and multispectral rasters as an input, and outputs the pansharpened raster.
- If
GDALlibraries are not on the system,condais the simplest way to install them:
$ conda env create -f pansharpening.yml- If
GDALlibraries are available, skip to step (3), but it's a good idea to create a virtual environment:
$ python -m venv venv && source vevn/bin/activate # on Unix- Activate the newly created environment:
$ conda activate pansharpening- From inside the directory that includes the
pyproject.tomlfile:
$ python -m pip install .$ python -m pansharpening -h
usage: pansharpening [-h] [--stream] [--raw] [--file FILE]
Pansharpening pipeline
options:
-h, --help show this help message and exit
--stream, -s process streamed imagery and discard inputs (default: `False`)
--compression {DEFLATE,LERC,LERC_DEFLATE,LERC_ZSTD,LZW,PACKBITS,JPEG}, -c {DEFLATE,LERC,LERC_DEFLATE,LERC_ZSTD,LZW,PACKBITS,JPEG}
choose the compression algorithm of the raster output (default: `LERC`)
--raw, -r derive from raw Pleiades Neo imagery (default: `False`)
--out OUT, -o OUT change the output destination directory (default: `./output`)
--file FILE, -f FILE TOML file input of source imagery (default: `./data/imagery-sources.toml`)
--panchromatic PANCHROMATIC, -p PANCHROMATIC
Panchromatic image URL
--rgb RGB, -g RGB RGB image URL- By default, the raster inputs are cached to disk after the first download, but the
--streamoption changes the processing on-the-fly and discards inputs after finished:
$ python -m pansharpening -s- The pansharpened raster is available in the
outputdirectory. - Change sources file in
data/imagery-sources.toml, or provide another sources file using the--fileoption.- Pass in URLs to panchromatic and RGB TIFFs as commandline arguments using the
--panchromaticand--rgboptions.
- Pass in URLs to panchromatic and RGB TIFFs as commandline arguments using the
- Change the output directory of the pansharpened raster using the
--outoption. - Alternative compression options are configurable through the
--compressionflag:
$ python -m pansharpening -c PACKBITS