diff --git a/CHANGES.rst b/CHANGES.rst index 49974f805..deaabd36d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,7 +22,8 @@ Breaking changes Bug fixes ^^^^^^^^^ -* Fixed passing ``missing=0`` to ``xclim.core.calendar.convert_calendar`` (:issue:`1562`, :pull:`1563`). +* Fixed passing ``missing=0`` to ``xclim.core.calendar.convert_calendar``. (:issue:`1562`, :pull:`1563`). +* Fix wrong `window` attributes in ``xclim.indices.standardized_precipitation_index``, ``xclim.indices.standardized_precipitation_evapotranspiration_index``. (:issue:`1552` :pull:`1554`). Internal changes ^^^^^^^^^^^^^^^^ diff --git a/docs/references.bib b/docs/references.bib index 9b11742f2..1c5f49339 100644 --- a/docs/references.bib +++ b/docs/references.bib @@ -2103,3 +2103,18 @@ @article{Lafferty2023 url = {https://www.nature.com/articles/s41612-023-00486-0}, year = {2023}, } + +@article{thom_1958, + title = {A Note on the Gamma Distribution}, + author = {Thom, H. C. S.}, + year = {1958}, + journal = {Monthly Weather Review}, + volume = {86}, + number = {4}, + pages = {117--122}, + publisher = {{American Meteorological Society}}, + issn = {1520-0493, 0027-0644}, + doi = {10.1175/1520-0493(1958)086<0117:ANOTGD>2.0.CO;2}, + abstract = {Abstract The general properties of the gamma distribution, which has several applications in meteorology, are discussed. A short review of the general properties of good statistical estimators is given. This is applied to the gamma distribution to show that the maximum likelihood estimators are jointly sufficient. A new, simple approximation of the likelihood solutions is given, and the efficiency of the fitting procedure is computed.}, + chapter = {Monthly Weather Review}, +} diff --git a/xclim/indices/_agro.py b/xclim/indices/_agro.py index f8571f669..96fa9f795 100644 --- a/xclim/indices/_agro.py +++ b/xclim/indices/_agro.py @@ -1239,6 +1239,7 @@ def standardized_precipitation_index( spi = standardized_index(pr, params) spi.attrs = params.attrs spi.attrs["freq"] = freq or xarray.infer_freq(spi.time) + spi.attrs["window"] = window spi.attrs["units"] = "" return spi diff --git a/xclim/indices/stats.py b/xclim/indices/stats.py index 8325ba623..7a91e89bc 100644 --- a/xclim/indices/stats.py +++ b/xclim/indices/stats.py @@ -476,7 +476,7 @@ def _fit_start(x, dist: str, **fitkwargs: Any) -> tuple[tuple, dict]: References ---------- - :cite:cts:`coles_introduction_2001,cohen_parameter_2019` + :cite:cts:`coles_introduction_2001,cohen_parameter_2019, thom_1958` """ x = np.asarray(x)