CLI Reference
SatelliteGridding.jl includes a command-line interface via bin/grid.jl.
Usage
julia --project=. bin/grid.jl <command> [options]Commands
l2 — Grid Level-2 Data
Grid satellite Level-2 data with footprint oversampling.
julia --project=. bin/grid.jl l2 [options]Options
| Flag | Type | Default | Description |
|---|---|---|---|
--config, -c | String | required | TOML/JSON configuration file |
--outFile, -o | String | gridded_output.nc | Output NetCDF filename |
--latMin | Float32 | -90 | Lower latitude bound |
--latMax | Float32 | 90 | Upper latitude bound |
--lonMin | Float32 | -180 | Lower longitude bound |
--lonMax | Float32 | 180 | Upper longitude bound |
--dLat | Float32 | 1.0 | Latitude resolution (degrees) |
--dLon | Float32 | 1.0 | Longitude resolution (degrees) |
--startDate | String | 2018-03-07 | Start date (YYYY-MM-DD) |
--stopDate | String | 2018-10-31 | Stop date (YYYY-MM-DD) |
--dDays | Int | 8 | Time step in days (or months with --monthly) |
--monthly | Flag | false | Use months instead of days for time step |
--oversample_temporal | Float32 | 1.0 | Temporal oversampling factor |
--nOversample | Int | 0 (auto) | Sub-pixel factor (0 = auto-compute) |
--compSTD | Flag | false | Compute standard deviation |
--backend | String | sequential | Compute backend: sequential, cpu, or cuda |
Examples
Global TROPOMI SIF at 0.5° / 8-day composites:
julia --project=. bin/grid.jl l2 \
--config examples/tropomi_sif.toml \
--dLat 0.5 --dLon 0.5 \
--startDate 2019-01-01 --stopDate 2019-12-31 \
--dDays 8 \
-o tropomi_sif_2019_8day_05deg.ncRegional OCO-2 XCO₂ with KA CPU backend:
julia --project=. bin/grid.jl l2 \
--config examples/oco2_xco2.toml \
--latMin -60 --latMax 80 \
--dLat 2.0 --dLon 2.0 \
--startDate 2019-01-01 --stopDate 2019-12-31 \
--dDays 30 \
--backend cpu \
-o oco2_xco2_2019.ncMonthly composites with standard deviation:
julia --project=. bin/grid.jl l2 \
--config examples/tropomi_no2.toml \
--dLat 0.25 --dLon 0.25 \
--startDate 2019-01-01 --stopDate 2019-12-31 \
--monthly --dDays 1 \
--compSTD \
-o tropomi_no2_2019_monthly.nccenter — Grid Center-Coordinate Data
Grid data using center coordinates only (no footprint bounds). Suitable for MODIS-style data where each pixel maps to exactly one grid cell.
julia --project=. bin/grid.jl center [options]Options
| Flag | Type | Default | Description |
|---|---|---|---|
--config, -c | String | required | TOML/JSON configuration file |
--outFile, -o | String | gridded_output.nc | Output NetCDF filename |
--latMin | Float32 | -90 | Lower latitude bound |
--latMax | Float32 | 90 | Upper latitude bound |
--lonMin | Float32 | -180 | Lower longitude bound |
--lonMax | Float32 | 180 | Upper longitude bound |
--dLat | Float32 | 0.5 | Latitude resolution (degrees) |
--dLon | Float32 | 0.5 | Longitude resolution (degrees) |
--startDate | String | 2018-01-01 | Start date (YYYY-MM-DD) |
--stopDate | String | 2018-12-31 | Stop date (YYYY-MM-DD) |
--dDays | Int | 1 | Time step in days (or months with --monthly) |
--monthly | Flag | false | Use months instead of days for time step |
--geoTable | String | (none) | Path to geolocation lookup table (NetCDF) |
--vegIndices | Flag | false | Compute vegetation indices (EVI, NDVI, NIRv, NDWI) |
Example
julia --project=. bin/grid.jl center \
--config examples/modis_reflectance.toml \
--dLat 0.05 --dLon 0.05 \
--startDate 2019-01-01 --stopDate 2019-12-31 \
--vegIndices \
-o modis_2019.ncBackends
| Backend | Flag | Description |
|---|---|---|
| Sequential | --backend sequential | Default. Uses Welford's online algorithm for mean/std. Single-threaded. Supports --compSTD. |
| KA CPU | --backend cpu | KernelAbstractions CPU backend. Parallel sort + subpixel computation. Sum-based accumulation. |
| KA CUDA | --backend cuda | KernelAbstractions GPU backend. Requires CUDA.jl. All computation on GPU with atomic scatter. |
The cpu and cuda backends use sum-based accumulation (mean = sum/weight) instead of Welford's incremental mean. This is fully parallelizable but does not support --compSTD in a single pass. Standard deviation with KA backends requires a two-pass approach.