Skip to content

Commit

Permalink
Update groundwater signatures module (#636)
Browse files Browse the repository at this point in the history
Co-authored-by: MatevzVremec <matevz.vremec@gmail.com>
  • Loading branch information
raoulcollenteur and mvremec committed Feb 16, 2024
1 parent 6ce4090 commit 5251c97
Show file tree
Hide file tree
Showing 3 changed files with 932 additions and 378 deletions.
49 changes: 19 additions & 30 deletions doc/examples/signatures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"source": [
"# Groundwater signatures\n",
"\n",
"*R.A. Collenteur, University of Graz, 2022*\n",
"*R.A. Collenteur, Eawag, 2023*\n",
"\n",
"In this notebook we introduce the **groundwater signatures** module available in Pastas. The signatures methods can be accessed through the `signatures` module in the `pastas.stats` sub-package. This module is partly based on the work from [Heudorfer et al. (2019)](#References) and others (see [References](#References)).\n",
"In this notebook we introduce the **groundwater signatures** module available in Pastas. The signatures methods can be accessed through the `signatures` module in the `pastas.stats` sub-package.\n",
"\n",
"Groundwater signatures characterize different aspects of a groundwater time series, and can be subdivided in different categories: shape, distribution, and structure. Groundwater signatures are also referred to as 'indices' or 'quantitative' metrics. In Pastas, 'signatures' is adopted to avoid any confusion with time indices and goodness-of-fit metrics. \n",
"Groundwater signatures are quantitative metrics that characterize different aspects of a groundwater time series. They are commonly subdivided in different categories: shape, distribution, and structure. Groundwater signatures are also referred to as 'indices' or 'quantitative' metrics. In Pastas, 'signatures' is adopted to avoid any confusion with time indices and goodness-of-fit metrics. \n",
"\n",
"The signatures can be used to *objectively* characterize different groundwater systems, for example distinquishing between fast and slow groundwater systems. The use of signatures is common in other parts of hydrology (e.g., rainfall-runoff modeling) and can be applied in all phases of modeling (see, for example [McMillan, 2020](#References) for an overview). \n",
"The signatures can be used to *objectively* characterize different groundwater systems, for example, distinguishing between fast and slow groundwater systems. The use of signatures is common in other parts of hydrology (e.g., rainfall-runoff modeling) and can be applied in all phases of modeling (see, for example, [McMillan, 2021](#References) for an overview). \n",
"\n",
"<div class=\"alert alert-warning\">\n",
"<b>Note:</b>\n",
"The `signatures` module is still work in progress and needs further verification. Please report any issues and bugs on the Pastas GitHub repository!\n",
"The `signatures` module is under active development and any help is welcome. Please report any issues and bugs on the Pastas GitHub repository!\n",
"</div>"
]
},
Expand Down Expand Up @@ -103,34 +103,21 @@
"source": [
"## 3. Plot the results\n",
"\n",
"Depending on the signature, different ranges of parameters can be expected. We therefore split the signatures in two range for visualization purposes."
"Depending on the signature, different ranges of parameters can be expected. We therefore normalize the signatures values by the mean value of each signature. This way we can easily compare the two groundwater systems."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "63e5dfaa",
"id": "e8fe7d8d-5ae1-4cae-a267-080f5cdcbf75",
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure(constrained_layout=True, figsize=(10, 4))\n",
"gs = GridSpec(1, 5, figure=fig)\n",
"ax1 = fig.add_subplot(gs[0, :4])\n",
"ax2 = fig.add_subplot(gs[0, 4])\n",
"\n",
"low_values = df.where(df < 2).dropna()\n",
"low_values.plot(ax=ax1)\n",
"ax1.set_xticks(np.arange(len(low_values.index)))\n",
"ax1.set_xticklabels(low_values.index, rotation=90)\n",
"ax1.grid()\n",
"high_values = df.where(df > 2).dropna()\n",
"high_values.plot(ax=ax2)\n",
"ax2.set_xticks(np.arange(len(high_values)))\n",
"ax2.set_xticklabels(high_values.index, rotation=90)\n",
"ax2.grid()\n",
"\n",
"ax1.set_title(\"Low value signatures\")\n",
"ax2.set_title(\"High value signatures\");"
"_, ax = plt.subplots(1,1, figsize=(10, 4))\n",
"df.div(df.mean(axis=1), axis=0).mul(100).plot(ax=ax)\n",
"ax.set_xticks(np.arange(len(df.index)), df.index, rotation=90, )\n",
"ax.set_ylabel(\"% Change from the mean\\n signature value\")\n",
"ax.grid()"
]
},
{
Expand All @@ -141,14 +128,16 @@
},
"source": [
"## 4. Interpretation of signatures\n",
"The different signatures can be used to compare the different systems or characterize a single system. For example, the first head time series has a high bimodality coefficient (>0.7), indicating a bimodel distribution of the data. This makes sense, as this time series is used as an example for the non-linear threshold model (see notebook). Rather than (naively) testing all model structures, this is an example where we can potentially use a groundwater signature to identify a 'best' model structure beforehand.\n",
"\n",
"Another example. The second time series is observed in a much slower groundwater system than the first. This is for example clearly visible and quantified by the different values for the 'pulse_duration', the 'recession and recovery constants', and the 'slope of the duration curves'. We could use this type of information to determine whether we should use a 'fast' or 'slow' response function (e.g., an Exponential or Gamma function). These are just some examples of how groundwater signatures can be used to improve groundwater modeling, more research on this topic is required. Please contact us if interested!\n",
"The different signatures can be used to compare the different systems or characterize a single system. For example, the first head time series has a high bimodality coefficient (>0.7), indicating a bimodal distribution of the data. This makes sense, as this time series is used as an example for the non-linear threshold model (see notebook). Rather than (naively) testing all model structures, this is an example where we can potentially use a groundwater signature to identify a 'best' model structure beforehand.\n",
"\n",
"A little disclaimer: from the plot above it is actually not that straightforward to compare the indices, because the range in values is large. For example, the rise and fall rate visually show no differences, but their numbers vary by over 200%. Thus, interpretation requires some more work. \n",
"Another example. The second time series is observed in a much slower groundwater system than the first. This is, for example, clearly visible and quantified by the different values for the 'pulse_duration', the 'recession and recovery constants', and the 'slope of the duration curves'. We could use this type of information to determine whether we should use a 'fast' or 'slow' response function (e.g., an Exponential or Gamma function). These are just some examples of how groundwater signatures can be used to improve groundwater modeling, more research on this topic is required. Please contact us if interested!\n",
"\n",
"A little disclaimer: from the data above, it is actually not that straightforward to compare the signature values because the range in values is large. For example, the rise and fall rate show small differences in absolute values, but their numbers vary by over 200%. Thus, interpretation requires some more work. \n",
"\n",
"### References\n",
"The following references are helpfull in learning about the groundwater signatures:\n",
"\n",
"The following references are helpful in learning about the groundwater signatures:\n",
"\n",
"- Heudorfer, B., Haaf, E., Stahl, K., Barthel, R., 2019. [Index-based characterization and quantification of groundwater dynamics.](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2018WR024418) Water Resources Research.\n",
"- Haaf, E., Giese, M., Heudorfer, B., Stahl, K., Barthel, R., 2020. [Physiographic and Climatic Controls on Regional Groundwater Dynamics.](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2019WR026545) Water Resources Research.\n",
Expand All @@ -173,7 +162,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.11.3"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit 5251c97

Please sign in to comment.