Skip to main content

Work with iMOD MODFLOW models

Project description

Work with iMOD MODFLOW models in Python.


Source code:

Getting started

import imod

# read and write IPF files to pandas DataFrame
df ='wells.ipf')'wells-out.ipf', df)

# get all calculated heads in a xarray DataArray
# with dimensions time, layer, y, x
da ='path/to/results/head_*.idf')


The imod Python package is an addition to iMOD and iMODFLOW, intended to facilitate working with groundwater models from Python. It does this by supporting reading and writing of the different iMOD file formats to existing objects often used in Python data processing.

IDF - iMOD Data Format

IDF is the binary raster format of iMOD. One file contains a X and Y 2 dimensional grid. Using a set of file name conventions more dimensions such as time and layer are added, for example: head_20181113_l3.idf for layer 3 and timestamp 2018-11-13. This package maps IDF files to and from the N dimensional labeled arrays of xarray.DataArray, using and, or, to read multiple parameters at the same time, imod.idf.open_dataset.

For more information on how to work with xarray.DataArray objects, we refer to the xarray documentation. Note that converting GIS raster formats to IDF is supported through xarray.open_rasterio, followed by

IPF - iMOD Point File

IPF files are text files used for storing tabular point data such as timeseries and borehole measurements. In the imod Python package these files are read in as pandas.DataFrame. Pandas is a popular package that makes analysis and processing of tabular data easy, and provides many input and output options, which in turn enables us to convert for instance existing CSV or Excel files to IPF files. The primary functions for reading and writing IPF files are and


This Python package was written primarily by Martijn Visser and Huite Bootsma at Deltares.

Project details

Download files

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

Files for imod, version 0.8.0
Filename, size File type Python version Upload date Hashes
Filename, size imod-0.8.0-py3-none-any.whl (170.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size imod-0.8.0.tar.gz (146.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page