flopy.pakbase module¶
- pakbase module
- This module contains the base package class from which all of the other packages inherit from.
-
class
Package
(parent, extension='glo', name='GLOBAL', unit_number=1, extra='', filenames=None, allowDuplicates=False)[source]¶ Bases:
flopy.pakbase.PackageInterface
Base package class from which most other packages are derived.
-
static
add_to_dtype
(dtype, field_names, field_types)[source]¶ Add one or more fields to a structured array data type
Parameters: - dtype (numpy.dtype) – Input structured array datatype to add to.
- field_names (str or list) – One or more field names.
- field_types (numpy.dtype or list) – One or more data types. If one data type is supplied, it is repeated for each field name.
-
data_list
¶
-
export
(f, **kwargs)[source]¶ Method to export a package to netcdf or shapefile based on the extension of the file name (.shp for shapefile, .nc for netcdf)
Parameters: - f (str) – filename
- kwargs (keyword arguments) –
- modelgrid : flopy.discretization.Grid instance
- user supplied modelgrid which can be used for exporting in lieu of the modelgrid associated with the model object
Returns: Return type: None or Netcdf object
-
static
load
(f, model, pak_type, ext_unit_dict=None, **kwargs)[source]¶ Default load method for standard boundary packages.
-
name
¶
-
package_type
¶
-
parent
¶
-
plot
(**kwargs)[source]¶ 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 – Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned. Return type: list Notes
Examples
>>> import flopy >>> ml = flopy.modflow.Modflow.load('test.nam') >>> ml.dis.plot()
-
plotable
¶
-
to_shapefile
(filename, **kwargs)[source]¶ 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: Return type: None Notes
Examples
>>> import flopy >>> ml = flopy.modflow.Modflow.load('test.nam') >>> ml.lpf.to_shapefile('test_hk.shp')
-
static
-
class
PackageInterface
[source]¶ Bases:
object
-
check
(f=None, verbose=True, level=1, checktype=None)[source]¶ 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.
- checktype (check) – Checker type to be used. By default class check is used from check.py.
Returns: Return type: None
Examples
>>> import flopy >>> m = flopy.modflow.Modflow.load('model.nam') >>> m.dis.check()
-
data_list
¶
-
has_stress_period_data
¶
-
name
¶
-
package_type
¶
-
parent
¶
-
plotable
¶
-