RainFARM is a stochastic downscaling method for precipitation fields.
This repository provides a Python-based application and utilities to prepare environments and run workflows around the RainFARM algorithm.
License: EUPL-1.2 (see
LICENSE.md).
RainFARM (Rainfall Filtered Autoregressive Model) downscales coarse precipitation fields by extrapolating their Fourier power spectrum to smaller scales and adding stochastic small-scale variability, followed by a nonlinear transformation to obtain realistic rainfall fields.
The method is widely used in hydrological and climate modeling for generating high-resolution rainfall fields consistent with large-scale forcings.
rfarm/— Python package sourceapps/— Application drivers and workflow wrappersbin/— Helper scripts and CLI utilitiestools/— Additional utilities or configuration tools- Documentation:
README.md,AUTHORS.md,CHANGELOG.md,CODEOWNERS,LICENSE.md
- Linux (Debian/Ubuntu recommended)
- Python 3.x
- Standard scientific Python stack (NumPy, SciPy, etc.)
- Optional: NetCDF utilities, QGIS, R, or other hydrometeorological tools for extended use
This repository includes a setup script for automatic environment configuration:
# from the repository root
bash setup_rfarm_system_conda_python.shThis script creates a Conda-based Python environment and installs the dependencies required by the rfarm application.
After setup, activate the environment as instructed in the script output.
Once your environment is active, install the package in editable mode:
pip install -e .This allows you to modify and test the code without reinstalling after each change.
If you use RainFARM in scientific work, please cite the original publications describing the algorithm and its applications in hydrometeorological modeling and climate downscaling.
Contributions are welcome! Please:
- Fork this repository and create a new branch
- Follow existing code style and documentation conventions
- Submit a Pull Request with a clear description of your change
See also:
- RainFARM GitHub Repository
- Related projects by CIMA Research Foundation
- Method overview and community examples (e.g., pysteps RainFARM implementation and publications on stochastic downscaling)
This project is licensed under the European Union Public License 1.2 (EUPL-1.2).
See LICENSE.md for full terms.
- This README intentionally avoids detailed code examples (as requested).
- You can extract concise usage snippets directly from the included
.shscripts if you wish to document them later.