flopy.utils.check module
- class check(package, f: str | PathLike | None = None, verbose=True, level=1, property_threshold_values={})[source]
Bases:
object
Check package for common errors
- Parameters:
package (object) – Instance of Package class.
f (str or PathLike, optional) – Path to the summary file. If no path is provided, a summary file is not created and results are only written to stdout.
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.
property_threshold_values (dict) –
- hktuple
Reasonable minimum/maximum hydraulic conductivity value; values below this will be flagged. Default is (1e-11, 1e5), after Bear, 1972 (see https://en.wikipedia.org/wiki/Hydraulic_conductivity) and Schwartz and Zhang (2003, Table 4.4).
- vkatuple
Reasonable minimum/maximum hydraulic conductivity value; Default is (1e-11, 1e5), after Bear, 1972 (see https://en.wikipedia.org/wiki/Hydraulic_conductivity) and Schwartz and Zhang (2003, Table 4.4).
- vkcbtuple
Reasonable minimum/maximum hydraulic conductivity value for quasi-3D confining bed; Default is (1e-11, 1e5), after Bear, 1972 (see https://en.wikipedia.org/wiki/Hydraulic_conductivity) and Schwartz and Zhang (2003, Table 4.4).
- sytuple
Reasonable minimum/maximum specific yield values; Default is (0.01,0.5) after Anderson, Woessner and Hunt (2015, Table 5.2).
- sytuple
Reasonable minimum/maximum specific storage values; Default is (3.3e-6, 2e-2) after Anderson, Woessner and Hunt (2015, Table 5.2).
Notes
- Anderson, M.P, Woessner, W.W. and Hunt, R.J., 2015. Applied Groundwater
Modeling: Simulation of Flow and Advective Transport, Elsevier, 564p.
Bear, J., 1972. Dynamics of Fluids in Porous Media. Dover Publications. Schwartz, F.W. and Zhang, H., 2003. Fundamentals of Groundwater, Wiley,
583 p.
- bc_stage_names = {'DRN': 'elev', 'GHB': 'bhead'}
- get_active(include_cbd=False)[source]
Returns a boolean array of active cells for the model.
- Parameters:
include_cbd (boolean) – If True, active is of same dimension as the thickness array in the DIS module (includes quasi 3-D confining beds). Default False.
- Returns:
active – True where active.
- Return type:
3-D boolean array
- get_neighbors(a)[source]
For a structured grid, this returns the 6 neighboring values for each value in a. For an unstructured grid, this returns the n_max neighboring values, where n_max is the maximum number of nodal connections for any node within the model; nodes with less than n_max connections are assigned np.nan for indices above the number of connections for that node.
- Parameters:
a (3-D Model array in layer, row, column order array, even for an) –
instance (unstructured grid; for) –
array (a Util3d) –
flopy.modflow.ModflowBas.ibound). ((e.g.) –
- Returns:
neighbors – Array of neighbors, where axis 0 contains the n neighboring values for each value in a, and subsequent axes are in layer, row, column order. “n” is 6 for a structured grid, and “n” is n_max for an unstructured grid, as described above. Nan is returned for values at edges.
- Return type:
4-D array
- isvalid(inds)[source]
Check that indices are valid for model grid
- Parameters:
inds (tuple or lists or arrays; or a 1-D array) – (k, i, j) for structured grids; (node) for unstructured.
- Returns:
isvalid – True for each index in inds that is valid for the model grid.
- Return type:
1-D boolean array
- package_check_levels = {'sfr': 1}
- property_threshold_values = {'hani': None, 'hk': (1e-11, 100000.0), 'k': (1e-11, 100000.0), 'k22': (1e-11, 100000.0), 'k33': (1e-11, 100000.0), 'ss': (1e-06, 0.01), 'sy': (0.01, 0.5), 'vka': (1e-11, 100000.0), 'vkcb': (1e-11, 100000.0)}
- remove_passed(message)[source]
Remove a check to the passed list if it failed in any stress period.
- solver_packages = {'mf2005': ['DE4', 'SIP', 'GMG', 'PCG', 'PCGN'], 'mf2k': ['DE4', 'SIP', 'SOR', 'GMG', 'PCG', 'PCGN'], 'mfnwt': ['DE4', 'SIP', 'PCG', 'NWT'], 'mfusg': ['SMS']}
- stress_period_data_values(stress_period_data, criteria, col=None, error_name='', error_type='Warning')[source]
If criteria contains any true values, return the error_type, package name, k,i,j indices, values, and description of error for each row in stress_period_data where criteria=True.
- thin_cell_threshold = 1.0
- fields_view(arr, fields)[source]
creates view of array that only contains the fields in fields. https://stackoverflow.com/q/15182381/