swn.modflow.SwnMf6.package_period_frame#

SwnMf6.package_period_frame(package: str, style: str, auxiliary: list = [], boundname=None)#

Return DataFrame of PERIOD data for MODFLOW 6 packages.

This DataFrame is derived from the reaches DataFrame, and is implemented using flopy.mf6 package’s stress_period_data.

Parameters:
packagestr

MODFLOW 6 package name, such as “drn” for DRAIN, or “GWT/SRC” for Mass Source Loading.

stylestr

If “native”, all indicies (including kij) use one-based notation. Also use k,i,j columns (as str) rather than cellid. If “flopy”, all indices (including rno/ifno) use zero-based notation. Also use cellid as a tuple.

auxiliarystr, list, optional

String or list of auxiliary variable names. Default [].

boundnamebool, optional

Default None will determine if “boundname” column is added if available in reaches.columns.

Returns:
DataFrame

See also

SwnMf6.write_package_period

Write native file.

SwnMf6.flopy_package_period

Dict of lists 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)
>>> 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, top=10, botm=0,
...     idomain=1, length_units="meters", xorigin=30.0, yorigin=70.0)
>>> nm = swn.SwnMf6.from_swn_flopy(n, gwf)
>>> nm.set_reach_data_from_array("elev", gwf.dis.top.array)
>>> nm.reaches["dlen"] = nm.reaches.length
>>> nm.reaches["cond"] = nm.reaches.dlen * 10.0
>>> nm.reaches["boundname"] = nm.reaches["segnum"]
>>> nm.package_period_frame("drn", "native", auxiliary="dlen")
         k  i  j  elev        cond       dlen boundname
per ifno
1   1    1  1  1  10.0  180.277564  18.027756       101
    2    1  1  2  10.0   60.092521   6.009252       101
    3    1  2  2  10.0  120.185043  12.018504       101
    4    1  1  2  10.0  210.818511  21.081851       102
    5    1  2  2  10.0  105.409255  10.540926       102
    6    1  2  2  10.0  100.000000  10.000000       100
    7    1  3  2  10.0  100.000000  10.000000       100
>>> nm.package_period_frame("drn","flopy", boundname=False)
            cellid  elev        cond
per ifno
0   0    (0, 0, 0)  10.0  180.277564
    1    (0, 0, 1)  10.0   60.092521
    2    (0, 1, 1)  10.0  120.185043
    3    (0, 0, 1)  10.0  210.818511
    4    (0, 1, 1)  10.0  105.409255
    5    (0, 1, 1)  10.0  100.000000
    6    (0, 2, 1)  10.0  100.000000