Module Overview
The weather package is organised into focused, single-responsibility modules. Each step of the pipeline is a separate file that can be imported and used independently.
File |
Purpose |
Key function(s) |
|---|---|---|
|
Centralised configuration from environment variables ( |
|
|
Fetch |
|
|
Parallel bz2 decompression using |
|
|
Read GRIB with xarray + cfgrib, convert units (K → °C), compute derived fields (GHI, DHI, WS_10M). Chunked via dask (threaded scheduler). |
|
|
Write a compressed NetCDF-4 file with zlib encoding. Sequential per-variable compute to limit memory. |
|
|
End-to-end orchestrator chaining all four steps. Optional cleanup of intermediate files. |
|
|
Load pre-extracted single-point CSV weather files (T, GHI, DNI, DHI). Reconstructs physically-consistent DNI via pvlib DISC decomposition. |
|
|
Standalone CLI entry point ( |
|
|
Package docstring and public API surface. |
Standalone Usage
The weather package does not depend on the rest of BuEM. It can run
on a remote server where only the src/buem/weather/ directory and
src/buem/__init__.py are present:
# Copy to server
scp -r src/buem ssahoo@server:~/buem/src/buem/
# Run directly (no pip install needed — PYTHONPATH only)
export PYTHONPATH=~/buem/src
python -m buem.weather info
python -m buem.weather run --months 1
When installed via pip install -e ., the same functionality is available
through the unified CLI:
buem weather info
buem weather run --months 1