gsflow.output.discretization Module¶
-
class
gsflow.output.discretization.
PrmsDiscretization
(xypts)[source]¶ The PrmsDiscretization object is used for plotting hru’s and hru data from Prms on matplotlib plots.
Could also be used for exporting shape files of data
- Parameters
- xyptslist
3 dimensional list of hru [(x1, y1)….(xn, yn)] points
Examples
load from shapefile
>>> import gsflow >>> dis = gsflow.output.PrmsDiscretization.load_from_shapefile("myshape.shp")
load from flopy grid
>>> gsf = gsflow.GsflowModel.load_from_file("mycontrol.control") >>> ml = gsf.mf >>> dis = gsflow.output.PrmsDiscretization.load_from_flopy(model=ml)
- Attributes
extent
Returns a tuple of (xmin, xmax, ymin, ymax)
nhru
Returns the number of hrus
x_hru_centers
Returns a np.ndarray of x-centers for each hru
xypts
Returns a np.ndarray of xy-points for each hru
y_hru_centers
Returns a np.ndarray of y-centers for each hru
Methods
get_hru_points
(self, hru)Get the x, y coordinate points for a hru
load_from_flopy
(model[, xll, yll, rotation])Method to load discretization from a flopy model
load_from_shapefile
(shp[, hru_id])Load method from a polygon shapefile.
plot_discretization
(self[, ax])Method to plot the PRMS discretization on a matplotlib.pyplot plot
-
property
extent
¶ Returns a tuple of (xmin, xmax, ymin, ymax)
-
get_hru_points
(self, hru)[source]¶ Get the x, y coordinate points for a hru
- Parameters
- hruint
hru number
- Returns
- list of x, y coordinate points
-
static
load_from_flopy
(model, xll=None, yll=None, rotation=None)[source]¶ Method to load discretization from a flopy model
- Parameters
- modelflopy.modflow.Modflow or gsflow.modflow.Modflow object
- xllfloat, optional
xoffset for modflow grid
- yllfloat, optional
yoffset for modflow grid
- rotationfloat, optional
rotation for modflow grid
- Returns
- PrmsDiscretization object
-
static
load_from_shapefile
(shp, hru_id='hru_id')[source]¶ Load method from a polygon shapefile. Shapefile must also have a hru field in the dbf file to sort the hydrologic reservior units properly.
- Parameters
- shpstr or shapefile.Reader object
- hru_idstr
field of hru id in shapefile
- Returns
- PrmsDiscretization object
-
property
nhru
¶ Returns the number of hrus
-
plot_discretization
(self, ax=None, **kwargs)[source]¶ Method to plot the PRMS discretization on a matplotlib.pyplot plot
- Parameters
- axmatplotlib.pyplot.axes
if None, gets current working axes
- kwargsmatplotlib.pyplot keyword arguments
only for Polygon patches
- Returns
- matplotlib.pyplot.axes object
-
property
x_hru_centers
¶ Returns a np.ndarray of x-centers for each hru
-
property
xypts
¶ Returns a np.ndarray of xy-points for each hru
-
property
y_hru_centers
¶ Returns a np.ndarray of y-centers for each hru