swn.modflow.SwnMf6.packagedata_frame#

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

Return DataFrame of PACKAGEDATA for MODFLOW 6 SFR.

This DataFrame is derived from the reaches DataFrame.

Parameters:
stylestr

If “native”, all indices (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_packagedata

Write native file.

SwnMf6.flopy_packagedata

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)
>>> 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.default_packagedata()
>>> nm.reaches["boundname"] = nm.reaches["segnum"]
>>> nm.reaches["aux1"] = 2.0 + nm.reaches.index / 10.0
>>> nm.packagedata_frame("native", auxiliary="aux1")
     k  i  j       rlen  rwid   rgrd  ...    man  ncon  ustrf  ndv  aux1  boundname
ifno                                  ...
1    1  1  1  18.027756  10.0  0.001  ...  0.024     1    0.0    0   2.1        101
2    1  1  2   6.009252  10.0  0.001  ...  0.024     2    1.0    0   2.2        101
3    1  2  2  12.018504  10.0  0.001  ...  0.024     2    1.0    0   2.3        101
4    1  1  2  21.081851  10.0  0.001  ...  0.024     1    0.0    0   2.4        102
5    1  2  2  10.540926  10.0  0.001  ...  0.024     2    1.0    0   2.5        102
6    1  2  2  10.000000  10.0  0.001  ...  0.024     3    1.0    0   2.6        100
7    1  3  2  10.000000  10.0  0.001  ...  0.024     1    1.0    0   2.7        100

[7 rows x 15 columns]
>>> nm.packagedata_frame("flopy", boundname=False).drop(columns="man")
         cellid       rlen  rwid   rgrd  rtp  rbth  rhk  ncon  ustrf  ndv
ifno
0     (0, 0, 0)  18.027756  10.0  0.001  1.0   1.0  1.0     1    0.0    0
1     (0, 0, 1)   6.009252  10.0  0.001  1.0   1.0  1.0     2    1.0    0
2     (0, 1, 1)  12.018504  10.0  0.001  1.0   1.0  1.0     2    1.0    0
3     (0, 0, 1)  21.081851  10.0  0.001  1.0   1.0  1.0     1    0.0    0
4     (0, 1, 1)  10.540926  10.0  0.001  1.0   1.0  1.0     2    1.0    0
5     (0, 1, 1)  10.000000  10.0  0.001  1.0   1.0  1.0     3    1.0    0
6     (0, 2, 1)  10.000000  10.0  0.001  1.0   1.0  1.0     1    1.0    0