imod.mf6.OutputControl#
- class imod.mf6.OutputControl(*_, **__)[source]#
The Output Control Option determines how and when heads, budgets and/or concentrations 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.4.2.pdf#page=53
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, ...])cleanup
(dis)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_non_grid_data
(grid_names)This function copies the attributes of a dataset that are scalars, such as options.
get_regrid_methods
()is_clipping_supported
()is_empty
()Returns True if the package is empty- for example if it contains only no-data values.
is_grid_agnostic_package
()is_regridding_supported
()is_splitting_supported
()isel
()mask
(mask)Mask values outside of domain.
regrid_like
(target_grid, regrid_cache[, ...])Creates a package of the same type as this package, based on another discretization.
render
(directory, pkgname, globaltimes, binary)sel
()to_netcdf
(*args, **kwargs)Write dataset contents to a netCDF file.
write
(pkgname, globaltimes, directory[, ...])Write package to file
write_binary_griddata
(outpath, da, dtype)write_blockfile
(pkgname, globaltimes, ...)write_text_griddata
(outpath, da, dtype)Attributes
auxiliary_data_fields
dataset
is_budget_output