cavapy 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

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.

Potentially problematic release.


This version of cavapy might be problematic. Click here for more details.

@@ -1,21 +1,21 @@
1
- Copyright (c) Food and Agriculture Organization of the United Nations. All rights reserved.
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Copyright (c) Food and Agriculture Organization of the United Nations. All rights reserved.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.3
2
+ Name: cavapy
3
+ Version: 0.1.1
4
+ Summary: CAVA Python package. Retrive and analyze climate data.
5
+ Home-page: https://github.com/Risk-Team/cavapy
6
+ License: MIT
7
+ Author: Riccardo Soldan
8
+ Author-email: riccardosoldan@hotmail.it
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Dist: bottleneck (>=1.4.2,<2.0.0)
17
+ Requires-Dist: dask (>=2024.11.2,<2025.0.0)
18
+ Requires-Dist: geopandas (>=0.14.4,<0.15.0)
19
+ Requires-Dist: llvmlite (==0.43.0)
20
+ Requires-Dist: matplotlib (>=3.9.2,<4.0.0)
21
+ Requires-Dist: netcdf4 (>=1.7.2,<2.0.0)
22
+ Requires-Dist: xclim (>=0.53.2,<0.54.0)
23
+ Project-URL: Repository, https://github.com/Risk-Team/cavapy
24
+ Description-Content-Type: text/markdown
25
+
26
+ # Introduction
27
+ cavapy is a Python library that allows retrieval of climate data hosted in THREDDS servers at the University of Cantabria thanks to the [CAVA project](https://risk-team.github.io/CAVAanalytics/articles/CAVA.html).
28
+
29
+ ## Data source
30
+ The climate data is available at the THREDDS data server of the University of Cantabria as part of the CAVA (Climate and Agriculture Risk Visualization and Assessment) product developed by FAO, the University of Cantabria, the University of Cape Town and Predictia.
31
+ CAVA has available CORDEX-CORE climate models, the high resolution (25 Km) dynamically-downscaled climate models used in the IPCC report AR5. Additionally, CAVA offers access to state-of-the-art reanalyses datasets, such as ERA5 and the observational dataset W5E5 v2.
32
+
33
+ The currently available data is:
34
+
35
+ - CORDEX-CORE simulations (3 GCMs donwscaled with 2 RCMs for two RCPs)
36
+ - W5E5 and ERA5 datasets
37
+
38
+ Available variables:
39
+
40
+ - Daily maximum temperature (tasmax) (°C)
41
+ - Daily minimum temperature (tasmin) (°C)
42
+ - Daily precipitation (pr) (mm)
43
+ - Daily relative humidity (hurs) (%)
44
+ - Daily wind speed (sfcWind) (2 m level m/s)
45
+ - Daily solar radiation (rsds) (W/m^2)
46
+
47
+
48
+ ## Installation
49
+ cavapy can be installed with pip. Ensure that you are not using a python version > 13.
50
+
51
+ ```
52
+ conda create -n test python=3.11
53
+ conda activate test
54
+ pip install cavapy
55
+ ```
56
+ ## Process
57
+
58
+ The get_climate_data function performs automatically:
59
+ - Data retrieval in parallel
60
+ - Unit conversion
61
+ - Convert into a Gregorian calendar (CORDEX-CORE models do not have a full 365 days calendar) through linear interpolation
62
+ - Bias correction using the empirical quantile mapping (optional)
63
+
64
+ ## Example usage
65
+
66
+ Depending on the interest, downloading climate data can be done in a few different ways. Note that GCM stands for General Circulation Model while RCP stands for Regional Climate Model. As the climate data comes from the CORDEX-CORE initiative, users can choose between 3 different GCMs downscaled with two RCMs. In total, there are six simulations for any given domain (except for CAS-22 where only three are available).
67
+ Since bias-correction requires both the historical run of the CORDEX model and the observational dataset (in this case ERA5), even when the historical argument is set to False, the historical run will be used for learning the bias correction factor.
68
+
69
+ It takes about 10 minutes to run each of the tasks below. For bigger areas/country, the computational time increases. For example, for Zambia it takes about 30 minutes.
70
+
71
+ ### Bias-corrected climate projections
72
+ ```
73
+ import cavapy
74
+ Togo_climate_data = cavapy.get_climate_data(country="Togo", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=False)
75
+ ```
76
+ ### Non bias-corrected climate projections
77
+
78
+ ```
79
+ import cavapy
80
+ Togo_climate_data = cavapy.get_climate_data(country="Togo", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=False, historical=False)
81
+ ```
82
+ ### Bias-corrected climate projections plus the historical run
83
+
84
+ This is useful when assessing changes in crop yield from the historical period. In this case, we provide the bias-corrected historical run of the climate models plus the bias-corrected projections.
85
+
86
+ ```
87
+ import cavapy
88
+ Togo_climate_data = cavapy.get_climate_data(country="Togo", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=True)
89
+ ```
90
+ ### Observations only (ERA5)
91
+
92
+ ```
93
+ import cavapy
94
+ Togo_climate_data = cavapy.get_climate_data(country="Togo", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=True, bias_correction=True, historical=True, years_obs=range(1980,2019))
95
+ ```
96
+
@@ -0,0 +1,5 @@
1
+ cavapy.py,sha256=dYDRyrrKn560xp4gGOL73ctn8YZLqrtkMw6631YMbkI,23557
2
+ cavapy-0.1.1.dist-info/LICENSE,sha256=1etyG4_n-Tb3yoNMwQ38g_WxXFQ4E_ZCjZc-AGYPc9U,1151
3
+ cavapy-0.1.1.dist-info/METADATA,sha256=PB0uKvdF9W0vli69Vf4KKdrOaOLMFnhwtitXi0od7KE,4732
4
+ cavapy-0.1.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
5
+ cavapy-0.1.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any