Skip to main content

Compare results from simulations with observations.

Project description

ModelSkill: Flexible Model skill evaluation.

Python version Python package PyPI version

ModelSkill is a python package for scoring MIKE models (other models can be evaluated as well).

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

Use cases

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

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

Installation

From pypi:

> pip install modelskill

Or the development version:

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

Example notebooks

Workflow

  1. Define ModelResults
  2. Define Observations
  3. Compare Observations and ModelResults
  4. Do plotting, statistics, reporting using the Comparer

Read more about the workflow in the getting started guide.

Example of use

Start by defining model results and observations:

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

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

>>> cc = ms.match([HKNA, EPL, c2], mr)

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

>>> cc.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

ms.plotting.spatial_overview([HKNA, EPL, c2], mr, figsize=(7,7))

map

Scatter plot

cc.plot.scatter()

scatter

Timeseries plot

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

cc["HKNA"].plot.timeseries(width=1000, backend="plotly")

timeseries

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

modelskill-1.0b0.tar.gz (601.8 kB view details)

Uploaded Source

Built Distribution

modelskill-1.0b0-py3-none-any.whl (114.6 kB view details)

Uploaded Python 3

File details

Details for the file modelskill-1.0b0.tar.gz.

File metadata

  • Download URL: modelskill-1.0b0.tar.gz
  • Upload date:
  • Size: 601.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for modelskill-1.0b0.tar.gz
Algorithm Hash digest
SHA256 599eaed6452c2c725c08c77623368947b5fce8135714cdd98547057486233d15
MD5 30e21351ae5570d1eacc5e0eaa2af7b4
BLAKE2b-256 83c795e6d9e765e24f95987eb1e173d0089ef8e0f2e51b742d0f6a94a7db0440

See more details on using hashes here.

File details

Details for the file modelskill-1.0b0-py3-none-any.whl.

File metadata

  • Download URL: modelskill-1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 114.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for modelskill-1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac5091a0fb306ea99e62a5c0c70f4c30d75000fc0b0f402f8b515d9ba2a1feaa
MD5 9f5dc0a1223251e649698c6a74227ae8
BLAKE2b-256 674a276b82d5686b54df7c6b5b3f74a2a1d426cca369f765968625edb4be7272

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