flopy.modflow.mfhyd module
mfhyd module. Contains the ModflowHydclass. Note that the user can access the ModflowHyd class as flopy.modflow.ModflowHyd.
Additional information for this MODFLOW package can be found at the Online MODFLOW Guide.
- class ModflowHyd(model, nhyd=1, ihydun=None, hydnoh=-999.0, obsdata=[['BAS', 'HD', 'I', 0, 0.0, 0.0, 'HOBS1']], extension=['hyd', 'hyd.bin'], unitnumber=None, filenames=None)[source]
Bases:
Package
MODFLOW HYDMOD (HYD) Package Class.
- Parameters:
model (model object) – The model object (of type
flopy.modflow.mf.Modflow
) to which this package will be added.nhyd (int) – the maximum number of observation points. (default is 1).
ihydun (int) – A flag that is used to determine if hydmod data should be saved. If ihydun is non-zero hydmod data will be saved. (default is 1).
hydnoh (float) – is a user-specified value that is output if a value cannot be computed at a hydrograph location. For example, the cell in which the hydrograph is located may be a no-flow cell. (default is -999.)
obsdata –
Each row of obsdata includes data defining pckg (3 character string), arr (2 character string), intyp (1 character string) klay (int), xl (float), yl (float), hydlbl (14 character string) for each observation.
- pckgstr
is a 3-character flag to indicate which package is to be addressed by hydmod for the hydrograph of each observation point.
- arrstr
is a text code indicating which model data value is to be accessed for the hydrograph of each observation point.
- intypstr
is a 1-character value to indicate how the data from the specified feature are to be accessed; The two options are ‘I’ for interpolated value or ‘C’ for cell value (intyp must be ‘C’ for STR and SFR Package hydrographs.
- klayint
is the layer sequence number (zero-based) of the array to be addressed by HYDMOD.
- xlfloat
is the coordinate of the hydrograph point in model units of length measured parallel to model rows, with the origin at the lower left corner of the model grid.
- ylfloat
is the coordinate of the hydrograph point in model units of length measured parallel to model columns, with the origin at the lower left corner of the model grid.
- hydlblstr
is used to form a label for the hydrograph.
- extensionlist string
Filename extension (default is [‘hyd’, ‘hyd.bin’])
- unitnumberint
File unit number (default is None).
- filenamesstr or list of str
Filenames to use for the package and the output files. If filenames=None the package name will be created using the model name and package extension and the hydmod output name will be created using the model name and .hyd.bin extension (for example, modflowtest.hyd.bin). If a single string is passed the package will be set to the string and hydmod output name will be created using the model name and .hyd.bin extension. To define the names for all package files (input and output) the length of the list of strings should be 2. Default is None.
Notes
Examples
>>> import flopy >>> m = flopy.modflow.Modflow() >>> hyd = flopy.modflow.ModflowHyd(m)
- classmethod load(f, model, ext_unit_dict=None)[source]
Load an existing package.
- Parameters:
f (filename or file handle) – File to load.
model (model object) – The model object (of type
flopy.modflow.mf.Modflow
) to which this package will be added.ext_unit_dict (dictionary, optional) – If the arrays in the file are specified using EXTERNAL, or older style array control records, then f should be a file handle. In this case ext_unit_dict is required, which can be constructed using the function
flopy.utils.mfreadnam.parsenamefile
.
- Returns:
hyd
- Return type:
ModflowHyd object
Examples
>>> import flopy >>> m = flopy.modflow.Modflow() >>> hyd = flopy.modflow.ModflowHyd.load('test.hyd', m)