swn.modflow.SwnModflow.new_segment_data#

SwnModflow.new_segment_data()#

Generate empty segment data.

See also

default_segment_data

High-level frame constructor for segment data.

Notes

All values are zero except for:

  • nseg - 1, 2, …, nss

  • iupseg - 0 for most segments, except diversions

  • outseg - outflowing nseg

If segment_data is already set, subsequent calls will reset the DataFrame and segment_data_ts.

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.new_segment_data()
>>> print(nm.segment_data[["segnum", "icalc", "outseg", "elevup"]])
      segnum  icalc  outseg  elevup
nseg
1        101      0       3     0.0
2        102      0       3     0.0
3        100      0       0     0.0