swn.modflow.SwnModflow.package_period_frame#

SwnModflow.package_period_frame(package: str, style: str, auxiliary=[], **kwds)#

Return DataFrame of stress period data for MODFLOW packages.

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

Parameters:
packagestr

MODFLOW package name, such as “drn” for DRAIN.

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) use zero-based notation. Also use cellid as a tuple.

auxiliarystr, list, optional

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

**kwdsdict, optional

Keyword arguments used for get_default_dtype, if available. A common keyword is structured=True.

Returns:
DataFrame

See also

SwnModflow.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)
>>> m = flopy.modflow.Modflow(version="mf2005")
>>> _ = flopy.modflow.ModflowDis(
...     m, nrow=3, ncol=2, delr=20.0, delc=20.0, xul=30.0, yul=130.0,
...     top=15.0, botm=10.0)
>>> _ = flopy.modflow.ModflowBas(m)
>>> nm = swn.modflow.SwnModflow.from_swn_flopy(n, m)
>>> nm.set_reach_data_from_array("elev", m.dis.top.array)
>>> nm.reaches["dlen"] = nm.reaches.length
>>> nm.reaches["cond"] = nm.reaches.dlen * 10.0
>>> nm.package_period_frame("drn", "native", auxiliary="dlen")
             k  i  j  elev        cond       dlen
per reachID
1   1        1  1  1  15.0  180.277564  18.027756
    2        1  1  2  15.0   60.092521   6.009252
    3        1  2  2  15.0  120.185043  12.018504
    4        1  1  2  15.0  210.818511  21.081851
    5        1  2  2  15.0  105.409255  10.540926
    6        1  2  2  15.0  100.000000  10.000000
    7        1  3  2  15.0  100.000000  10.000000