imod.mf6.OutputControl#

class imod.mf6.OutputControl(*_, **__)[source]#

The Output Control Option determines how and when heads are printed to the listing file and/or written to a separate binary output file. https://water.usgs.gov/water-resources/software/MODFLOW-6/mf6io_6.0.4.pdf#page=47

Currently the settings “first”, “last”, “all”, and “frequency” are supported, the “steps” setting is not supported, because of its ragged nature. Furthermore, only one setting per stress period can be specified in imod-python.

Parameters:
  • save_head ({string, integer}, or xr.DataArray of {string, integer}, optional) – String or integer indicating output control for head file (.hds) If string, should be one of [“first”, “last”, “all”]. If integer, interpreted as frequency.

  • save_budget ({string, integer}, or xr.DataArray of {string, integer}, optional) – String or integer indicating output control for cell budgets (.cbc) If string, should be one of [“first”, “last”, “all”]. If integer, interpreted as frequency.

  • save_concentration ({string, integer}, or xr.DataArray of {string, integer}, optional) – String or integer indicating output control for concentration file (.ucn) If string, should be one of [“first”, “last”, “all”]. If integer, interpreted as frequency.

  • validate ({True, False}) – Flag to indicate whether the package should be validated upon initialization. This raises a ValidationError if package input is provided in the wrong manner. Defaults to True.

Examples

To specify a mix of both ‘frequency’ and ‘first’ setting, we need to specify an array with both integers and strings. For this we need to create a numpy object array first, otherwise xarray converts all to strings automatically.

>>> time = [np.datetime64("2000-01-01"), np.datetime64("2000-01-02")]
>>> data = np.array(["last", 5], dtype="object")
>>> save_head = xr.DataArray(data, coords={"time": time}, dims=("time"))
>>> oc = imod.mf6.OutputControl(save_head=save_head, save_budget=None, save_concentration=None)
__init__(save_head=None, save_budget=None, save_concentration=None, head_file=None, budget_file=None, concentration_file=None, validate: bool = True)[source]#

Methods

__init__([save_head, save_budget, ...])

add_periodic_auxiliary_variable()

clip_box([time_min, time_max, layer_min, ...])

Clip a package by a bounding box (time, layer, y, x).

copy()

from_file(path, **kwargs)

Loads an imod mf6 package from a file (currently only netcdf and zarr are supported).

get_auxiliary_variable_names()

get_regrid_methods()

is_regridding_supported()

returns true if package supports regridding.

isel()

mask(domain)

Mask values outside of domain.

period_data()

regrid_like(target_grid[, regridder_types])

Creates a package of the same type as this package, based on another discretization.

render(directory, pkgname, globaltimes, binary)

sel()

skip_masking_dataarray(array_name)

to_netcdf(*args, **kwargs)

Write dataset contents to a netCDF file.

write(pkgname, globaltimes, write_context)

write_binary_griddata(outpath, da, dtype)

write_blockfile(pkgname, globaltimes, ...)

write_netcdf(directory, pkgname[, ...])

Write to netcdf.

write_text_griddata(outpath, da, dtype)

Attributes

dataset