A repository for the CERRA benchmarking study to demonstrate how to download datasets from BrightHub and the workflow to perform a long term correlation for reanalysis datasets with site data. This repo contains example code, data references, and a workflow to compare perform long term correlation using the brightwind library methodology.
Clone this repository:
git clone https://github.com/brightwindanalysis/cerra-benchmarking.git
cd cerra-benchmarking- Demonstrating the CERRA benchmarking workflow with reanalysis and site data.
- Comparing three reanalysis datasets:
CERRA,ERA5, andMERRA-2. - Computing correlations between each reanalysis dataset and site measurements.
- Using the methodology described in the
brightwindlibrary notes for reanalysis benchmarking and correlation analysis.
data/CERRA/- CERRA reanalysis dataset files downloaded and saved here as pkl filesdata/ERA5/- ERA5 reanalysis dataset files downloaded and saved here as pkl filesdata/MERRA-2/- MERRA-2 reanalysis dataset files downloaded and saved here as pkl filesdata/SiteData/- cleaned measured datasets saved here as csv filesnotebooks/analysis_notebook.ipynb- example analysis notebookoutputs/- results and output files from the demonstrated workflow
Full installation guidance, including a Windows step-by-step guide, is in the official brightwind docs.
python -m venv .venvOn Windows:
.\.venv\Scripts\Activate.ps1On macOS/Linux:
source .venv/bin/activateInstall brightwind and required packages:
pip install --upgrade pip
pip install brightwind notebookIf you prefer JupyterLab, install it instead of or in addition to notebook:
pip install jupyterlabFrom the repo root:
pip install -e .This makes cerra_benchmarking importable from notebooks and scripts without manual sys.path changes.
conda create -n cerra-benchmarking python=3.11 -y
conda activate cerra-benchmarking
pip install --upgrade pip
pip install brightwind notebook
pip install -e .Downloading reanalysis and site data in this workflow requires a free BrightHub account. BrightHub is the data platform used by Brightwind; the brightwind library accesses it directly via the BrightHub API.
Sign up for a free account at brighthub.io using either:
- Email and password — enter your email, set a password, and verify via the confirmation link sent to your inbox
- Microsoft SSO — sign in with your work Microsoft account
Free accounts give access to all reanalysis datasets and open-source datasets on BrightHub.
Once you have an account, follow the BrightHub Python user guide — Accessing data via the BrightHub API for instructions on authenticating with your credentials within the brightwind library.
Note: Keep your BrightHub credentials out of version control. Do not hardcode usernames or passwords in notebooks or scripts — use environment variables or a local config file that is listed in
.gitignore.
Use the provided notebook notebooks/analysis_notebook.ipynb to:
- Download reanalysis data from ERA5, MERRA-2 and CERRA using the
brightwindlibrary. - Download an example open access mast dataset
- Apply cleaning, calibrations and adjustments to the mast data.
- Compute correlations for each reanalysis dataset versus the site observations.
- Compare results across the three datasets.
Following the brightwind library methodology as described in the official brightwind notes:
- compute correlation metrics for each dataset pair
- compare the three reanalysis results to evaluate relative performance
This repo is designed to work with that methodology by providing the example data structure and analysis template.