Skip to main content

Compare results from MIKE simulations with observations.

Project description

FMskill: Compare MIKE FM results with observations.

Python version Python package PyPI version

FMskill is a python package for scoring MIKE FM models.

Read more about the vision and scope. Contribute with new ideas in the discussion, report an issue or browse the API documentation. Access observational data (e.g. altimetry data) from the sister library WatObs.

Use cases

FMskill would like to be your companion during the different phases of a MIKE FM modelling workflow.

  • Model setup - exploratory phase
  • Model calibration
  • Model validation and reporting - communicate your final results

Installation

From pypi:

> pip install fmskill

Or the development version:

> pip install https://github.com/DHI/fmskill/archive/main.zip

Example notebooks

Workflow

  1. Define ModelResults
  2. Define Observations
  3. Connect Observations and ModelResults
  4. Extract ModelResults at Observation positions
  5. Do plotting, statistics, reporting using a Comparer

Read more about the workflow in the getting started guide.

Example of use

Start by defining model results and observations:

>>> from fmskill.model import ModelResult
>>> from fmskill.observation import PointObservation, TrackObservation
>>> mr = ModelResult("HKZN_local_2017_DutchCoast.dfsu", name="HKZN_local", item=0)
>>> HKNA = PointObservation("HKNA_Hm0.dfs0", item=0, x=4.2420, y=52.6887, name="HKNA")
>>> EPL = PointObservation("eur_Hm0.dfs0", item=0, x=3.2760, y=51.9990, name="EPL")
>>> c2 = TrackObservation("Alti_c2_Dutch.dfs0", item=3, name="c2")

Then, connect observations and model results, and extract data at observation points:

>>> from fmskill import Connector
>>> con = Connector([HKNA, EPL, c2], mr)
>>> comparer = con.extract()

With the comparer, all sorts of skill assessments and plots can be made:

>>> comparer.skill().round(2)
               n  bias  rmse  urmse   mae    cc    si    r2
observation                                                
HKNA         385 -0.20  0.35   0.29  0.25  0.97  0.09  0.99
EPL           66 -0.08  0.22   0.20  0.18  0.97  0.07  0.99
c2           113 -0.00  0.35   0.35  0.29  0.97  0.12  0.99

Overview of observation locations

con.plot_observation_positions(figsize=(7,7))

map

Scatter plot

comparer.scatter()

scatter

Timeseries plot

Timeseries plots can either be static and report-friendly (matplotlib) or interactive with zoom functionality (plotly).

comparer["HKNA"].plot_timeseries(width=1000, backend="plotly")

timeseries

Automated reporting

With a few lines of code, it will be possible to generate an automated report.

from fmskill.report import Reporter

rep = Reporter(mr)
rep.to_markdown()

Very basic first example report

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

fmskill-0.8.0.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

fmskill-0.8.0-py3-none-any.whl (94.7 kB view details)

Uploaded Python 3

File details

Details for the file fmskill-0.8.0.tar.gz.

File metadata

  • Download URL: fmskill-0.8.0.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for fmskill-0.8.0.tar.gz
Algorithm Hash digest
SHA256 1c6b558f106269812b93944d717b7451979c7825773a272f2396f99d2b7880c2
MD5 52f2628de36253372736f86eb8e33cb7
BLAKE2b-256 27a44e6f2455f0acda7a69cd6607e11622360ed60b4c4b005ed26fcab8c15bfb

See more details on using hashes here.

File details

Details for the file fmskill-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: fmskill-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 94.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for fmskill-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65e6b3eed423a67d8301031e4a254f6f5f06f436757cbae2b35ccc1b04fbec45
MD5 8d717eeffe0f7d188275cf6f1fb4897f
BLAKE2b-256 06a760c097f81edfa1ba2cada181ac67f2e108b2cf211ff670f308aea2e6a9ce

See more details on using hashes here.

Supported by

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