Welcome to pyfwg’s documentation! (Version 0.4.0)
pyfwg is a robust Python workflow manager for the Future Weather Generator command-line tools.
This documentation provides detailed information on the library’s three main interfaces, designed to cater to different levels of complexity:
High-Level Functions (
morph_epw_global,morph_epw_europe,morph_epw_cordex): For simple, one-shot morphing tasks where you need direct control over the tool’s parameters without complex file renaming.Advanced Workflow Classes (
MorphingWorkflowGlobal,MorphingWorkflowEurope,MorphingWorkflowCordex): For complex projects requiring custom file renaming based on filename parsing, and full, step-by-step control over the validation and execution process.Parametric Iterator (
MorphingIterator): The most powerful feature, designed for automating large batches of morphing workflows defined in a Pandas DataFrame or an Excel file, making parametric analysis simple and structured.
What’s New in Version 0.4.0?
Version 0.4.0 adds support for the FWG Engine, the shared engine of the latest Future Weather Generator distributions: Global v5.x, Europe v3.x and the new CORDEX regional distributions. Supported binaries are Global 5.2.0, Europe EUR-11 3.2.0 and the eight other regional distributions 1.2.0. Older Global/Europe releases are outside the supported scope; see Supported distributions, interfaces and Excel.
Global v5.x and Europe v3.x: Use them with the same classes and functions as before. pyfwg detects the version from the JAR and builds the new command line for you.
CORDEX Regional Distributions:
MorphingWorkflowCordexandmorph_epw_cordexaccept all nine CORDEX-CMIP5 domains, including Europe EUR-11 v3+. The installed manifest determines the models, scenarios, periods and grid topology. See CORDEX regional distributions and the regional notebook.New FWG Engine Options: Select scenarios and future periods (
fwg_scenarios,fwg_timeframes), solar decomposition, illuminance and infrared models, uncertainty cases (fwg_uncertainty_variant), output profile and a shared climate-data cache (fwg_model_unzipped_folder). Any other option of the tool can be passed withfwg_extra_args.JAR Inspection:
get_fwg_distribution_inforeads the scenarios, periods and climate models packaged in FWG Engine JARs, which pyfwg also uses to validate your configuration.Urban Heat Island: The supported FWG Engine distributions do not implement UHI or LCZ morphing.
Requirements
Before using pyfwg, you need to have the following installed and configured:
Python 3.9+
Java: The
javacommand must be accessible from your system’s terminal (i.e., it must be in your system’s PATH). FWG Engine distributions require Java 17+; the regional generation checks below used Java 25.- Future Weather Generator: You must download the appropriate
.jarfile from the official website. The FWG Engine distributions have been tested with Global v5.2.0, Europe EUR-11 v3.2.0 and the eight other CORDEX-CMIP5 regional distributions v1.2.0, using FWG Engine v1.1.0. On 2026-10-28, all nine regional JARs passed real generation with a single model and the full eligible ensemble, for one scenario and the 2050 period per region. See CORDEX regional distributions for the validation matrix and limits of that coverage.
- Future Weather Generator: You must download the appropriate
Choose a tutorial
Start with the Simple tutorials for explicit paths, parameters and direct calls. The simple regional example shows a complete CORDEX run and its climate-comparison plots. Continue with the Advanced tutorials for catalog inspection, configuration helpers, validation and more extensive workflow and iterator examples.
Both versions of every tutorial include saved execution outputs, tables and embedded climate-comparison plots. Read the Docs renders these outputs without running Java. Simple tutorials appear first in the navigation, followed by the advanced notebooks in their own section.
The advanced notebooks generate weather when FWG_RUN_MORPHING=1 or
RUN_MORPHING=True. The simple notebooks run generation directly when
their cells are executed. Viewing the published pages does not execute either
version. Download a notebook from its page, or copy the tutorials from an
installed package:
from pyfwg import copy_tutorials
copy_tutorials("./pyfwg_tutorials")
Install the plotting and notebook dependencies with pip install pyfwg[tutorials].
See Simple and advanced tutorials for the side-by-side choice of examples.
JARs and public regional EPWs are separate downloads. The regional notebook links to the public samples used in testing and explains the cache and diagnostic folders.
Acknowledgements
This library would not be possible without the foundational work of Eugénio Rodrigues (University of Coimbra), the creator of the Future Weather Generator tool. pyfwg is essentially a Python wrapper designed to automate and streamline the use of his powerful command-line application.
Simple tutorials
Advanced tutorials
- CORDEX-CMIP5: working with all nine regional JARs
- Configuration
- What was verified with the real JARs
- Inspect all installed regional catalogs without starting Java
- Choose a region and its model selection
- Option A: direct API
- Option B: workflow with a filename preview
- Option C: an iterator spanning regions
- Run the regional batch from an Excel workbook
- Baseline sources and validation scope
- Compare the original weather with future climates
- Using
pyfwgfor direct morphing withmorph_epw_global,morph_epw_europeandmorph_epw_cordex - Advanced usage: The
MorphingWorkflowclasses:MorphingWorkflowGlobal,MorphingWorkflowEuropeandMorphingWorkflowCordex - Parametric Analysis with
MorphingIterator
Guides
API reference