Technical Overview
This page describes the technical structure of CPFA, including the main components and overall workflow.
High-Level Architecture
CPFA (Climate Prediction For All) implements a four-stage workflow:
Data collection
Future climate prediction (Pangu-Weather ONNX model)
Visualization of prediction results
Model performance evaluation (comparison with ERA5)
Core Components
The repository is organized around the following elements:
ONNX model files
pangu_weather_1.onnxpangu_weather_3.onnxpangu_weather_6.onnxpangu_weather_24.onnx
Data folders
download_data: raw downloaded ERA5 datainput_data: prepared input arrays (e.g.input_surface.npy)output_data: prediction and evaluation outputs
Python scripts
inference_cpu.py(or equivalent prediction script)inference_iterative.py(optional multi-step prediction)visualization.pyevaluation.py
Data Flow
The typical data flow is as follows:
ERA5 data download
ERA5 reanalysis data is downloaded from the Copernicus Climate Data Store and placed in
download_data.Input preparation
The ERA5 data is preprocessed into an
input_surface.npyfile, stored ininput_datawith the required shape and variable order.Model inference
The prediction script loads
input_surface.npyand one of the Pangu-Weather ONNX models, runs inference, and writes outputs tooutput_data.Visualization
The visualization script reads prediction outputs and generates plots for analysis.
Evaluation
The evaluation script compares CPFA predictions with ERA5 reference data and computes metrics.
Technology Stack
CPFA uses the following main technologies:
Python 3.9.2
NumPy, pandas, xarray for data handling
matplotlib, cartopy for visualization
ONNX and ONNX Runtime for Pangu-Weather model inference
Anaconda for environment management on Windows
Design Characteristics
Focused on clarity and reproducibility rather than performance tuning
Designed for Windows-based classroom and self-study environments
Emphasizes a linear, script-based workflow that is easy to follow for users new to climate prediction models