Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardized Streamflow Index and Standardized Groundwater level Index #1877

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d8e2415
SSI
LamAdr Aug 8, 2024
15a86d9
Merge branch 'main' of https://github.com/Ouranosinc/xclim into SSI_SGI
LamAdr Aug 8, 2024
51f01ed
test streamflow
LamAdr Aug 12, 2024
5c9a11d
metadata, translation
LamAdr Aug 12, 2024
3e2e840
ssi reference
LamAdr Aug 13, 2024
59bfcfb
ssi test against self
LamAdr Aug 13, 2024
ee91fcc
Update xclim/indices/_hydrology.py
LamAdr Aug 13, 2024
dad3889
Update xclim/indices/_hydrology.py
LamAdr Aug 13, 2024
fe4f552
Update xclim/indices/_hydrology.py
LamAdr Aug 13, 2024
fe501a8
Update xclim/indices/stats.py
LamAdr Aug 13, 2024
f2fde02
Merge branch 'Ouranosinc:main' into SSI_SGI
LamAdr Aug 23, 2024
fc180f6
sgi
LamAdr Aug 23, 2024
610962b
lognorm APP
LamAdr Aug 23, 2024
97ee37a
pre-commit
LamAdr Aug 23, 2024
f10e18c
Merge branch 'main' into SSI_SGI
Zeitsperre Aug 28, 2024
a0a4309
Merge branch 'main' into SSI_SGI
Zeitsperre Sep 18, 2024
16ebcec
Merge remote-tracking branch 'upstream/main' into SSI_SGI
coxipi Feb 12, 2025
0613501
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2025
88da7b1
lots of fixes, add sgi test
coxipi Feb 13, 2025
ef299fb
Merge branch 'SSI_SGI' of https://github.com/LamAdr/xclim into SSI_SGI
coxipi Feb 13, 2025
b452332
Merge remote-tracking branch 'upstream/main' into SSI_SGI
coxipi Feb 13, 2025
712b099
better doc
coxipi Feb 13, 2025
0c2f6bc
add gwl variable
coxipi Feb 13, 2025
b2214fb
remove artefact
coxipi Feb 13, 2025
a73eee5
StandardizedIndexes in indicators.py
coxipi Feb 13, 2025
77aabcc
revert uneeded change
coxipi Feb 13, 2025
b7aee4a
Merge branch 'main' into SSI_SGI
coxipi Feb 17, 2025
d009fce
Merge branch 'main' into SSI_SGI
coxipi Feb 18, 2025
c6c16c3
specify realm
coxipi Feb 19, 2025
43d9be3
Merge branch 'SSI_SGI' of https://github.com/LamAdr/xclim into SSI_SGI
coxipi Feb 19, 2025
388dfe9
Merge branch 'main' into SSI_SGI
Zeitsperre Feb 21, 2025
ad59317
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 21, 2025
3c5728a
fix docstring length
Zeitsperre Feb 21, 2025
4af17bd
Merge branch 'main' into SSI_SGI
coxipi Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,32 @@ @article{knol_1989
number = "1",
}

