This folder outlines data processes for the Soils Revealed project.
To run the notebooks you need to create an environment with the dependencies. There are two options:
If you have docker in your system, you run a jupyter lab server with:
docker compose up --build
And if you want to get into the container, use a terminal in jupyter lab, vscode remote development or run this command:
docker exec -it soils_revealed_notebooks /bin/bash
Create the environment with:
mamba env create -n soils-revealed -f environment.yml
This will create an environment called soils-revealed with a common set of dependencies.
If this project is a new and standalone (not a module in a bigger project), you need to initialize git:
git init
If the project is already in a git repository, you can skip this step.
To install the pre-commit hooks, with the environment activated and in the project root directory, run:
pre-commit install
If you need to update the environment installing a new package, you simply do it with:
mamba install [package] # or `pip install [package]` if you want to install it via pip
then update the environment.yml file so others can clone your environment with:
mamba env export --no-builds -f environment.yml
- Space-time statistical modelling of soil organic carbon concentration and stocks
- Soil carbon debt of 12,000 years of human land use
This doc explains how to go from raw data to the final precalculations.
It consists of 2 scripts located in the processing
folder:
from_GeoTIFFs_to_Zarr.py
which transform raw GeoTIFFs located in Google Cloud bucket into Zarrs in a local or remote (S3) directory.compute_precalculations.py
It takes the raster (as Zarr) and vector data and computes the precalculations.
First! transform all raw data from GeoTIFFs to Zarrs.
python from_GeoTIFFs_to_Zarr.py experimental,global,scenarios
Second! Compute precalculations
python compute_precalculations.py \
experimental,global,scenarios \
political_boundaries,hydrological_basins,biomes,landforms