environmentaltools.download.ERA5DataDownloader

class environmentaltools.download.ERA5DataDownloader(config: ERA5DataDownloadConfig)[source]

Main class for downloading ERA5 data from CDS.

This class handles the complete download workflow from any ERA5 dataset (marine, atmospheric, land variables, etc.) with robust error handling and progress tracking.

config

Configuration object.

Type:

ERA5DataDownloadConfig

client

CDS API client for downloads.

Type:

cdsapi.Client

Example

>>> config = ERA5DataDownloadConfig({'start_year': 2018, ...})
>>> downloader = ERA5DataDownloader(config)
>>> results = downloader.download_all_years()
>>> print(f"Downloaded {sum(results.values())} years")
__init__(config: ERA5DataDownloadConfig)[source]

Initialize the downloader with configuration.

Parameters:

config (ERA5DataDownloadConfig) – Configuration object.

Raises:

ConnectionError – If CDS API client cannot be initialized.

Methods

__init__(config)

Initialize the downloader with configuration.

create_download_request(year)

Create CDS API request dictionary for a specific year.

download_all_years()

Download wave data for all configured years.

download_year_data(year[, attempt])

Download wave data for a specific year with retry logic.

generate_output_filename(year)

Generate output filename for a specific year.

generate_year_list()

Generate list of years to download based on configuration.

validate_downloaded_files()

Validate all downloaded NetCDF files.