@article{vicente-serrano_2012,
author = {Sergio M. Vicente-Serrano and Juan I. López-Moreno and Santiago Beguería and Jorge Lorenzo-Lacruz and Cesar Azorin-Molina and Enrique Morán-Tejeda},
title = {Accurate Computation of a Streamflow Drought Index},
journal = {Journal of Hydrologic Engineering},
volume = {17},
number = {2},
pages = {318-332},
year = {2012},
doi = {10.1061/(ASCE)HE.1943-5584.0000433},
URL = {https://ascelibrary.org/doi/abs/10.1061/%28ASCE%29HE.1943-5584.0000433},
eprint = {https://ascelibrary.org/doi/pdf/10.1061/%28ASCE%29HE.1943-5584.0000433},
abstract = "In this study, the authors investigated an approach to calculate the standardized streamflow index (SSI), which allows accurate spatial and temporal comparison of the hydrological conditions of a stream or set of streams. For this purpose, the capability of six three-parameter distributions (lognormal, Pearson Type III, log-logistic, general extreme value, generalized Pareto, and Weibull) and two different approaches to select the most suitable distribution the best monthly fit (BMF) and the minimum orthogonal distance (MD), were tested by using a monthly streamflow data set for the Ebro Basin (Spain). This large Mediterranean basin is characterized by high variability in the magnitude of streamflows and in seasonal regimes. The results show that the most commonly used probability distributions for flow frequency analysis provided good fits to the streamflow series. Thus, the visual inspection of the L-moment diagrams and the results of the Kolmogorov-Smirnov test did not enable the selection of a single optimum probability distribution. However, no single probability distribution for all the series was suitable for obtaining a robust standardized streamflow series because each of the distributions had one or more limitations. The BMF and MD approaches improved the results in the expected average, standard deviation, and the frequencies of extreme events of the SSI series in relation to the selection of a unique distribution for each station. The BMF and MD approaches involved using different probability distributions for each gauging station and month of the year to calculate the SSI. Both approaches are easy to apply and they provide very similar results in the quality of the obtained hydrological drought indexes. The proposed procedures are very flexible for analyses involving contrasting hydrological regimes and flow characteristics."
}

@article{bloomfield_2013,
AUTHOR = {Bloomfield, J. P. and Marchant, B. P.},
TITLE = {Analysis of groundwater drought building on the standardised precipitation index approach},
JOURNAL = {Hydrology and Earth System Sciences},
VOLUME = {17},
YEAR = {2013},
NUMBER = {12},
PAGES = {4769--4787},
URL = {https://hess.copernicus.org/articles/17/4769/2013/},
DOI = {10.5194/hess-17-4769-2013}
}

@article{luedeling_chill_2009,
title = {Climate change impacts on winter chill for temperate fruit and nut production: A review},
journal = {Scientia Horticulturae},
Expand Down Expand Up @@ -2319,4 +2345,5 @@ @article{huntington_2018
url = {https://www.sciencedirect.com/science/article/pii/S0022169418301276},
author = {Thomas G. Huntington and Peter K. Weiskel and David M. Wolock and Gregory J. McCabe},
keywords = {Intensification of the water cycle, Water cycle intensity, Water-balance model, Evapotranspiration, Aridification},
>>>>>>> upstream/main
}
12 changes: 12 additions & 0 deletions src/xclim/data/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@
"title": "Précipitation liquide accumulée totale",
"abstract": "Précipitation liquide accumulée totale. Les précipitations sont considérées liquides lorsque la température quotidienne moyenne est au-dessus de 0°C."
},
"SGI": {
"long_name": "Indice d'eau souterraine standardisé (SGI)",
"description": "Niveau de l'eau souterraine sur une fenêtre mobile de {window} {freq:nom}, normalisé telle que la moyenne du SGI est 0 pour les données de calibration. L'unité de la fenêtre 'X' est l'unité de temps déterminée par la fréquence de rééchantillonage,",
"title": "Indice d'eau souterraine standardisé (SGI)",
"abstract": "Niveau de l'eau souterraine sur une fenêtre mobile, normalisée telle que la moyenne du SGI est 0 pour les données de calibration. L'unité de la fenêtre est l'unité de temps déterminée par la fréquence de rééchantillonnage."
},
"SOLIDPRCPTOT": {
"long_name": "Précipitation totale lorsque la température moyenne est en dessous ou égale à {thresh}",
"description": "Précipitation solide totale {freq:f}, estimée comme la précipitation lorsque la température moyenne est en dessous ou égale à {thresh}.",
Expand All @@ -287,6 +293,12 @@
"title": "Indice de précipitation évapotranspiration standardisé (SPEI)",
"abstract": "Budget d'eau (précipitation - évapotranspiration) sur une fenêtre mobile, normalisé tel que la moyenne du SPEI est 0 pour les données de calibration. L'unité de la fenêtre est l'unité de temps déterminée par la fréquence de rééchantillonnage."
},
"SSI": {
"long_name": "Indice d'écoulement standardisé (SSI)",
"description": "Écoulement sur une fenêtre mobile de {window} {freq:nom}, normalisée telle que la moyenne du SSI est 0 pour les données de calibration. L'unité de la fenêtre 'X' est l'unité de temps déterminée par la fréquence de rééchantillonage,",
"title": "Indice d'écoulement standardisé (SSI)",
"abstract": "Écoulement sur une fenêtre mobile, normalisée telle que la moyenne du SSI est 0 pour les données de calibration. L'unité de la fenêtre est l'unité de temps déterminée par la fréquence de rééchantillonnage."
},
"DC": {
"long_name": "Indice de sécheresse",
"description": "Code numérique estimant la teneur en humidité moyenne des couches organiques.",
Expand Down
43 changes: 43 additions & 0 deletions src/xclim/indicators/land/_streamflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
high_flow_frequency,
low_flow_frequency,
rb_flashiness_index,
standardized_groundwater_index,
standardized_streamflow_index,
)

__all__ = [
Expand All @@ -27,6 +29,8 @@
"high_flow_frequency",
"low_flow_frequency",
"rb_flashiness_index",
"standardized_groundwater_index",
"standardized_streamflow_index",
]


Expand All @@ -50,6 +54,13 @@ def cfcheck(q: DataArray):
check_valid(q, "standard_name", "water_volume_transport_in_river_channel")


class StandardizedStreamflowIndexes(ResamplingIndicator):
"""Resampling but flexible inputs indicators."""

src_freq = ["D", "MS"]
context = "hydro"


base_flow_index = Streamflow(
title="Base flow index",
identifier="base_flow_index",
Expand Down Expand Up @@ -97,6 +108,7 @@ def cfcheck(q: DataArray):
parameters={"op": generic.doymin, "out_units": None},
)


flow_index = ReducingIndicator(
realm="land",
context="hydro",
Expand Down Expand Up @@ -130,3 +142,34 @@ def cfcheck(q: DataArray):
units="days",
compute=low_flow_frequency,
)

standardized_streamflow_index = StandardizedStreamflowIndexes(
title="Standardized Streamflow Index (SSI)",
identifier="ssi",
units="",
standard_name="ssi",
long_name="Standardized Streamflow Index (SSI)",
description="Streamflow over a moving {window}-X window, normalized such that SSI averages to 0 for "
"calibration data. The window unit `X` is the minimal time period defined by resampling frequency {freq}.",
abstract="Streamflow over a moving window, normalized such that SSI averages to 0 for the calibration data. "
"The window unit `X` is the minimal time period defined by the resampling frequency.",
cell_methods="",
keywords="streamflow",
compute=standardized_streamflow_index,
)


standardized_groundwater_index = StandardizedStreamflowIndexes(
title="Standardized Groundwater Index (SGI)",
identifier="sgi",
units="",
standard_name="sgi",
long_name="Standardized Groundwater Index (SGI)",
description="Groundwater over a moving {window}-X window, normalized such that SGI averages to 0 for "
"calibration data. The window unit `X` is the minimal time period defined by resampling frequency {freq}.",
abstract="Groundwater over a moving window, normalized such that SGI averages to 0 for the calibration data. "
"The window unit `X` is the minimal time period defined by the resampling frequency.",
cell_methods="",
keywords="groundwater",
compute=standardized_groundwater_index,
)
2 changes: 1 addition & 1 deletion src/xclim/indices/_agro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def standardized_precipitation_index(
>>> from xclim.indices import standardized_precipitation_index
>>> ds = xr.open_dataset(path_to_pr_file)
>>> pr = ds.pr
>>> cal_start, cal_end = "1990-05-01", "1990-08-31"
>>> cal_start, cal_end = "1990-05-01", "1992-06-01"
>>> spi_3 = standardized_precipitation_index(
... pr,
... freq="MS",
Expand Down
Loading
Loading