swn.modflow.SwnMf6.diversions_frame#

SwnMf6.diversions_frame(style: str)#

Return DataFrame of DIVERSIONS for MODFLOW 6 SFR.

This DataFrame is derived from diversions.

Parameters:
stylestr

If “native”, all indices use one-based notation. If “flopy”, all indices use zero-based notation.

Returns:
DataFrame

See also

SwnMf6.write_diversions

Write native file.

SwnMf6.flopy_diversions

List of lists for flopy.

Examples

>>> import flopy
>>> import geopandas
>>> import swn
>>> lines = geopandas.GeoSeries.from_wkt([
...    "LINESTRING (60 100, 60  80)",
...    "LINESTRING (40 130, 60 100)",
...    "LINESTRING (70 130, 60 100)"])
>>> lines.index += 100
>>> n = swn.SurfaceWaterNetwork.from_lines(lines)
>>> diversions = geopandas.GeoSeries.from_wkt([
...    "POINT (58 100)", "POINT (62 100)",
...    "POINT (59 95)", "POINT (61 92)"]).to_frame("geometry")
>>> diversions.index += 11
>>> n.set_diversions(diversions)
>>> sim = flopy.mf6.MFSimulation()
>>> _ = flopy.mf6.ModflowTdis(sim, nper=1, time_units="days")
>>> gwf = flopy.mf6.ModflowGwf(sim)
>>> _ = flopy.mf6.ModflowGwfdis(
...     gwf, nrow=3, ncol=2, delr=20.0, delc=20.0, idomain=1,
...     length_units="meters", xorigin=30.0, yorigin=70.0)
>>> nm = swn.SwnMf6.from_swn_flopy(n, gwf)
>>> nm.diversions_frame("native")
    ifno  idv  iconr cprior
11    3     1      8   upto
12    5     1      9   upto
13    6     1     10   upto
14    6     2     11   upto
>>> nm.diversions_frame("flopy")
    ifno  idv  iconr cprior
11     2    0      7   upto
12     4    0      8   upto
13     5    0      9   upto
14     5    1     10   upto