climate_indices 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- climate_indices-2.0.1/LICENSE +42 -0
- climate_indices-2.0.1/PKG-INFO +93 -0
- climate_indices-2.0.1/README.md +65 -0
- climate_indices-2.0.1/pyproject.toml +70 -0
- climate_indices-2.0.1/src/climate_indices/__init__.py +1 -0
- climate_indices-2.0.1/src/climate_indices/__main__.py +1865 -0
- climate_indices-2.0.1/src/climate_indices/__spi__.py +1473 -0
- climate_indices-2.0.1/src/climate_indices/compute.py +831 -0
- climate_indices-2.0.1/src/climate_indices/eto.py +360 -0
- climate_indices-2.0.1/src/climate_indices/indices.py +570 -0
- climate_indices-2.0.1/src/climate_indices/lmoments.py +179 -0
- climate_indices-2.0.1/src/climate_indices/palmer.py +922 -0
- climate_indices-2.0.1/src/climate_indices/utils.py +497 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
BSD-3-Clause License
|
|
2
|
+
|
|
3
|
+
========================================================================================================================
|
|
4
|
+
Copyright 2017, James Adams
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
|
7
|
+
that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
10
|
+
and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
|
13
|
+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
|
|
16
|
+
or promote products derived from this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
19
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
20
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
21
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
22
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
24
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
25
|
+
OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|
|
27
|
+
========================================================================================================================
|
|
28
|
+
========================================================================================================================
|
|
29
|
+
Previous Public Domain License (from code originally downloaded from drought.gov):
|
|
30
|
+
|
|
31
|
+
========================================================================================================================
|
|
32
|
+
NOAA's National Centers for Environmental Information
|
|
33
|
+
NOAA/NESDIS/NCEI
|
|
34
|
+
151 Patton Ave, Asheville, NC 28801
|
|
35
|
+
|
|
36
|
+
THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLIC DOMAIN AND THUS ARE AVAILABLE
|
|
37
|
+
FOR UNRESTRICTED PUBLIC USE.
|
|
38
|
+
|
|
39
|
+
THEY ARE FURNISHED "AS IS." THE AUTHORS, THE UNITED STATES GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES,
|
|
40
|
+
AND AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS OF THE SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE.
|
|
41
|
+
THEY ASSUME NO RESPONSIBILITY (1) FOR THE USE OF THE SOFTWARE AND DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT
|
|
42
|
+
TO USERS.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: climate_indices
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: Reference implementations of various climate indices typically used for drought monitoring
|
|
5
|
+
Author: James Adams
|
|
6
|
+
Author-email: monocongo@gmail.com
|
|
7
|
+
Requires-Python: >=3.8,<3.12
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Intended Audience :: Education
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Dist: cftime (>=1.6.4)
|
|
22
|
+
Requires-Dist: dask (>=2023.5.0)
|
|
23
|
+
Requires-Dist: h5netcdf (>=1.1.0)
|
|
24
|
+
Requires-Dist: scipy (==1.10.1)
|
|
25
|
+
Requires-Dist: xarray (>=2023.1.0)
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
# climate_indices
|
|
31
|
+
|
|
32
|
+
[//]: # ([](https://coveralls.io/github/monocongo/climate_indices?branch=master))
|
|
33
|
+
[//]: # ([](https://www.codacy.com/app/monocongo/climate_indices?utm_source=github.com&utm_medium=referral&utm_content=monocongo/climate_indices&utm_campaign=Badge_Grade))
|
|
34
|
+
[](https://github.com/monocongo/climate_indices/actions)
|
|
35
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
#### Python library of indices useful for climate monitoring
|
|
39
|
+
|
|
40
|
+
This project contains Python implementations of various climate index algorithms which provide
|
|
41
|
+
a geographical and temporal picture of the severity and duration of precipitation and temperature
|
|
42
|
+
anomalies useful for climate monitoring and research.
|
|
43
|
+
|
|
44
|
+
The following indices are provided:
|
|
45
|
+
|
|
46
|
+
- [SPI](https://climatedataguide.ucar.edu/climate-data/standardized-precipitation-index-spi),
|
|
47
|
+
Standardized Precipitation Index, utilizing both gamma and Pearson Type III distributions
|
|
48
|
+
- [SPEI](https://www.researchgate.net/publication/252361460_The_Standardized_Precipitation-Evapotranspiration_Index_SPEI_a_multiscalar_drought_index),
|
|
49
|
+
Standardized Precipitation Evapotranspiration Index, utilizing both gamma and Pearson Type III distributions
|
|
50
|
+
- [PET](https://www.ncdc.noaa.gov/monitoring-references/dyk/potential-evapotranspiration), Potential Evapotranspiration, utilizing either [Thornthwaite](http://dx.doi.org/10.2307/21073)
|
|
51
|
+
or [Hargreaves](http://dx.doi.org/10.13031/2013.26773) equations
|
|
52
|
+
- [PNP](http://www.droughtmanagement.info/percent-of-normal-precipitation/),
|
|
53
|
+
Percentage of Normal Precipitation
|
|
54
|
+
- [PCI](https://www.tandfonline.com/doi/abs/10.1111/J.0033-0124.1980.00300.X), Precipitation Concentration Index
|
|
55
|
+
|
|
56
|
+
This Python implementation of the above climate index algorithms is being developed
|
|
57
|
+
with the following goals in mind:
|
|
58
|
+
|
|
59
|
+
- to provide an open source software package to compute a suite of
|
|
60
|
+
climate indices commonly used for climate monitoring, with well
|
|
61
|
+
documented code that is faithful to the relevant literature and
|
|
62
|
+
which produces scientifically verifiable results
|
|
63
|
+
- to provide a central, open location for participation and collaboration
|
|
64
|
+
for researchers, developers, and users of climate indices
|
|
65
|
+
- to facilitate standardization and consensus on best-of-breed
|
|
66
|
+
climate index algorithms and corresponding compliant implementations in Python
|
|
67
|
+
- to provide transparency into the operational code used for climate
|
|
68
|
+
monitoring activities at NCEI/NOAA, and consequent reproducibility
|
|
69
|
+
of published datasets computed from this package
|
|
70
|
+
- to incorporate modern software engineering principles and scientific programming
|
|
71
|
+
best practices
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
This is a developmental/forked version of code that was originally developed by NIDIS/NCEI/NOAA.
|
|
75
|
+
See [drought.gov](https://www.drought.gov/drought/python-climate-indices).
|
|
76
|
+
|
|
77
|
+
- [__Documentation__](https://climate-indices.readthedocs.io/en/latest/)
|
|
78
|
+
- [__License__](LICENSE)
|
|
79
|
+
- [__Disclaimer__](DISCLAIMER)
|
|
80
|
+
|
|
81
|
+
#### Citation
|
|
82
|
+
You can cite `climate_indices` in your projects and research papers via the BibTeX
|
|
83
|
+
entry below.
|
|
84
|
+
```
|
|
85
|
+
@misc {climate_indices,
|
|
86
|
+
author = "James Adams",
|
|
87
|
+
title = "climate_indices, an open source Python library providing reference implementations of commonly used climate indices",
|
|
88
|
+
url = "https://github.com/monocongo/climate_indices",
|
|
89
|
+
month = "may",
|
|
90
|
+
year = "2017--"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# climate_indices
|
|
4
|
+
|
|
5
|
+
[//]: # ([](https://coveralls.io/github/monocongo/climate_indices?branch=master))
|
|
6
|
+
[//]: # ([](https://www.codacy.com/app/monocongo/climate_indices?utm_source=github.com&utm_medium=referral&utm_content=monocongo/climate_indices&utm_campaign=Badge_Grade))
|
|
7
|
+
[](https://github.com/monocongo/climate_indices/actions)
|
|
8
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
#### Python library of indices useful for climate monitoring
|
|
12
|
+
|
|
13
|
+
This project contains Python implementations of various climate index algorithms which provide
|
|
14
|
+
a geographical and temporal picture of the severity and duration of precipitation and temperature
|
|
15
|
+
anomalies useful for climate monitoring and research.
|
|
16
|
+
|
|
17
|
+
The following indices are provided:
|
|
18
|
+
|
|
19
|
+
- [SPI](https://climatedataguide.ucar.edu/climate-data/standardized-precipitation-index-spi),
|
|
20
|
+
Standardized Precipitation Index, utilizing both gamma and Pearson Type III distributions
|
|
21
|
+
- [SPEI](https://www.researchgate.net/publication/252361460_The_Standardized_Precipitation-Evapotranspiration_Index_SPEI_a_multiscalar_drought_index),
|
|
22
|
+
Standardized Precipitation Evapotranspiration Index, utilizing both gamma and Pearson Type III distributions
|
|
23
|
+
- [PET](https://www.ncdc.noaa.gov/monitoring-references/dyk/potential-evapotranspiration), Potential Evapotranspiration, utilizing either [Thornthwaite](http://dx.doi.org/10.2307/21073)
|
|
24
|
+
or [Hargreaves](http://dx.doi.org/10.13031/2013.26773) equations
|
|
25
|
+
- [PNP](http://www.droughtmanagement.info/percent-of-normal-precipitation/),
|
|
26
|
+
Percentage of Normal Precipitation
|
|
27
|
+
- [PCI](https://www.tandfonline.com/doi/abs/10.1111/J.0033-0124.1980.00300.X), Precipitation Concentration Index
|
|
28
|
+
|
|
29
|
+
This Python implementation of the above climate index algorithms is being developed
|
|
30
|
+
with the following goals in mind:
|
|
31
|
+
|
|
32
|
+
- to provide an open source software package to compute a suite of
|
|
33
|
+
climate indices commonly used for climate monitoring, with well
|
|
34
|
+
documented code that is faithful to the relevant literature and
|
|
35
|
+
which produces scientifically verifiable results
|
|
36
|
+
- to provide a central, open location for participation and collaboration
|
|
37
|
+
for researchers, developers, and users of climate indices
|
|
38
|
+
- to facilitate standardization and consensus on best-of-breed
|
|
39
|
+
climate index algorithms and corresponding compliant implementations in Python
|
|
40
|
+
- to provide transparency into the operational code used for climate
|
|
41
|
+
monitoring activities at NCEI/NOAA, and consequent reproducibility
|
|
42
|
+
of published datasets computed from this package
|
|
43
|
+
- to incorporate modern software engineering principles and scientific programming
|
|
44
|
+
best practices
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
This is a developmental/forked version of code that was originally developed by NIDIS/NCEI/NOAA.
|
|
48
|
+
See [drought.gov](https://www.drought.gov/drought/python-climate-indices).
|
|
49
|
+
|
|
50
|
+
- [__Documentation__](https://climate-indices.readthedocs.io/en/latest/)
|
|
51
|
+
- [__License__](LICENSE)
|
|
52
|
+
- [__Disclaimer__](DISCLAIMER)
|
|
53
|
+
|
|
54
|
+
#### Citation
|
|
55
|
+
You can cite `climate_indices` in your projects and research papers via the BibTeX
|
|
56
|
+
entry below.
|
|
57
|
+
```
|
|
58
|
+
@misc {climate_indices,
|
|
59
|
+
author = "James Adams",
|
|
60
|
+
title = "climate_indices, an open source Python library providing reference implementations of commonly used climate indices",
|
|
61
|
+
url = "https://github.com/monocongo/climate_indices",
|
|
62
|
+
month = "may",
|
|
63
|
+
year = "2017--"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ['poetry-core>=1.0.0']
|
|
3
|
+
build-backend = 'poetry.core.masonry.api'
|
|
4
|
+
|
|
5
|
+
[project.urls]
|
|
6
|
+
'Homepage' = 'https://github.com/monocongo/climate_indices'
|
|
7
|
+
'Bug Tracker' = 'https://github.com/monocongo/climate_indices/issues'
|
|
8
|
+
|
|
9
|
+
[tool.black]
|
|
10
|
+
line-length = 120
|
|
11
|
+
target-version = ['py39', 'py310', 'py311']
|
|
12
|
+
include = '\.pyi?$'
|
|
13
|
+
exclude = '''
|
|
14
|
+
/(
|
|
15
|
+
\.git
|
|
16
|
+
| \.mypy_cache
|
|
17
|
+
| \.tox
|
|
18
|
+
| \.venv
|
|
19
|
+
| build
|
|
20
|
+
| dist
|
|
21
|
+
)/
|
|
22
|
+
'''
|
|
23
|
+
|
|
24
|
+
[tool.poetry]
|
|
25
|
+
name = 'climate_indices'
|
|
26
|
+
version = '2.0.1'
|
|
27
|
+
description = 'Reference implementations of various climate indices typically used for drought monitoring'
|
|
28
|
+
authors = ['James Adams <monocongo@gmail.com>']
|
|
29
|
+
readme = 'README.md'
|
|
30
|
+
classifiers = [
|
|
31
|
+
'Development Status :: 5 - Production/Stable',
|
|
32
|
+
'Intended Audience :: Developers',
|
|
33
|
+
'Intended Audience :: Education',
|
|
34
|
+
'Intended Audience :: Science/Research',
|
|
35
|
+
'License :: OSI Approved :: BSD License',
|
|
36
|
+
'Programming Language :: Python :: 3.8',
|
|
37
|
+
'Programming Language :: Python :: 3.9',
|
|
38
|
+
'Programming Language :: Python :: 3.10',
|
|
39
|
+
'Programming Language :: Python :: 3.11',
|
|
40
|
+
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
41
|
+
'Topic :: Scientific/Engineering :: Atmospheric Science',
|
|
42
|
+
'Topic :: Scientific/Engineering :: Physics'
|
|
43
|
+
]
|
|
44
|
+
packages = [{include = 'climate_indices', from = 'src'}]
|
|
45
|
+
|
|
46
|
+
[tool.poetry.dependencies]
|
|
47
|
+
# only Python and scipy are required for the base library code
|
|
48
|
+
python = '>=3.8,<3.12'
|
|
49
|
+
scipy = '1.10.1'
|
|
50
|
+
# remaining dependencies are required for the CLI (console) scripts
|
|
51
|
+
cftime = '>=1.6.4'
|
|
52
|
+
dask = '>=2023.5.0'
|
|
53
|
+
h5netcdf = '>=1.1.0'
|
|
54
|
+
xarray = '>=2023.1.0'
|
|
55
|
+
|
|
56
|
+
[tool.poetry.dev-dependencies]
|
|
57
|
+
pytest = '8.3.3'
|
|
58
|
+
toml = '>=0.10.2'
|
|
59
|
+
|
|
60
|
+
[tool.poetry.group.dev.dependencies]
|
|
61
|
+
sphinx-autodoc-typehints = '2.0.1'
|
|
62
|
+
|
|
63
|
+
[tool.poetry.scripts]
|
|
64
|
+
process_climate_indices = 'climate_indices.__main__:main'
|
|
65
|
+
spi = 'climate_indices.__spi__:main'
|
|
66
|
+
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
filterwarnings = [
|
|
69
|
+
'ignore::FutureWarning',
|
|
70
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Climate indices for drought monitoring"""
|