hyvr.postprocess package¶
Submodules¶
hyvr.postprocess.output module¶
This file contains functions to convert the internal representation of a HyVR model output (a dictionary of arrays) to common data or model input formats.
The functions should be named to_<format> and take the following parameters:
- modelModel instance (see model.py)
The model object holding all the data arrays
- fnamestr
Where to save the file
If you want to add an output format, add a function in the same style and link
the inifile-name of the format with the function and the file extension in the
create_outputs
function below (in the dictionary output_desc
).
-
hyvr.postprocess.output.
create_outputs
(model, realization_dir, runname, formats)[source]¶ This functions creates output files based on the model output in the current run directory.
This calls mainly the functions defined below for the different datatypes.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
realization_dir (str) – Directory where the current realization results should be stored.
runname (str) – Name of the model run
formats (list of str) – List of output formats
-
hyvr.postprocess.output.
to_hdf5
(model, fname)[source]¶ Saves model output as .h5 file. This requires h5py.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
-
hyvr.postprocess.output.
to_hgs
(model, fname)[source]¶ Saves model output in the HydroGeoSphere format.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
-
hyvr.postprocess.output.
to_mat
(model, fname)[source]¶ Saves model output as .mat file.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
-
hyvr.postprocess.output.
to_mf6
(model, fname)[source]¶ Saves model output in mf6 format. This requires flopy.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
-
hyvr.postprocess.output.
to_modflow
(model, fname)[source]¶ Saves model output in modflow format. This requires flopy.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
-
hyvr.postprocess.output.
to_npz
(model, fname)[source]¶ Saves model output as .npz file.
- Parameters
model (Model instance (see model.py)) – The model object holding all the data arrays
fname (str) – Where to save the file (without file format extension)
hyvr.postprocess.plotting module¶
Some functions to plot hyvr output. This module is for testing purposes only.
-
hyvr.postprocess.plotting.
cross_section_pcolor
(model, field, y=None, x=None, log=False, xlim_y=None, ylim_y=None, xlim_x=None, ylim_x=None, cmap=None)[source]¶ Create a pcolor plot of a cross section of the specified field.
- Parameters
model (Model object) –
field (str) – The field to be shown, e.g. ‘ae’, ‘fac’, ‘hat’, ‘k_iso’, etc.
y (sequence of values or None, optional (default: None)) – If a sequence of values or a single value is given, cross section at this y-value will be plotted. If it is None, a y-cross section through the center of the model domain will be plotted. If it is an empty list, no y-cross section will be plotted.
x (sequence of values or None, optional (default: None)) – If a sequence of values or a single value is given, cross section at this x-value will be plotted. If it is None, a x-cross section through the center of the model domain will be plotted. If it is an empty list, no x-cross section will be plotted.
log (bool, optional (default: False)) – Whether to plot the logarithm of the field.
ylim_y (xlim_y,) – Axis limits for the y-cross-sections
ylim_x (xlim_x,) – Axis limits for the x-cross-sections
cmap (matplotlib colormap, optional (default: None)) – Colormap to use for the plot, e.g. ‘prism’.