FM2PROF
What is FM2PROF?
FM2PROF (FlowFM to Profile) is a Python package that extracts 1D cross-sectional data from 2D hydrodynamic model results. It bridges the gap between detailed 2D flood modelling and efficient 1D hydraulic analysis by automatically generating cross-section geometries and roughness parameters from 2D FlowFM simulation outputs.
How It Works
- Input: 2D FlowFM map files (NetCDF) + cross-section location definitions
- Processing: Spatial classification, geometry extraction, roughness calculation
- Output: 1D model files compatible with 1D hydraulic software (currently supported: D-Flow 1D, SOBEK 3)
2D FlowFM Results → FM2PROF → 1D Cross-Sections
(detailed mesh) (extraction) (efficient profiles)
Quick Start
Installation
pip install fm2prof
Basic Usage
Python API:
from fm2prof import Project
# Load configuration and run
project = Project('config.ini')
project.run()
# Or configure programmatically
project = Project()
project.set_input_file('2DMapOutput', 'model_map.nc')
project.set_input_file('CrossSectionLocationFile', 'crosssections.csv')
project.set_output_directory('./output')
project.run()
Command Line:
# Create new project
python fm2prof create MyProject
# Edit MyProject.ini with your file paths, then run
python fm2prof run MyProject --overwrite
Required Input Files
| File Type | Description | Format |
|---|---|---|
| 2D Map Output | 2D simulation results | NetCDF (.nc) |
| Cross-Section Locations | Where to extract profiles | CSV/TXT with X,Y,Branch,Chainage |
Optional:
- Region Polygons: Define floodplain vs main channel areas (GeoJSON)
- Section Polygons: Specify extraction boundaries (GeoJSON)
Example Output
FM2PROF generates:
- Cross-section geometries (bed levels, widths, areas)
- Roughness tables (Manning's n values per sub-section)
- Visualisation plots for quality checking
Documentation & Examples
- 📚 Full Documentation: deltares.github.io/Fm2Prof
- 🚀 Tutorial: Getting Started Guide
- 📓 Jupyter Notebooks: Interactive examples in
/notebooks - 🔧 Configuration Reference: Complete parameter documentation
Key Features
🌊 Using Geometric and Hydraulic Information
- Volume-preserving 1D geometry
- Roughness weighting methods (area-based, distance-based)
- Flow-dependent storage areas
- Transition height calculations for overbank flow
⚡ Performant
- Leverages MeshKernel for fast polygon operations
- Efficient NetCDF data handling
- K-Nearest Neighbour for rapid classification
🔧 Flexible Configuration
- INI-based configuration files
- Python API for programmatic control
📊 Multiple Output Formats
- D-Flow 1D compatible files
- SOBEK 3 format support
- Generic CSV/JSON outputs
- Visualisation and diagnostic plots
Use Cases
Typical Workflow
- Run 2D FlowFM Model: Generate detailed flood simulation
- Define Cross-Sections: Specify where 1D profiles are needed
- Configure FM2PROF: Set extraction parameters and output options
- Extract Profiles: Run FM2PROF to generate cross-sectional data
- Build 1D Model: Import results into 1D hydraulic software
- Validate: Compare 1D vs 2D results for key locations
Real-World Applications
- Dutch National Flood Forecasting River Models: all river models are using
fm2profgenerated profiles and roughnesses - Maeslant barrier forecasting model: the hydraulic forecasting of the Maeslant Barrier uses
fm2profgenerated geometry and roughnesses
Requirements
- Python: 3.10 or higher
- Key Dependencies: NumPy, Pandas, NetCDF4, Shapely, MeshKernel
- Supported 2D software: D-FlowFM, D-Hydro
- Supported 1D Software: D-Flow 1D, SOBEK 3
Contributing
We welcome contributions! See our Contributing Guide for:
- 🐛 Bug reports and feature requests
- 💻 Code contributions and pull requests
- 📖 Documentation improvements
- 🧪 Test case submissions
Support & Community
- Issues: GitHub Issues
- Contact: FM2PROF development team at Deltares
- License: GPL-3.0-or-later AND LGPL-3.0-or-later
Citation
If you use FM2PROF in research, please cite:
FM2PROF Development Team (2024). FM2PROF: FlowFM to Profile Extraction Tool.
Deltares. https://github.com/Deltares/Fm2Prof
Metadata
Release files for fm2prof 2.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fm2prof-2.5.1.tar.gz | 51.4 MB | Without provenance | Details for fm2prof-2.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fm2prof-2.5.1-py3-none-any.whl | Python 3 | none | any | Details for fm2prof-2.5.1-py3-none-any.whl |
Total release size: 51.5 MB
Release files / fm2prof-2.5.1.tar.gz
| Download URL | fm2prof-2.5.1.tar.gz |
|---|---|
| Size | 51.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a281e7ab62b08300dedd523befc8420cc3dc7a4d0934ff0cf8bc349527bef72
|
|
BLAKE2b-256 checksum How to use checksums |
2424c506c00e406999ecc7c3053c1aaa847193e0355f0d6dbe3f4a50ade48e04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Release files / fm2prof-2.5.1-py3-none-any.whl
| Download URL | fm2prof-2.5.1-py3-none-any.whl |
|---|---|
| Size | 98.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df6526a8e94e2cd15ab6c41823ad5d2b3bbe9ac3a5213c57e11a369570c57822
|
|
BLAKE2b-256 checksum How to use checksums |
07af717f5a04f621c5216b0757d67cced899e482f32d39bad22dd2908ace8538
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Security for fm2prof 2.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.