Skip to content

CECE Scripts and Utilities

CECE provides several Python scripts to facilitate data management, configuration migration, and visualization of the emission stacking process.

Data Management

download_hemco_data.py

Downloads required emission inventories from the public GEOS-Chem S3 bucket.

python scripts/download_hemco_data.py --config cece_config.yaml --dest data/

verify_hemco_data.py

Validates the integrity of downloaded NetCDF files and ensures all required variables are present.

python scripts/verify_hemco_data.py --config cece_config.yaml --data-dir data/

setup_hemco_examples.sh

Automates the creation of example CECE configuration files and generates download scripts for the associated data.

./scripts/setup_hemco_examples.sh


Configuration Migration

hemco_to_cece.py

Converts legacy HEMCO .rc configuration files to the CECE YAML format. It handles: - Recursive includes (>>>include) - $ROOT token replacement - Mapping scale factors and masks to CECE layers - Parsing grid and diagnostic definitions from auxiliary files

python scripts/hemco_to_cece.py HEMCO_Config.rc -o cece_config.yaml

Visualization

visualize_stack.py

Generates a visual representation (graph) of the emission stacking hierarchy defined in an CECE configuration file. This is useful for verifying that layers, masks, and scale factors are correctly prioritized.

python scripts/visualize_stack.py --config cece_config.yaml --output stacking_plan.png

visualize_optimized_stack.py

Similar to visualize_stack.py, but specifically visualizes the fused kernel plan used by the optimized CECE engine.

python scripts/visualize_optimized_stack.py --config cece_config.yaml --output optimized_plan.png