This project involves creating depth to water (DTW) raster surfaces using empirical Bayesian kriging and summarizing the DTW over a polygon feature class using zonal statistics. The results can be exported to a CSV file and visualized in ArcGIS Pro.
See ANNUAL_UPDATE.md for annual update steps and handoff to the Vegetation Condition report. For April 2026, use planning/APRIL_2026_DTW_CHECKLIST.md and convert the ICWD April readings workbook ({year} April DTW all krig.xlsx) with scripts/prepare_dtw_from_excel.py. This repo also includes an open-source (no ArcGIS) testing pipeline in scripts/ and a Quarto website in docs/ for kriging plots and model comparison (GitHub Pages).
- ArcGIS Pro
- Conda
-
Clone the repository:
git clone https://github.com/your-username/kriging-dtw.git cd kriging-dtw -
Create and activate a new conda environment from ArcGIS Pro:
- Open ArcGIS Pro and go to the
Projecttab, then selectPython. - Click the Clone button and set the name to
kriging-dtw. - The destination path should be something like:
C:\Users\znelson\AppData\Local\ESRI\conda\envs\kriging-dtw
- Open ArcGIS Pro and go to the
-
Activate the environment in the terminal:
conda activate C:\Users\znelson\AppData\Local\ESRI\conda\envs\kriging-dtw
-
Optional — Excel prep packages (non-ArcPy):
pip install -r requirements.txt # pandas + openpyxl for prepare_dtw_from_excel.pyFor the open-source kriging test path, use
pip install -r scripts/requirements-open-source.txtinstead. -
Open the project folder in VSCode:
- Ensure the environment
kriging-dtwis activated automatically.
- Ensure the environment
Edit the config.ini file to specify your paths, years, kriging parameters, and zonal statistics settings.
Example config.ini:
[settings]
# Assuming the scripts are run from the project root directory
base_path = .
# single year
years = 2024
# range of years
#years = 1990-2020
# list of years
#years = 1990,1995,2000,2005,2010,2015,2020
[kriging_parameters]
cell_size = 100
transformation_type = EMPIRICAL
max_local_points = 50
overlap_factor = 1.1
number_semivariograms = 100
search_neighborhood = NBRTYPE=StandardCircular;RADIUS=2500;ANGLE=330;NBR_MAX=4;NBR_MIN=0;SECTOR_TYPE=FOUR_SECTORS
output_type = PREDICTION
quantile_value = 0.5
threshold_type = EXCEED
probability_threshold = None
semivariogram_model_type = K_BESSEL_DETRENDED
[zonal_statistics]
parcel_feature_class = kriging.gdb/vegetation_parcels
parcel_database = kriging.gdb/parcel_dtw_stats-
Run the kriging model for a specified year or range of years:
python kriging_dtw.py --config ./config.ini
-
Run the zonal statistics script:
python zonal_stats.py --config ./config.ini
- Raster Files: The kriging script generates raster files for each year specified in the configuration.
- Zonal Statistics CSV: The zonal statistics script generates CSV files containing the summarized depth to water for each polygon.
- New Parcel Layer: The zonal statistics script creates a new parcel layer with the DTW statistics joined, saved in the
kriging.gdb.
Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE file for details.

