mikecalsetup

mikecalsetup: an open-source python tool for automatically creating calibration setups of MIKE SHE models in PEST or OSTRICH - Published in JOSS (2023)

https://github.com/tenemark/mikecalsetup

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

calibration mikeshe ostrich pest python
Last synced: 4 months ago · JSON representation

Repository

Tool for automatic setting up calibration files for MIKE SHE models in PEST or OSTRICH

Basic Info
  • Host: GitHub
  • Owner: tenemark
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 28.5 MB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Topics
calibration mikeshe ostrich pest python
Created about 3 years ago · Last pushed 12 months ago
Metadata Files
Readme License Support

README.md

mikecalsetup

Create an initial, ready-to-run calibration setup of a MIKE SHE model in OSTRICH or PEST.

This includes: - Writing template files (*.she, *.mhydro, *.uzs, *.etv) - Writing a forward model bash script - Writing script for calculating model performance - Writing control file for OSTRICH or PEST

mikecalsetup parameterizes the nested header file format (pfs files: https://docs.mikepoweredbydhi.com/corelibraries/pfs/pfs-file-content/) found in the MIKE SHE files she, hydro, uzs and etv. To parameterize the MIKE SHE data file system (dfs) format (https://docs.mikepoweredbydhi.com/corelibraries/dfs/dfs-file-system/), the reader is referred to the PstFrom module of pyEMU (https://github.com/pypest/pyemu). A short example of the combination of mikecalsetup with pyEMU is given in the examples folder.

Installation

The easiest way to install mikecalsetup with all dependencies is to create an environment using the file mike.yml. bash conda env create -f mike.yml

Alternatively, use the package manager pip to install mikecalsetup. Download the package and run "pip install ." in the folder with the setup file. bash cd mikecalsetup directory pip install .

Usage

A short example of usage is given in the following. The jupyter notebooks in the examples folder provides a more complete overview of how to use this tool. ```python import mikecalsetup

extract all relevant information from model

modnme = 'Karupbasic0' # name of model (no extension) pth = '.\test\examplemodels\Karup\KarupBasic' # relative path to model setup = mikecalsetup.Setup(mod_nme, pth)

constrain the number of processes that are parameterized with the par_from variable

setup = mikecalsetup.Setup(modnme, pth, parfrom=['ol', 'sz', 'uz', 'river']) # possibilites ['lu', 'ol', 'sz', 'uz', 'river']

check that path to mike she installation is correct

setup.mzpath

parameters are specified in the par dataframe

par = setup.par parnme = par.index.tolist()

drop parameters not needed for the calibration

droppar = ['olInitialWaterDepth', 'szDrainageLevel'] parnme = [nme for nme in parnme if nme not in droppar] par = par.loc[parnme]

set transform ['none', 'fixed', 'tied'],

group = [nme for nme in parnme if nme.startswith('riv')] par.loc[group[0], 'transform'] = 'none' par.loc[group[1:], 'transform'] = 'tied' par.loc[group[1:], 'tiedto'] = group[0]

par.loc['olManning', 'transform'] = 'fixed' par.loc['olManning', 'value'] = 2.5

set upper and lower bounds

group = [nme for nme in parnme if nme.endswith('HydrGenuchtenKs')] par.loc[group, ['lower', 'upper']] = 0.39, 0.46

assign parameter dataframe back to class

setup.par = par

assign needed statistics to observation-simulation pairs

results = setup.results results['stats'] = 'fbal, nse' # possibilities = rmse, kge, nse, pcc, fbal delimited with comma

write files based on setup

setup.write_files()

```

Tests

A collection of tests are developed using unittest. The test script is located in the test folder along with MIKE SHE example model setups. To run tests locally and get coverage report: bash conda activate mike cd to mikecalsetup directory python -m unittest discover -v python -m coverage report python -m coverage html

Community guidelines

Please do not hesitate to contact me directly if you need more information to apply the tool, find a bug, have ideas for extending the functionality. If you wish to contribute, please fork the mikecalsetup repository on GitHub, clone, and develop your modifications on a branch. Then submit a pull request.

Owner

  • Login: tenemark
  • Kind: user

JOSS Publication

mikecalsetup: an open-source python tool for automatically creating calibration setups of MIKE SHE models in PEST or OSTRICH
Published
October 12, 2023
Volume 8, Issue 90, Page 5548
Authors
Trine Enemark ORCID
Department of Geosciences and Natural Resource Management, University of Copenhagen, Copenhagen, 1350, Denmark
Editor
Jemma Stachelek ORCID
Tags
Calibration MIKESHE OSTRICH PEST

GitHub Events

Total
  • Push event: 3
  • Pull request event: 1
  • Create event: 1
Last Year
  • Push event: 3
  • Pull request event: 1
  • Create event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 54
  • Total Committers: 2
  • Avg Commits per committer: 27.0
  • Development Distribution Score (DDS): 0.444
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
tenemark e****e@g****m 30
Raphael Schneider rs@g****k 24
Committer Domains (Top 20 + Academic)
geus.dk: 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 10
  • Total pull requests: 4
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 23 days
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 1.1
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aleaf (7)
  • jsta (1)
  • Snowthe (1)
Pull Request Authors
  • Snowthe (7)
Top Labels
Issue Labels
documentation (1) enhancement (1)
Pull Request Labels

Dependencies

.github/workflows/draft-pdf.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
setup.py pypi
  • mikeio *