swn.SurfaceWaterNetwork.set_diversions#

SurfaceWaterNetwork.set_diversions(diversions, *, override={}, min_stream_order=None, downstream_bias=0.0)#

Set surface water diversion locations.

This method checks or assigns a segment number to divert surface water flow from, and adds other columns to the diversions and segments data frames.

If a from_segnum column exists, these values are checked against the index for segments, and adds/updates (where possible) dist_to_seg and seg_ndist. If a non-spatial frame is used, it is assumed that the diversion is from the segment end, where seg_ndist is 1.0.

If from_segnum is not provided and a GeoDataFrame is provided, then the segment is identified using locate_geoms().

Parameters:
diversionspandas.DataFrame, geopandas.GeoDataFrame or None

Data frame of surface water diversions, a modified copy kept as a diversions property. Use None to remove diversions.

overridedict, optional

Override matches, where key is the index from diversions, and the value is segnum. If value is None, the diversion is ignored.

min_stream_orderint, default None

Finds stream segments with a minimum stream order.

downstream_biasfloat, default 0.0

A bias used for spatial location matching on nearest segments that increase the likelihood of finding downstream segments if positive, and upstream segments if negative. Valid range is -1.0 to 1.0. Default 0.0 is no bias, matching to the closest segment.

Returns:
None

See diversions for result object description.