Skip to main content

CAVA Python package. Retrive and analyze climate data.

Project description

**Status

Beta testing

Introduction

This project is about creating a Python function to automatically get the required climate data needed to run pyAEZ. This can be an optional feature of the pyAEZ climate module.

Data source

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. 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 W5E5 and ERA5.

The currently available data is:

  • CORDEX-CORE simulations (3 GCMs donwscaled with 2 RCMs for two RCPs)
  • W5E5 and ERA5 reanalyses datasets

Available variables are:

  • Daily maximum temperature (tasmax)
  • Daily minimum temperature (tasmin)
  • Daily precipitation (pr)
  • Daily relative humidity (hurs)
  • Daily wind speed (sfcWind)
  • Daily solar radiation (rsds)

Usage

The function can be downloaded from the script folder and imported, for example, as follow:

import os
os.chdir('/path/to/function')
import cavapy
# check documentation
help(cavapy.get_climate_data)

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).

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.

### Bias-corrected climate projections
Zambia_climate_data = cavapy.get_climate_data(country="Zambia", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=False)
### Non bias-corrected climate projections
Zambia_climate_data = cavapy.get_climate_data(country="Zambia", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=False, historical=False)
### Bias-corrected climate projections plus the historical run. 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 projections. 
Zambia_climate_data = cavapy.get_climate_data(country="Zambia", cordex_domain="AFR-22", rcp="rcp26", gcm="MPI", rcm="REMO", years_up_to=2030, obs=False, bias_correction=True, historical=True)
### Observations only (ERA5)
Zambia_climate_data = cavapy.get_climate_data(country="Zambia", 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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cavapy-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cavapy-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file cavapy-0.1.0.tar.gz.

File metadata

  • Download URL: cavapy-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for cavapy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64568d64a0de6d9a28892ecc004dce829a1616e99bf3bca907f6f694a41ebdc5
MD5 5af6e2fd4defb29d2985bd1cdd7461bd
BLAKE2b-256 e65602d8c415d9038f54caa165bc8741f1ab8b9317ee862d4c2d7702163eefc9

See more details on using hashes here.

File details

Details for the file cavapy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cavapy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for cavapy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 834c1b5f084345eb4bad620f83266add30d3182967212aadcd916c4724f6444d
MD5 f7b31640a70d77fa0c7041c4dc4fedab
BLAKE2b-256 d8cbd6fdcb4565a53e2c831bfab64303829a384d32b23d4fbc60750cd1e88b61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page