Skip to main content

A tool to convert ERA5/ECMWF data to EnergyPlus Weather (EPW) format

Project description

tests PyPI PyPI - Downloads

ERA5 to EPW Converter

A tool that fetches ERA5 data and generates a full year AMY (Actual Meteorological Year) EnergyPlus Weather file (EPW).

The tool takes care of fetching the necessary data from the Copernicus Climate Data Store (CDS) and the Copernicus Atmosphere Data Store (CAMS), processing it, and formatting it into the EPW format. It's designed for fast and efficient data retrieval.

Installation

Prerequisites

Make sure to register for an API key and validate licences at:

Then create the file ~/.cdsapirc with the following content:

url: https://cds.climate.copernicus.eu/api/v2
key: <your_api_key>

Note: the URL will be dynamically managed by the script depending on the data source. The API key doesn't vary, it's the same for both ERA5 and CAMS data.

Moreover, before proceeding, it is required to accept all the licenses in the section "Your profile" in the website of Copernicus.

Install the package

From PyPI

pip install era5epw

From source

Clone the current repository and install the required dependencies using Poetry:

git clone https://github.com/airboxlab/era5epw.git
poetry install

Usage

Command line interface

Example usage:

# using poetry, execute in local repository
poetry run era5epw_download --year 2024 --latitude 49.4 --longitude 0.1 --city-name "Le Havre" --elevation 0 --time-zone 1

# using installed binary, after pypi package installation
era5epw_download --year 2024 --latitude 49.4 --longitude 0.1 --city-name "Le Havre" --elevation 0 --time-zone 1

By default, the time-zone argument is used only to populate the LOCATION header and data time is UTC. Use --apply-time-zone-to-data to apply it to the date and time fields (this will shift the UTC time by the provided time zone offset).

Use --help to have a list of available options.

Python API

Example usage:

from era5epw.main import download_and_make_epw

download_and_make_epw(
    year=2025,
    latitude=48.8,
    longitude=2.4,
    city_name="Paris",
    time_zone=1,
    elevation=0,
    output_file="/tmp/era5epw_paris_2025.epw",
    apply_time_zone_to_data=True,
)

When running in a Jupyter notebook, to make progress bars and interactive widgets work, make sure to install ipywidgets and to enable the widgets extension:

pip install ipywidgets
# optional, not needed with Jupyter Notebook 7+
jupyter nbextension enable --py widgetsnbextension

nb_ex

Documentation

ERA5
CAMS
EPW format
Earthkit

Datasets home pages:

View your API requests and download responses at:

CDS Requests
ADS Requests

Check CDS API status at CDS Live, it provides information about congestion for each dataset.

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

era5epw-0.5.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

era5epw-0.5.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file era5epw-0.5.0.tar.gz.

File metadata

  • Download URL: era5epw-0.5.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-100-generic

File hashes

Hashes for era5epw-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6bef9efb782a93abf8faa31bd4a0b87578e1815bea335184cb35493a6ace73bd
MD5 633c21319296c462f19d37bc0c16e733
BLAKE2b-256 ff6d1e49b508a1d710d00c69ac756f35c4133235b60efeffcdb792df584c66dc

See more details on using hashes here.

File details

Details for the file era5epw-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: era5epw-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-100-generic

File hashes

Hashes for era5epw-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83c9848087831defc6ac2fe3529354f5bf0bcb550dab041d9587c0646d23390b
MD5 30fecee663f4201b17e61c29858f8d4d
BLAKE2b-256 2a0e31c30b8993c9088f95ed5db6d71da8db9bfdd1ff1e934c0a713ac6594471

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