Skip to content

Building block for obtaining selected weather data at given location (0.1° x 0.1° spatial resolution) for desired time periods, at hourly resolution, e.g. from Copernicus ERA5-Land dataset

License

Notifications You must be signed in to change notification settings

BioDT/general-copernicus-weather-data

Repository files navigation

BioDT - Copernicus Weather Data

Building block for obtaining selected weather data at given location(s) at hourly resolution, from Copernicus ERA5-Land dataset (interpolated from 0.1° x 0.1° or 0.25° x 0.25° spatial resolution) for desired time periods. Optional conversion to and calculation of specific target variables at daily resolution.

DOI

Installation

The current development version can be installed as:

pip install git+https://github.com/BioDT/general-copernicus-weather-data.git@main

Usage

Preparatory step: setup the CDS API personal access token as described here.

Request data for a span of years at a few locations:

from copernicus import get_weather_data

years = list(range(2022, 2025))
coordinates = [{"lat": 51.123456, "lon": 11.987654}, {"lat": 51.234, "lon": 11.876}, {"lat": 51.33, "lon": 11.66}]
get_weather_data(years, coordinates)

Full function signature:

get_weather_data(years, coordinates_list, *, months=list(range(1, 13)), data_format='grib', download_area=True, grid_resolution=0.1, final_time_resolution='daily', target_folder=None)

Parameters:

  • years (list of int): Years list.

  • coordinates_list (list of dict): List of dictionaries with 'lat' and 'lon' keys ({'lat': float, 'lon': float}).

  • months (list of int): Months list (1-12, default is [1, 2, ... 12]).

  • data_format (str): Data format ('grib' or 'netcdf', default is 'grib').

  • download_area (bool): Download raw weather data for whole area covering all locations from the coordinates list at grid resolution (default is True). If False, data will be downloaded for each location separately (only available for 'netcdf' format).

  • grid_resolution (float): Grid resolution (0.1 or 0.25, default is 0.1).

  • final_time_resolution (str): Resolution for final text file ('hourly' or 'daily', default is 'daily').

  • target_folder (str or Path): Target folder for .txt files (default is 'weatherDataPrepared').

Developers

Developed in the BioDT project by Thomas Banitz (UFZ) with contributions by Franziska Taubert (UFZ) and Tuomas Rossi (CSC).

Copyright

Copyright (C) 2024

  • Helmholtz Centre for Environmental Research GmbH - UFZ, Germany
  • CSC - IT Center for Science Ltd., Finland

Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"). You may not use this work except in compliance with the Licence.

You may obtain a copy of the Licence at: https://joinup.ec.europa.eu/software/page/eupl

Funding

This project has received funding from the European Union's Horizon Europe Research and Innovation Programme under grant agreement No 101057437 (BioDT project, https://doi.org/10.3030/101057437). The authors acknowledge the EuroHPC Joint Undertaking and CSC - IT Center for Science Ltd., Finland for awarding this project access to the EuroHPC supercomputer LUMI, hosted by CSC - IT Center for Science Ltd., Finland and the LUMI consortium through a EuroHPC Development Access call.

Data source

ERA5-Land hourly data from 1950 to present:

About

Building block for obtaining selected weather data at given location (0.1° x 0.1° spatial resolution) for desired time periods, at hourly resolution, e.g. from Copernicus ERA5-Land dataset

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages