Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve plotting #179

Merged
merged 3 commits into from
May 15, 2023
Merged

Improve plotting #179

merged 3 commits into from
May 15, 2023

Conversation

dbrakenhoff
Copy link
Collaborator

@dbrakenhoff dbrakenhoff commented May 15, 2023

Create plotting submodule:

  • Move plot.py functions into submodule
  • Separate nlmod-style plotting and flopy-style plotting (see more info below)
  • Move utility functions into plotutil.py
  • Add map_array functions for quickly drawing results on a map w colorbar etc.
  • Add animate_map flopy version
  • remove deprecated plot methods

nlmod vs flopy style plotting:

  • nlmod-style plotting is based on a model xarray.Dataset, and all plot methods should obtain grid information and any other details from that object.
  • flopy-style plotting uses arrays and the groundwater model object to create plots

The following examples yield the same result.

Example nlmod-style plotting, based on model dataset:

import nlmod

# given some model data set `ds` 

# load heads
da = nlmod.gwf.output.get_heads_da(ds=ds)

# plot heads
ax0 = nlmod.plot.map_array(da, ds)

Example of flopy-style plotting based on groundwater flow model:

import nlmod

# given some groundwater flow model `gwf`

# load heads
hobj = gwf.output.heads()
h = hobj.get_alldata()[0]

# plot heads
ax0 = nlmod.plot.flopy.map_array(h, gwf)

- move plot.py
- add flopy plotting module (plot/flopy.py)
- move all flopy style plotting into flopy.py
- move plotting util functions to plotutil.py
- add init
@dbrakenhoff dbrakenhoff merged commit 8cbda23 into dev May 15, 2023
@dbrakenhoff dbrakenhoff deleted the improve-plotting branch May 15, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants