flopy.modflow.mfhob Module

class flopy.modflow.mfhob.HeadObservation(model, tomulth=1.0, obsname='HOBS', layer=0, row=0, column=0, roff=0.0, coff=0.0, itt=1, mlay={0: 1.0}, time_series_data=[[0.0, 0.0]], names=None)

Create HeadObservation instance from a time series array

Parameters:

tomulth : float

time-offset multiplier for head observations. Default is 1.

obsnam : string

Observation name. Default is ‘HOBS’

layer : int

is the zero-based layer index of the cell in which the head observation is located. If layer is less than zero, hydraulic heads from multiple layers are combined to calculate a simulated value. The number of layers equals the absolute value of layer, or |layer|. Default is 0.

row : int

zero-based row index for the observation. Default is 0.

column : int

zero-based column index of the observation. Default is 0.

roff : float

Fractional offset from center of cell in Y direction (between rows). Default is 0.

coff : float

Fractional offset from center of cell in X direction (between columns). Default is 0.

itt : int

Flag that identifies whether head or head changes are used as observations. itt = 1 specified for heads and itt = 2 specified if initial value is head and subsequent changes in head. Only specified if irefsp is < 0. Default is 1.

mlay : dictionary of length (|irefsp|)

key represents zero-based layer numbers for multilayer observations an value represents the fractional value for each layer of multilayer observations. Only used if irefsp < 0. Default is {0:1.}

time_series_data : list or numpy array

two-dimensional list or numpy array containing the simulation time of the observation and the observed head [[totim, hob]]. Default is [[0., 0.]]

names : list

list of specified observation names. Default is None.

Returns:

obs : HeadObservation

HeadObservation object.

Examples

>>> import flopy
>>> model = flopy.modflow.Modflow()
>>> dis = flopy.modflow.ModflowDis(model, nlay=1, nrow=11, ncol=11, nper=2,
... perlen=[1,1])
>>> obs = flopy.modflow.HeadObservation(model, layer=0, row=5, column=5,
... time_series_data=[[1.,54.4], [2., 55.2]])
class flopy.modflow.mfhob.ModflowHob(model, iuhobsv=None, hobdry=0, tomulth=1.0, obs_data=None, hobname=None, extension='hob', unitnumber=None, filenames=None)

Head Observation package class

Parameters:

iuhobsv : int

unit number where output is saved

hobdry : float

Value of the simulated equivalent written to the observation output file when the observation is omitted because a cell is dry

tomulth : float

Time step multiplier for head observations. The product of tomulth and toffset must produce a time value in units consistent with other model input. tomulth can be dimensionless or can be used to convert the units of toffset to the time unit used in the simulation.

obs_data : list of HeadObservation instances

list of HeadObservation instances containing all of the data for each observation. Default is None.

hobname : str

Name of head observation output file. If iuhobsv is greater than 0, and hobname is not provided the model basename with a ‘.hob.out’ extension will be used. Default is None.

extension : string

Filename extension (default is hob)

unitnumber : int

File unit number (default is None)

filenames : str 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 hob output name will be created using the model name and .hob.out extension (for example, modflowtest.hob.out), if iuhobsv is a number greater than zero. If a single string is passed the package will be set to the string and hob output name will be created using the model name and .hob.out extension, if iuhobsv is a number greater than zero. To define the names for all package files (input and output) the length of the list of strings should be 2. Default is None.

See also

Notes

Examples

>>> import flopy
>>> model = flopy.modflow.Modflow()
>>> dis = flopy.modflow.ModflowDis(model, nlay=1, nrow=11, ncol=11, nper=2,
... perlen=[1,1])
>>> obs = flopy.modflow.HeadObservation(model, layer=0, row=5, column=5,
... time_series_data=[[1.,54.4], [2., 55.2]])
>>> hob = flopy.modflow.ModflowHob(model, iuhobsv=51, hobdry=-9999.,
... obs_data=[obs])
check(f=None, verbose=True, level=1)

Check package data for common errors.

Parameters:

f : str or file handle

String defining file name or file handle for summary file of check method output. If a sting is passed a file handle is created. If f is None, check method does not write results to a summary file. (default is None)

verbose : bool

Boolean flag used to determine if check method results are written to the screen

level : int

Check method analysis level. If level=0, summary checks are performed. If level=1, full checks are performed.

Returns:

None

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.dis.check()
static load(f, model, ext_unit_dict=None, check=True)

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.

check : boolean

Check package data for common errors. (default True)

Returns:

hob : ModflowHob object

ModflowHob object.

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> hobs = flopy.modflow.ModflowHob.load('test.hob', m)
plot(**kwargs)

Plot 2-D, 3-D, transient 2-D, and stress period list (MfList) package input data

Parameters:

**kwargs : dict

filename_base
: str

Base file name that will be used to automatically generate file names for output image files. Plots will be exported as image files if file_name_base is not None. (default is None)

file_extension
: str

Valid matplotlib.pyplot file extension for savefig(). Only used if filename_base is not None. (default is ‘png’)

mflay
: int

MODFLOW zero-based layer number to return. If None, then all all layers will be included. (default is None)

kper
: int

MODFLOW zero-based stress period number to return. (default is zero)

key
: str

MfList dictionary key. (default is None)

Returns:

axes : list

Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned.

Examples

>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.dis.plot()
to_shapefile(filename, **kwargs)

Export 2-D, 3-D, and transient 2-D model data to shapefile (polygons). Adds an attribute for each layer in each data array

Parameters:

filename : str

Shapefile name to write

Returns:

None

Examples

>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.lpf.to_shapefile('test_hk.shp')
write_file()

Write the package file

Returns:None