bluemath_tk.downloaders.ecmwf package
Submodules
bluemath_tk.downloaders.ecmwf.ecmwf_downloader module
- class bluemath_tk.downloaders.ecmwf.ecmwf_downloader.ECMWFDownloader(product: str, base_path_to_download: str, model: str = 'ifs', resolution: str = '0p25', debug: bool = True)[source]
Bases:
BaseDownloaderThis is the main class to download data from the ECMWF.
Examples
>>> downloader = ECMWFDownloader( ... product="OpenData", ... base_path_to_download="./ecmwf_data", ... model="ifs", ... resolution="0p25" ... ) >>> result = downloader.download_data( ... dataset="forecast_data", ... param=["msl"], ... step=[0, 240], ... type="fc", ... force=False, ... dry_run=False ... )
- property client: Client
ECMWF OpenData client (initialized with model and resolution).
- Returns:
ECMWF OpenData client instance.
- Return type:
Client
- download_data(dry_run: bool = True, *args, **kwargs) DownloadResult[source]
Download data for the product.
Routes to product-specific download methods based on the product type.
- Parameters:
dry_run (bool, optional) – If True, only check what would be downloaded without actually downloading. Default is True.
*args – Arguments passed to product-specific download method.
**kwargs – Keyword arguments passed to product-specific download method.
- Returns:
Result with information about downloaded, skipped, and error files.
- Return type:
- Raises:
ValueError – If the product is not supported.
- download_data_open_data(dataset: str, force: bool = False, dry_run: bool = True, **kwargs) DownloadResult[source]
Download data for the OpenData product.
Downloads files based on the specified parameters. Files are saved to: base_path_to_download/product/dataset/model/resolution/filename.grib2
- Parameters:
dataset (str) – The dataset to download (e.g., “forecast_data”). Use list_datasets() to see available datasets.
force (bool, optional) – Force re-download even if file exists. Default is False.
dry_run (bool, optional) – If True, only check what would be downloaded. Default is True.
**kwargs – Keyword arguments passed to the ECMWF client retrieve method (e.g., param, step, type).
- Returns:
Result with all downloaded files and download statistics.
- Return type:
- Raises:
ValueError – If dataset is not found.
- property product_config: dict
Product configuration dictionary loaded from config file.
- Returns:
Product configuration dictionary.
- Return type:
dict
- products_configs = {'OpenData': {'datasets': {'forecast_data': {'description': 'ECMWF OpenData Forecast Data', 'models': ['ifs', 'aifs'], 'resolutions': ['0p25'], 'url': 'https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS'}}}}