Weather Data Retrieval¶
Welcome! The weather_data_retrieval package makes it easy to download weather and climate reanalysis data for your marginal emissions modeling projects.
What Does This Package Do?¶
This package helps you retrieve large-scale weather datasets from public sources with minimal hassle. Whether you need a few months of data for a pilot study or years of global coverage for production models, we've got you covered.
Currently supported: - ERA5 (global reanalysis, 0.25° resolution, hourly) - ERA5-Land (land-focused, 0.1° resolution, hourly)
Both are accessed via the Copernicus Climate Data Store (CDS) API.
Expansion Coming Soon
Open-Meteo and additional providers are on the roadmap! See the project roadmap for details.
Key Features¶
✨ Two ways to work: Interactive wizard for exploration, or JSON configs for reproducible pipelines
📦 Smart downloads: Automatically chunks data by month, handles retries, and skips files you already have
⚡ Parallel downloads: Speed up large requests with concurrent downloads
📝 Production-ready logging: Every download is logged with timestamps, configurations, and any issues
🔧 HPC-friendly: Includes batch scripts and settings optimized for high-performance computing environments
Quick Example¶
Interactive Mode¶
# Just run the command and follow the prompts
osme-weather
Batch Mode¶
# Use a configuration file for reproducible downloads
osme-weather --config my_download.json
What You'll Need¶
- Python 3.11+ (we recommend using conda or mamba)
- A CDS account (free registration at https://cds.climate.copernicus.eu)
- Your CDS API key (found in your CDS profile after registration)
- Disk space (varies by region and date range; the tool estimates this for you)
Installation¶
The weather data retrieval package is part of the open-source-marginal-emissions monorepo.
From the repository root:
# Install in development mode
pip install -e packages/weather_data_retrieval
# Or install the full project with all packages
pip install -e .
This makes the osme-weather and wdr commands available in your terminal.
Next Steps¶
- New to this package? Start with the Quickstart Guide for a step-by-step first download
- Ready to automate? Check out the User Guide for batch configurations
- Need specific config details? See the Configuration Reference
- Running into issues? Visit Troubleshooting for common problems and solutions
- Want to understand the code? Browse the API Reference
How This Fits Into Your Workflow¶
The weather data retrieval package is the first step in the OSME pipeline:
- weather_data_retrieval ← You are here – Download raw weather data
- grid_data_retrieval – Download electricity grid data
- data_cleaning_and_joining – Align and integrate datasets
- marginal_emissions_modelling – Build your MEF models
The data you download here gets saved to data/<dataset_short_name>/raw/ and is ready for the next steps in your analysis.
Getting Help¶
- Check the Troubleshooting page for common issues
- Review the examples in the User Guide
- Open an issue on GitHub
- Read the detailed API documentation for advanced usage
Let's get started! Head to the Quickstart Guide →