gsflow.modsim.modsim Module

class gsflow.modsim.modsim.Modsim(model, other=None)[source]

Class to handle creating MODSIM inputs for the MODSIM-GSFLOW coupled modeling option in GSFLOW.

Parameters
modelgsflow.GsflowModel instance or gsflow.modflow.Modflow instance
otherstr or None

include can be used to add an optional sfr field (ex. strhc1) to the stream vector shapefile.

Examples

>>> import gsflow
>>> gsf = gsflow.GsflowModel.load_from_file("gsflow.control")
>>> modsim = gsflow.modsim.Modsim(gsf)
>>> modsim.write_modsim_shapefile("myshp.shp")
Attributes
lake_segs

Returns a list of the lake numbers connected to SFR segments

lake_topology

Returns a list of LAK topology objects for writing to shapefile

sfr_segs

Returns a list of the SFR segments

sfr_topology

Returns a list of SFR topology objects for writing to shapefile

Methods

write_modsim_shapefile(self[, shp, epsg, …])

Method to create a modsim compatible shapefile from GSFLOW model inputs (SFR, LAK) package.

property lake_segs

Returns a list of the lake numbers connected to SFR segments

property lake_topology

Returns a list of LAK topology objects for writing to shapefile

property sfr_segs

Returns a list of the SFR segments

property sfr_topology

Returns a list of SFR topology objects for writing to shapefile

write_modsim_shapefile(self, shp=None, epsg=None, flag_spillway=False, nearest=True, sfr_nearest=False, flag_ag_diversion=False)[source]

Method to create a modsim compatible shapefile from GSFLOW model inputs (SFR, LAK) package.

Parameters
shpstr

optional shapefile name, if none will be written in gsflow directory using the model name.

epsgint

epsg projection projection code, if none will epsg from flopy modelgrid

flag_spillwaybool, str, list

if flag_spillway is indicated then MODSIM will change the spill_flg attribute to one. This can be accomplished by one of three methods.

1.) flag_spillway=”elev”, the code will search for spillways from reservoirs based on elevation rules 2.) flag_spillway=”flow”, the code will search for spillways from reservoirs based on flow rules 3.) flag_spillway=[3, 4, 5, …] a user supplied list of SFR segments can be supplied to flag spillways

nearestbool

if nearest is True, lak topology will connect to the nearest SFR reaches based on the segment they are connected to. If False lak topology will connect to the start or end of the Segment based on iupseg and outseg

sfr_nearestbool

if sfr_nearest is True, sfr topology will connect using the distance equation. If False topology will connect to the start or end of the Segment based on iupseg and outseg

flag_ag_diversionbool

if flag_ag_diversion is True, code will check if SFR segments are agricultural diversions and then flag the diversions.