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

FlagTypeDefaultDescription
--config, -cStringrequiredTOML/JSON configuration file
--outFile, -oStringgridded_output.ncOutput NetCDF filename
--latMinFloat32-90Lower latitude bound
--latMaxFloat3290Upper latitude bound
--lonMinFloat32-180Lower longitude bound
--lonMaxFloat32180Upper longitude bound
--dLatFloat321.0Latitude resolution (degrees)
--dLonFloat321.0Longitude resolution (degrees)
--startDateString2018-03-07Start date (YYYY-MM-DD)
--stopDateString2018-10-31Stop date (YYYY-MM-DD)
--dDaysInt8Time step in days (or months with --monthly)
--monthlyFlagfalseUse months instead of days for time step
--oversample_temporalFloat321.0Temporal oversampling factor
--nOversampleInt0 (auto)Sub-pixel factor (0 = auto-compute)
--compSTDFlagfalseCompute standard deviation
--backendStringsequentialCompute 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.nc

Regional 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.nc

Monthly 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.nc

center — 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

FlagTypeDefaultDescription
--config, -cStringrequiredTOML/JSON configuration file
--outFile, -oStringgridded_output.ncOutput NetCDF filename
--latMinFloat32-90Lower latitude bound
--latMaxFloat3290Upper latitude bound
--lonMinFloat32-180Lower longitude bound
--lonMaxFloat32180Upper longitude bound
--dLatFloat320.5Latitude resolution (degrees)
--dLonFloat320.5Longitude resolution (degrees)
--startDateString2018-01-01Start date (YYYY-MM-DD)
--stopDateString2018-12-31Stop date (YYYY-MM-DD)
--dDaysInt1Time step in days (or months with --monthly)
--monthlyFlagfalseUse months instead of days for time step
--geoTableString(none)Path to geolocation lookup table (NetCDF)
--vegIndicesFlagfalseCompute 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.nc

Backends

BackendFlagDescription
Sequential--backend sequentialDefault. Uses Welford's online algorithm for mean/std. Single-threaded. Supports --compSTD.
KA CPU--backend cpuKernelAbstractions CPU backend. Parallel sort + subpixel computation. Sum-based accumulation.
KA CUDA--backend cudaKernelAbstractions 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.