imod.mf6.OutputControl#
- class imod.mf6.OutputControl(save_head=None, save_budget=None, save_concentration=None, head_file=None, budget_file=None, concentration_file=None, validate: bool = True)[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_head – 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_domain
([layer, x, y])Clip a variable along the specified dimensions.
copy
()from_file
(path, **kwargs)Loads an imod mf6 package from a file (currently only netcdf and zarr are supported).
get_auxiliary_variable_names
()isel
()mask
(domain)Mask values outside of domain.
period_data
()render
(directory, pkgname, globaltimes, binary)sel
()to_sparse
(arrdict, layer)Convert from dense arrays to list based input
write
(directory, pkgname, globaltimes, binary)write_binary_griddata
(outpath, da, dtype)write_blockfile
(directory, pkgname, ...)write_netcdf
(directory, pkgname[, ...])Write to netcdf.
write_text_griddata
(outpath, da, dtype)