Skip to main content

No project description provided

Project description

FM2PROF

ci Quality Gate Status GitHub release (latest by date) GitHub tag (latest by date) Available on pypi Formatting: ruff

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

  1. Input: 2D FlowFM map files (NetCDF) + cross-section location definitions
  2. Processing: Spatial classification, geometry extraction, roughness calculation
  3. 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

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

  1. Run 2D FlowFM Model: Generate detailed flood simulation
  2. Define Cross-Sections: Specify where 1D profiles are needed
  3. Configure FM2PROF: Set extraction parameters and output options
  4. Extract Profiles: Run FM2PROF to generate cross-sectional data
  5. Build 1D Model: Import results into 1D hydraulic software
  6. Validate: Compare 1D vs 2D results for key locations

Real-World Applications

  • Dutch National Flood Forecasting River Models: all river models are using fm2prof generated profiles and roughnesses
  • Maeslant barrier forecasting model: the hydraulic forecasting of the Maeslant Barrier uses fm2prof generated 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fm2prof-2.4.0.tar.gz (49.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fm2prof-2.4.0-py3-none-any.whl (93.0 kB view details)

Uploaded Python 3

File details

Details for the file fm2prof-2.4.0.tar.gz.

File metadata

  • Download URL: fm2prof-2.4.0.tar.gz
  • Upload date:
  • Size: 49.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for fm2prof-2.4.0.tar.gz
Algorithm Hash digest
SHA256 a0727ea869f77f44622f3b465960c64ccf5918bea7f47097e4f2f372a5e93f81
MD5 a459e5c9faa1ef4c8e2624f472e1ecc8
BLAKE2b-256 078f8129d5b63234ad91795c0ff39748d8d35c3e799fc8b8e3ac63e5ca0fa3fb

See more details on using hashes here.

File details

Details for the file fm2prof-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: fm2prof-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 93.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for fm2prof-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac85a04838c68bb2b4db4969c948c7fb18c40b57b4e0d40d6ef369462a1a244a
MD5 919860c105d3e5c838c3e27db4487234
BLAKE2b-256 f503fbc5bdf89b183f85329b9982654c610d34fba2e1dfdac451cc5c3a1918e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page