Skip to content

Usage

Below is a list of functions available in modvis.

Mixed-element mesh visualization

  • import visdump file
1
2
surface_vis = xdmf.VisFile(model_dir='.', domain='surface', mixed_element=True)
subsurface_vis = xdmf.VisFile(model_dir='.', domain=None, mixed_element=True)
  • plot surface ponded depth
1
2
pv.plot_surface_data(surface_vis, var_name="surface-ponded_depth", 
                              time_slice="2019-05-01", mixed_element=True)
  • plot subsurface saturation. Note layer index is ordered from top to bottom (0--top).
1
2
pv.plot_layer_data(subsurface_vis, var_name = "saturation_liquid", 
                             layer_ind = 0, time_slice= 0, mixed_element=True)

Trianglular mesh visualization (default)

  • To load visdump file:

Note

For subsurface, use domain=None because it load subsurface by default. columnar=True is required for reordering the cells to column-based for easy plotting.

1
2
3
4
5
6
import modvis
# load subsurface visfile
modvis.ats_xdmf.VisFile(model_dir='.', domain=None, load_mesh=True, columnar=True)

# load surface visfile
modvis.ats_xdmf.VisFile(model_dir='.', domain='surface', load_mesh=True)
  • To plot surface ponded depth:

Note

You can use either numbering (0,1,2...) or datetime string (e.g., "2015-10-01") for the time_slice.

1
2
modvis.plot_vis_file.plot_surface_data(visfile, var_name="surface-ponded_depth",
                time_slice=0)
  • To plot subsurface saturation at the top layer:
1
2
modvis.plot_vis_file.plot_layer_data(visfile, var_name = "saturation_liquid", 
                             layer_ind = 0, time_slice= "2015-10-01")
  • To plot flow duration curve
1
modvis.general_plots.plot_FDC(dfs, labels, colors)
  • To plot one-to-one scatter plot with metrics
1
modvis.general_plots.one2one_plot(obs_df, simu_df, metrics=['KGE'])