cavapy 0.1.4__tar.gz → 0.3.0__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.
Potentially problematic release.
This version of cavapy might be problematic. Click here for more details.
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: cavapy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: CAVA Python package. Retrive and analyze climate data.
|
|
5
|
-
Home-page: https://github.com/Risk-Team/cavapy
|
|
6
5
|
License: MIT
|
|
7
6
|
Author: Riccardo Soldan
|
|
8
7
|
Author-email: riccardosoldan@hotmail.it
|
|
@@ -28,13 +27,23 @@ Description-Content-Type: text/markdown
|
|
|
28
27
|
<h2 align="center">cavapy: CORDEX-CORE Climate Data Access Simplified</h2>
|
|
29
28
|
<br>
|
|
30
29
|
<div align="center">
|
|
31
|
-
<img src="https://img.shields.io/pepy/dt/cavapy?style=plastic" alt="
|
|
30
|
+
<img src="https://img.shields.io/pepy/dt/cavapy?style=plastic&label=Total%20Downloads" alt="Total downloads">
|
|
31
|
+
<img src="https://img.shields.io/pypi/dw/cavapy?label=Weekly%20Downloads" alt="Weekly downloads">
|
|
32
32
|
<img src="https://img.shields.io/pypi/v/cavapy?label=pypi%20package" alt="version" style="display: inline-block;">
|
|
33
|
+
<img src="https://shields.io/badge/dependencies-Python_3.11-blue" alt="version" style="display: inline-block;">
|
|
33
34
|
</div>
|
|
34
35
|
</h1
|
|
35
36
|
|
|
36
37
|
---
|
|
37
38
|
|
|
39
|
+
--------------------------------------------------------------------------------------------------
|
|
40
|
+
**Check GitHub issues for known servers' downtimes**
|
|
41
|
+
|
|
42
|
+
**We will release bias-corrected CORDEX-CORE simulations with the ISIMIP methodology in 2025. This will allow non-expert users to directly use these datasets and avoid the need for custom bias-correction**
|
|
43
|
+
|
|
44
|
+
--------------------------------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
|
|
38
47
|
## Introduction
|
|
39
48
|
|
|
40
49
|
`cavapy` is a Python library designed to streamline the retrieval of CORDEX-CORE climate models hosted on THREDDS servers at the University of Cantabria. Using the Open-source Project for a Network Data Access Protocol (**OPeNDAP**), users can directly access and subset datasets without the need to download large NetCDF files. This capability is part of the Climate and Agriculture Risk Visualization and Assessment (CAVA) [project](https://risk-team.github.io/CAVAanalytics/articles/CAVA.html), which focuses on providing high-resolution climate data for scientific, environmental, and agricultural applications.
|
|
@@ -42,21 +51,17 @@ Description-Content-Type: text/markdown
|
|
|
42
51
|
With `cavapy`, users can efficiently integrate CORDEX-CORE data into their workflows, making it an ideal resource for hydrological and crop modeling, among other climate-sensitive analyses. Additionally, `cavapy` enables bias correction, potentially enhancing the precision and usability of the data for a wide range of applications.
|
|
43
52
|
|
|
44
53
|
|
|
45
|
-
|
|
46
54
|
## Data Source
|
|
47
55
|
|
|
48
56
|
The climate data provided by `cavapy` is hosted on the THREDDS data server of the University of Cantabria as part of the CAVA project. CAVA is a collaborative effort by FAO, the University of Cantabria, the University of Cape Town, and Predictia, aimed at democratising accessibility and usability of climate information.
|
|
49
57
|
|
|
50
|
-
###
|
|
58
|
+
### Available Datasets via capapy:
|
|
51
59
|
- **CORDEX-CORE Simulations**: Dynamically downscaled high-resolution (25 km) climate models, used in the IPCC AR5 report, featuring simulations from:
|
|
52
60
|
- 3 Global Climate Models (GCMs)
|
|
53
61
|
- 2 Regional Climate Models (RCMs)
|
|
54
|
-
- Two Representative Concentration Pathways (RCPs:
|
|
55
|
-
- **Reanalyses
|
|
56
|
-
- ERA5
|
|
57
|
-
- W5E5 v2
|
|
58
|
-
|
|
59
|
-
These datasets provide robust inputs for climate and environmental modeling, supporting scientific and policy-driven decision-making.
|
|
62
|
+
- Two Representative Concentration Pathways (RCPs: RCP2.6 and RCP8.5)
|
|
63
|
+
- **Reanalyses Dataset**:
|
|
64
|
+
- ERA5 (used for the optional bias correction of the CORDEX-CORE projections)
|
|
60
65
|
|
|
61
66
|
---
|
|
62
67
|
|
|
@@ -91,14 +96,15 @@ The get_climate_data function performs automatically:
|
|
|
91
96
|
|
|
92
97
|
## Example usage
|
|
93
98
|
|
|
94
|
-
Depending on the interest, downloading climate data can be done in a few different ways. Note that GCM stands for General Circulation Model while
|
|
99
|
+
Depending on the interest, downloading climate data can be done in a few different ways. Note that GCM stands for General Circulation Model while RCM 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).
|
|
95
100
|
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.
|
|
96
101
|
|
|
97
|
-
It takes about 10 minutes to run each of the tasks below. For bigger areas/country, the computational time increases.
|
|
102
|
+
It takes about 10 minutes to run each of the tasks below. For bigger areas/country, the computational time increases.
|
|
98
103
|
|
|
99
104
|
### Bias-corrected climate projections
|
|
100
105
|
**By default all available climate variables are used. You can specify a subset with the variable argument**
|
|
101
106
|
|
|
107
|
+
Note that bias correction is automatically performed with empirical quantile mapping on a monthly basis to account for seasonality.
|
|
102
108
|
```
|
|
103
109
|
import cavapy
|
|
104
110
|
Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax", "pr"], cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=False)
|
|
@@ -121,6 +127,6 @@ Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax",
|
|
|
121
127
|
|
|
122
128
|
```
|
|
123
129
|
import cavapy
|
|
124
|
-
Togo_climate_data = cavapy.get_climate_data(country="Togo",
|
|
130
|
+
Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax", "pr"], obs=True, years_obs=range(1980,2019))
|
|
125
131
|
```
|
|
126
132
|
|
|
@@ -3,13 +3,23 @@
|
|
|
3
3
|
<h2 align="center">cavapy: CORDEX-CORE Climate Data Access Simplified</h2>
|
|
4
4
|
<br>
|
|
5
5
|
<div align="center">
|
|
6
|
-
<img src="https://img.shields.io/pepy/dt/cavapy?style=plastic" alt="
|
|
6
|
+
<img src="https://img.shields.io/pepy/dt/cavapy?style=plastic&label=Total%20Downloads" alt="Total downloads">
|
|
7
|
+
<img src="https://img.shields.io/pypi/dw/cavapy?label=Weekly%20Downloads" alt="Weekly downloads">
|
|
7
8
|
<img src="https://img.shields.io/pypi/v/cavapy?label=pypi%20package" alt="version" style="display: inline-block;">
|
|
9
|
+
<img src="https://shields.io/badge/dependencies-Python_3.11-blue" alt="version" style="display: inline-block;">
|
|
8
10
|
</div>
|
|
9
11
|
</h1
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
15
|
+
--------------------------------------------------------------------------------------------------
|
|
16
|
+
**Check GitHub issues for known servers' downtimes**
|
|
17
|
+
|
|
18
|
+
**We will release bias-corrected CORDEX-CORE simulations with the ISIMIP methodology in 2025. This will allow non-expert users to directly use these datasets and avoid the need for custom bias-correction**
|
|
19
|
+
|
|
20
|
+
--------------------------------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
|
|
13
23
|
## Introduction
|
|
14
24
|
|
|
15
25
|
`cavapy` is a Python library designed to streamline the retrieval of CORDEX-CORE climate models hosted on THREDDS servers at the University of Cantabria. Using the Open-source Project for a Network Data Access Protocol (**OPeNDAP**), users can directly access and subset datasets without the need to download large NetCDF files. This capability is part of the Climate and Agriculture Risk Visualization and Assessment (CAVA) [project](https://risk-team.github.io/CAVAanalytics/articles/CAVA.html), which focuses on providing high-resolution climate data for scientific, environmental, and agricultural applications.
|
|
@@ -17,21 +27,17 @@
|
|
|
17
27
|
With `cavapy`, users can efficiently integrate CORDEX-CORE data into their workflows, making it an ideal resource for hydrological and crop modeling, among other climate-sensitive analyses. Additionally, `cavapy` enables bias correction, potentially enhancing the precision and usability of the data for a wide range of applications.
|
|
18
28
|
|
|
19
29
|
|
|
20
|
-
|
|
21
30
|
## Data Source
|
|
22
31
|
|
|
23
32
|
The climate data provided by `cavapy` is hosted on the THREDDS data server of the University of Cantabria as part of the CAVA project. CAVA is a collaborative effort by FAO, the University of Cantabria, the University of Cape Town, and Predictia, aimed at democratising accessibility and usability of climate information.
|
|
24
33
|
|
|
25
|
-
###
|
|
34
|
+
### Available Datasets via capapy:
|
|
26
35
|
- **CORDEX-CORE Simulations**: Dynamically downscaled high-resolution (25 km) climate models, used in the IPCC AR5 report, featuring simulations from:
|
|
27
36
|
- 3 Global Climate Models (GCMs)
|
|
28
37
|
- 2 Regional Climate Models (RCMs)
|
|
29
|
-
- Two Representative Concentration Pathways (RCPs:
|
|
30
|
-
- **Reanalyses
|
|
31
|
-
- ERA5
|
|
32
|
-
- W5E5 v2
|
|
33
|
-
|
|
34
|
-
These datasets provide robust inputs for climate and environmental modeling, supporting scientific and policy-driven decision-making.
|
|
38
|
+
- Two Representative Concentration Pathways (RCPs: RCP2.6 and RCP8.5)
|
|
39
|
+
- **Reanalyses Dataset**:
|
|
40
|
+
- ERA5 (used for the optional bias correction of the CORDEX-CORE projections)
|
|
35
41
|
|
|
36
42
|
---
|
|
37
43
|
|
|
@@ -66,14 +72,15 @@ The get_climate_data function performs automatically:
|
|
|
66
72
|
|
|
67
73
|
## Example usage
|
|
68
74
|
|
|
69
|
-
Depending on the interest, downloading climate data can be done in a few different ways. Note that GCM stands for General Circulation Model while
|
|
75
|
+
Depending on the interest, downloading climate data can be done in a few different ways. Note that GCM stands for General Circulation Model while RCM 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).
|
|
70
76
|
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.
|
|
71
77
|
|
|
72
|
-
It takes about 10 minutes to run each of the tasks below. For bigger areas/country, the computational time increases.
|
|
78
|
+
It takes about 10 minutes to run each of the tasks below. For bigger areas/country, the computational time increases.
|
|
73
79
|
|
|
74
80
|
### Bias-corrected climate projections
|
|
75
81
|
**By default all available climate variables are used. You can specify a subset with the variable argument**
|
|
76
82
|
|
|
83
|
+
Note that bias correction is automatically performed with empirical quantile mapping on a monthly basis to account for seasonality.
|
|
77
84
|
```
|
|
78
85
|
import cavapy
|
|
79
86
|
Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax", "pr"], cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=False)
|
|
@@ -96,5 +103,5 @@ Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax",
|
|
|
96
103
|
|
|
97
104
|
```
|
|
98
105
|
import cavapy
|
|
99
|
-
Togo_climate_data = cavapy.get_climate_data(country="Togo",
|
|
106
|
+
Togo_climate_data = cavapy.get_climate_data(country="Togo", variables=["tasmax", "pr"], obs=True, years_obs=range(1980,2019))
|
|
100
107
|
```
|