Downloader and data management tools for climate and ocean datasets.
Project description
H2MARE - Geospatial Processing for Climate and Ocean Data
A Python pipeline for downloading and preprocessing multi-source oceanographic and atmospheric data into analysis-ready formats. H2MARE streamlines the acquisition and harmonization of data from major climate and ocean observation services, optimized for large-scale spatiotemporal analysis.
Features
- Multi-source data integration: Download and process data from CMEMS, AVISO, and ERA5.
- Format conversion: Automated conversion from NetCDF/GRIB to optimized Zarr and Parquet formats.
- Data compilation: Regrid and interpolate multi-resolution datasets to a common grid.
- Point and geometry extraction: Extract time series for specific locations or spatial features.
Data Sources
H2MARE supports the following data providers. API keys and authentication are required for each.
- CMEMS — Copernicus Marine Service: satellite and in-situ ocean observations
- AVISO — Archiving, Validation and Interpretation of Satellite Oceanographic data
- CDS-ERA5 — ERA5 hourly atmospheric reanalysis (1940–present)
Refer to each provider's documentation for authentication setup before use.
Installation
Prerequisites
- Python >= 3.11
- uv — fast Python package and project manager
Install from PyPI
pip install h2mare
# or
uv add h2mare
Install from source
git clone https://github.com/h2ugoparra/h2mare.git
cd h2mare
uv sync
Configuration
H2MARE requires two configuration files in your working directory before first use.
1. config.yaml
Defines variables, dataset IDs, bounding boxes, and processing parameters. Copy the template from the repository as a starting point and edit it to match your needs.
2. .env
# Path to external or large-capacity storage for processed Zarr files
STORE_ROOT=/path/to/your/storage
# AVISO credentials (required for FSLE, Eddies)
AVISO_USERNAME=your_username
AVISO_PASSWORD=your_password
AVISO_FTP_SERVER=ftp-access.aviso.altimetry.fr
CMEMS credentials are configured via the copernicusmarine client. ERA5 / CDS credentials are configured via the cdsapi client. See the CDS documentation for setup.
Note: Both files must be present in the directory where you run
h2mare. You can also set theH2MARE_ROOTenvironment variable to point to a different directory containing them.
Quick Start
# Download and process a single variable for a specific date range
uv run h2mare run -v sst --start-date 2021-01-01 --end-date 2021-12-31
# Multiple variables at once
uv run h2mare run -v seapodym -v mld -v o2 -v chl
# Infer missing dates from the existing store and download what's new
uv run h2mare run -v sst
# Download only (skip Zarr conversion)
uv run h2mare run -v sst --no-convert
# Validate configuration without downloading
uv run h2mare run -v sst --dry-run
# Process all configured variables
uv run h2mare run
Development
# Run the full test suite
uv run pytest tests/
# Run a single test file
uv run pytest tests/test_zarr_catalog.py -v
# Lint and format
uv run ruff check h2mare/
uv run ruff format h2mare/
Built with
| Library | Role |
|---|---|
| xarray | N-dimensional labelled arrays and NetCDF/Zarr I/O |
| zarr | Chunked, compressed array storage |
| dask | Parallel and out-of-core computation |
| polars | Fast DataFrame engine for Parquet I/O |
| duckdb | In-process SQL for Parquet overlap resolution and scanning |
| geopandas | Geometry-based spatial extraction |
| plotly | Interactive time-series and spatial visualizations |
| copernicusmarine | CMEMS dataset access |
| cdsapi | ERA5 / CDS dataset access |
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
This project was developed under the framework of COSTA project. This project relies on data from Copernicus Marine Service, AVISO, Copernicus Climate Data Store, and NOAA NCEI. We gratefully acknowledge these organizations for providing open access to their datasets.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file h2mare-0.1.2.tar.gz.
File metadata
- Download URL: h2mare-0.1.2.tar.gz
- Upload date:
- Size: 120.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef9c87f448a4200cf04ee134ad7921812c573ea18e391f209a83b9b7fda36562
|
|
| MD5 |
761facccd1a9e456db217283366a9688
|
|
| BLAKE2b-256 |
de09c1983682d815b39fe6c05873a62d1cb01b0636a24a4c99fd79e278dd81f5
|
File details
Details for the file h2mare-0.1.2-py3-none-any.whl.
File metadata
- Download URL: h2mare-0.1.2-py3-none-any.whl
- Upload date:
- Size: 116.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ddcb2ef4dddaf58f47201f67498f90d1e639ea5cf2f030d53adbfaf779cb99
|
|
| MD5 |
c5aac14b1d5e8e129438e430825d58fe
|
|
| BLAKE2b-256 |
705b71a6f85b8aa98f6e6d04230e1d461ad93c5223897b9027f4cbaad2149b0f
|