Methods to stack geospatial rasters and run memory-efficient computations.
Sometimes your data is larger than your local memory and not everyone has access to high-performance computing environments. This excludes individuals from participating in studies with the objective to process larger-than-memory datasets.
When data cubes are too large to load into memory, Zarr and dask enable chunked storage and parallelized data retrieval. GTSA streamlines this process for geospatial raster datasets, enabling memory efficient comptutations along both the spatial and temporal axes.
Download and install Miniconda
After installing Miniconda set up Mamba (optional but recommended)
$ conda install mamba -n base -c conda-forge
Clone the repo and set up the conda environment
$ git clone https://github.com/friedrichknuth/gtsa.git
$ cd ./gtsa
$ mamba env create -f environment.yml
$ conda activate gtsa
$ pip install -e .
See Jupyter Notebooks for example Python code.
See command --help
for more information about each command listed below.
create_stack --datadir data/dems/south-cascade \
--date_string_format %Y%m%d \
--date_string_pattern _........_ \
--date_string_pattern_offset 1 \
--outdir data/dems/south-cascade \
--dask_enabled \
--overwrite
Basic --compute
options include count
, min
, max
, mean
, std
, median
, sum
, and nmad
.
computation=count
gtsa --input_file data/dems/south-cascade/temporal/stack.zarr \
--compute $computation \
--outdir data/dems/south-cascade/outputs \
--workers 8\
--dask_enabled \
--overwrite \
--test_run
gtsa --input_file data/dems/south-cascade/temporal/stack.zarr \
--compute polyfit \
--degree 1 \
--frequency 1Y \
--outdir data/dems/south-cascade/outputs \
--dask_enabled
degree=3
gtsa --input_file data/dems/south-cascade/temporal/stack.zarr \
--compute polyfit \
--degree $degree \
--frequency 1Y \
--outdir data/dems/south-cascade/outputs \
--dask_enabled
gtsa --input_file data/dems/south-cascade/temporal/stack.zarr \
--compute custom \
--outdir data/dems/south-cascade/outputs \
--dask_enabled
create_cogs --datadir data/orthos/south-cascade \
--outdir data/orthos/south-cascade/cogs \
--workers 8 \
--overwrite
create_cog_map --pipeline notebooks/visualization/pipeline.json \
--output_file map.html \
--zoom_start 11 \
--overwrite
See rendered interactive map examples here.
download_data --site south-cascade \
--outdir data \
--product dem \
--include_refdem \
--workers 8 \
--overwrite
download_data --site south-cascade \
--outdir data \
--product ortho \
--workers 8 \
--overwrite
Knuth. F. and D. Shean. (2022). Historical digital elevation models (DEMs) and orthoimage mosaics for North American Glacier Aerial Photography (NAGAP) program, version 1.0 [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7297154
Knuth, F., Shean, D., Bhushan, S., Schwat, E., Alexandrov, O., McNeil, C., Dehecq, A., Florentine, C. and O’Neel, S., 2023. Historical Structure from Motion (HSfM): Automated processing of historical aerial photographs for long-term topographic change analysis. Remote Sensing of Environment, 285, p.113379. https://doi.org/10.1016/j.rse.2022.113379
- NASA Ames Stereo Pipeline: dem_mosaic