Skip to content

Command Line Interface

Installation

The command line interface will be installed automatically when the Python library is installed. See instructions on the installation page. Use the api reference or command --help to see options to pass into python functions.

Usage

Print general help:

1
spectralmatch --help

Print help for a specific command:

1
spectralmatch COMMAND --help

Print help for a class method:

1
spectralmatch Match global_regression --help

Print installed version:

1
spectralmatch --version

Run a specific command:

1
spectralmatch COMMAND [OPTIONS]

Run a class method:

1
2
3
4
spectralmatch Match global_regression [OPTIONS]
spectralmatch Match local_block_adjustment [OPTIONS]
spectralmatch Seamline voronoi [OPTIONS]
spectralmatch Pif flood_from_match_points [OPTIONS]

Pipeline Helper Function

The pipeline function serves as a way to run steps sequentially. While sensible defaults are set, you can modify all params to the underlying functions as seen here; visit each functions api reference for the exact structure of the params. In its simplest form all that needs to be specified is the input and output:

1
spectralmatch pipeline /input/folder /output/file.tif --shared_debug_logs=True

Commands

Pif

Pif

Utilities for deriving radiometric adjustment parameters from PIF statistics.

Geometric correction

geometric_correction

Geometrically correct an overlap raster using conjugate points and return the

Match

global_regression

Performs global radiometric normalization across overlapping images using least squares regression.

local_block_adjustment

Performs local radiometric adjustment on a set of raster images using block-based statistics.

Mask

band_math

Applies a thresholding operation to input raster images using a mathematical expression string.

create_cloud_mask_with_omnicloudmask

Generates cloud masks from input images using OmniCloudMask, with optional downsampling and multiprocessing.

process_raster_values_to_vector_polygons

Converts raster values into vector polygons based on an expression and optional filtering logic.

Chain

pipeline

Run the standard spectral matching mosaic workflow as a single pipeline.

Seamline

voronoi_center_seamline

Generates a Voronoi-based seamline mask from edge-matching polygons (EMPs) and writes the result to a vector file.

Handlers

search_paths

Search for files using a glob pattern, or a folder with a default file pattern.

create_paths

Create output paths using a filename template_pattern and a list of reference paths or names.

match_paths

Match reference_paths to input_match_paths using a regex applied to the basenames of input_match_paths. The extracted key must be a substring of the reference filename.

Utils

merge_rasters

Merges multiple rasters into a single output.

mask_rasters

Applies a vector-based mask to one or more rasters using GDAL Warp.

merge_vectors

Merge multiple vector files using the specified geometric method.

align_rasters

Aligns multiple rasters to a common resolution and grid using specified resampling.

compute_overviews

Compute and attach GDAL overviews for one or more raster images.

Statistics

compare_image_spectral_profiles_pairs

Plots paired spectral profiles for before-and-after image comparisons.

compare_before_after_all_images

Creates a two-row image grid to compare before-and-after raster pairs with consistent per-row contrast stretching. Each column shows a pair of aligned images with transparent nodata. Supports 1- and 3-band rasters.

compare_spatial_spectral_difference_band_average

Computes and visualizes the mean per-pixel spectral difference between two coregistered, equal-size images.