Overview
The DVNL preprocessing tools prepare satellite light pollution data for analysis by cleaning the data, handling NoData values, and applying spatial dispersion kernels.terralab-dvnl-preprocess
Validates and cleans DVNL GeoTIFF files, ensuring NoData is correctly masked and metadata is preserved.Purpose
- Convert raster data to float32 format for downstream processing
- Properly handle NoData values by converting them to NaN
- Remove outlier values (> 1e10) that appear in some DVNL versions
- Preserve geospatial metadata and apply LZW compression
- Process large files in memory-efficient blocks
Usage
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
input | Path | Yes | Path to input DVNL .tif file |
output | Path | Yes | Path to output cleaned .tif file |
Examples
Basic preprocessing:Output
The output file will have:- Data type: float32
- NoData value: NaN
- Compression: LZW
- Geospatial metadata: Preserved from input file
terralab-dvnl-convolve
Performs radial kernel convolution on DVNL rasters to model light dispersion. Uses a tiled overlap-add approach for memory efficiency on large rasters.Purpose
- Apply spatial dispersion models to light pollution data
- Simulate how artificial light spreads through the atmosphere
- Generate aggregated radiance maps for SQM calibration
- Process large rasters efficiently using tiled processing
Usage
Arguments
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
input | Path | Yes | - | Preprocessed DVNL .tif (float32, NaN for NoData) |
output | Path | Yes | - | Output aggregated .tif |
--kernel | Choice | No | gaussian | Kernel type: gaussian or power-law |
--sigma | Float | No | 30.0 | Sigma for Gaussian kernel (km) |
--rmax | Float | No | 200.0 | Cutoff radius (km) |
--res | Float | No | 1.0 | Resolution (km/pixel) |
Kernel Types
Gaussian Kernel Models light dispersion as a Gaussian distribution. Suitable for general atmospheric scattering.- Controlled by
--sigmaparameter - Larger sigma = more spreading
- Typical values: 20-50 km
- Uses default parameters: p=2.0, r0=1.0 km, λ=50.0 km
- More physically motivated for certain atmospheric conditions
Examples
Basic Gaussian convolution:Processing Details
- Tile size: 1024×1024 pixels
- Method: FFT-based convolution with overlap-add
- Memory efficiency: Processes in tiles with halo regions
- NoData handling: Converts NaN to 0 during convolution, preserves NaN locations in output
Performance Tips
- Smaller
--rmaxvalues process faster but may truncate kernel effects - Power-law kernels may take longer to compute than Gaussian
- For very large rasters (> 10,000×10,000), consider processing in geographic tiles
Output
The output file contains:- Aggregated radiance values representing light from surrounding areas
- Same dimensions and georeference as input
- LZW compression with tiled structure
- NaN values preserved where input had NoData