Build Custom Batched Ensemble Weather Forecasting with NVIDIA Earth2Studio
Learn how to install NVIDIA Earth2Studio in Google Colab while preserving your CUDA PyTorch environment, load the FCN prognostic model, and implement custom wind-power diagnostics. The guide walks through building a coordinate-aware Zarr data backend and executing batched ensemble forecasts.

Why it matters
You can now construct your own end-to-end meteorological pipelines and run spatial perturbation ensembles locally with production-grade tooling.
TL;DR
- 01Preserve existing Colab CUDA PyTorch versions using pip constraint files during Earth2Studio installation.
- 02Implement custom diagnostic layers like turbine capacity factors directly into the inference loop.
- 03Use Zarr storage backends with explicit coordinate chunking for efficient ensemble analysis.
Installation and Environment Setup
To use Earth2Studio in Google Colab without breaking the existing CUDA-enabled PyTorch stack, constrain your pip installation using environment configuration files:
import importlib.util, os, subprocess, sys
if importlib.util.find_spec("earth2studio") is None:
cfile = os.path.join(os.getcwd(), "e2s_constraints.txt")
with open(cfile, "w") as f:
import torch as _torch
f.write(f"torch=={_torch.__version__.split('+')[0]}\n")
env = {**os.environ, "PIP_CONSTRAINT": cfile}
subprocess.run(
[sys.executable, "-m", "pip", "install", "-q", "earth2studio[fcn,data,perturbation,statistics]"],
env=env
)Custom Wind Power Diagnostics
Implement custom diagnostic classes that process prognostic outputs directly inside the iteration loop. Below is how you compute turbine capacity factors from 10-meter wind components using power-law shear:
class WindPowerCF:
def __init__(self, lat, lon, hub=100.0, alpha=0.143, cut_in=3.0, rated=12.0, cut_out=25.0):
self.lat, self.lon, self.hub, self.alpha = lat, lon, hub, alpha
self.cut_in, self.rated, self.cut_out = cut_in, rated, cut_out
def __call__(self, x: torch.Tensor, coords: CoordSystem):
u, v = x[..., 0:1, :, :], x[..., 1:2, :, :]
ws10 = torch.sqrt(u**2 + v**2)
ws = ws10 * (self.hub / 10.0) ** self.alpha
ramp = (ws**3 - self.cut_in**3) / (self.rated**3 - self.cut_in**3)
cf = torch.where((ws >= self.cut_in) & (ws < self.rated), ramp.clamp(0, 1), torch.zeros_like(ws))
cf = torch.where((ws >= self.rated) & (ws <= self.cut_out), torch.ones_like(cf), cf)
return cf, OrderedDict([("variable", np.array(["wind_cf"])), ("lat", self.lat), ("lon", self.lon)])Ensemble Execution Pipeline
Chain data fetching, model iteration, and Zarr backend storage to run batched forecasts cleanly.
Try it in 2 minutes
import importlib.util, os, subprocess, sys
if importlib.util.find_spec("earth2studio") is None:
cfile = os.path.join(os.getcwd(), "e2s_constraints.txt")
with open(cfile, "w") as f:
import torch as _torch
f.write(f"torch=={_torch.__version__.split('+')[0]}\n")
env = {**os.environ, "PIP_CONSTRAINT": cfile}
subprocess.run([sys.executable, "-m", "pip", "install", "-q", "earth2studio[fcn,data,perturbation,statistics]"], env=env)python
✓ When to use
- When building meteorological ensemble forecasting pipelines with ML models.
- When you need custom diagnostic layers integrated into atmospheric data flows.
What to do today
- Run the installation script in a Google Colab T4 GPU runtime session.
- Configure custom wind power diagnostics and variable perturbations for your model workflow.
- Write your forecast outputs into a Zarr data store and verify against GFS analyses.
Sources