Open in Colab

Plot subsurface variables#

# skip this if package has already been installed
!pip install modvis
import numpy as np
import modvis.ats_xdmf as xdmf
import modvis.plot_vis_file as pv

model_dir = "../data/coalcreek"

Download the sample data when running on Google Colab

import os
if not os.path.exists(model_dir):
  !git clone https://github.com/pinshuai/modvis.git
  %cd ./modvis/examples/notebooks

import vis data#

visfile = xdmf.VisFile(model_dir, domain=None, load_mesh=True, columnar=True)

plot subsurface satuation#

single column#

fig, ax = pv.plot_column_data(visfile, var_name = "saturation_liquid", cmap = "coolwarm", 
                              col_ind=0)
../_images/aaee83b303041e497d7770ff0518a6b4a3827b7ce08f760d03fd59a5482e9733.png

single layer#

fig, ax = pv.plot_layer_data(visfile, var_name = "saturation_liquid", 
                             layer_ind = 0, time_slice= "2015-10-01",
                          cmap = "coolwarm")
../_images/74317e61d73469882f99e18f747ac37ba688ac56184b661b156110ab1a8c2821.png

plot groundwater table#

single column#

ihead = pv.plot_column_head(visfile, col_ind = 0)
../_images/80496b97efbd5c54c21180b70d68368125dbb85604893bcb37f25ac2e8696e34.png

GW surface#

fig, ax, tpc = pv.plot_gw_surface(visfile, time_slice = 0, contour = True, 
                                  contourline = True, nlevel = np.arange(2700,3665, 50), 
                                  colorbar = True,
                                 )
../_images/e5c24aaef4edf22fcb5bbc3b44bfe10218cc5d2ef6ec554e3de0c43d9fe60a39.png

Volumetric water content#

fig, ax, tpc = pv.plot_water_content(visfile, layer_ind = 0, 
                                     vmin = 0.1, vmax = 0.22, cmap = 'turbo',
                                     time_slice=0)
../_images/54f25ac5439a968affb804daa0e428b8c65781e87de7da4bedb6feac5ab3711c.png