This repository contains worked examples for the komanawa-gw-detect-power package. These examples were developed using the Jupyter Notebook environment and funded by the New Zealand Our Land and Water National Science Challenge.
Note
The examples provided require version v.2.0.0 or later of komanawa-gw-detect-power
These examples are meant to be viewed on github as well as being run locally using the Jupyter Notebook environment. Please see the Jupyter Notebook documentation for installation instructions.
The python environment for these examples is identical for the full installation of komanawa-gw-detect-power.
# create a new environment
conda create --name gwdetect python
conda activate gwdetect
# install the required packages
pip install komanawa-gw-detect-power
pip install notebook
The goal of these examples is to demonstrate how to calculate the detection power of monitoring points and is it applicable to both groundwater and surface water. The Our Land and Water National Science Challenge: Monitoring Freshwater Improvement Actions Project has signficantly more discussion on the topic of monitoring design and the use of detection power. For more information we recommend, Water Quality Monitoring for Management of Diffuse Nitrate Pollution. This document provides guidance on the design of water quality monitoring programs for the management of diffuse nitrate pollution. It includes a section on statistical power and the use of the detection power calculator as well as other factors that should be considered when designing a water quality monitoring program.
In this repo we have a couple key definitions:
- Receptor: The receptor is the location where the concentration is measured. This is typically a groundwater well, stream or lake.
- Source: The source is the location where the concentration is changed. This is typically a point source (e.g. a wastewater treatment plant) or a non-point source (e.g. a catchment/groundwater source area).
- Noise: here by noise we include the variation in the concentration at the receptor. This includes true sampling noise, but also includes any other variation in the concentration at the receptor that cannot be identified or corrected for (e.g. from weather events etc.). Typically the noise will be estimated as the standard deviation of the receptor concentration time series (assuming no trend), or the standard deviation of the residuals from a model (e.g. linear regression) of the receptor concentration time series.
- True Receptor Concentration: The true receptor concentration is the concentration at the receptor if there was no noise.
- Estimate noise.
- Create a True receptor time series.
- Resample the True receptor time series to your sampling frequncy and duration
- Run Detection power Calculator (many times e.g. 1000, 10000)
- Create a noise realisation and add it to the True time series
- Run your statisitcal test
- Detection power is the number of statistical tests with p<threshold / number of tests.
The following Jupyter Notebooks are provided in this repository (we recommend this workflow):
- Understanding_detection_power: a brief introduction to detection power and how it can be used to design monitoring programs.
- Let's talk noise: a brief introduction to the concept of noise and how it can be estimated.
- Generating_true_ts_data: a brief introduction to generating time series data for the purposes of testing the detection power calculator.
- Slope_detection_power: a worked example of how to calculate the detection power for a linear trend in a time series.
- Counterfactual_detection_power: a worked example of how to calculate the detection power for a counterfactual trend in a time series.
- Whakauru_Stream_worked_example: a full worked example of evaluating the detection power of the Whakauru Stream.
- Selwyn_well_I36_0477_worked_example: a full worked example of evaluating the detection power of the Selwyn well I36/0477.
- Counterfactual_from_models: a full worked example of evaluating the detection power for a site for synthetic modelled scenario output.
- Increasing_run_efficiency: a worked example of how to increase the run efficency of the detection power calculator.
As part of the Our Land and Water National Science Challenge, we held a workshop to accompany these worked examples. Videos can be found on the Kо̄manawa Solutions Youtube Channel and are listed below. To access the full webinar recording please see: Kо̄manawa Groundwater Detection Power Calculator.