swn.modflow.SwnMf6#

class swn.modflow.SwnMf6(logger=None)#

Surface water network adaptor for MODFLOW 6.

Attributes:
swnswn.SurfaceWaterNetwork

Surface water network object.

modelflopy.mf6.ModflowGwf

Flopy model object.

segmentsgeopandas.GeoDataFrame

Geo dataframe of segments.

reachesgeopandas.GeoDataFrame

Geo dataframe of model cell-by-cell reaches.

tsvardict

Dataframe of time-varying data for MODFLOW SFR, key is dataset name.

diversionsgeopandas.GeoDataFrame, pd.DataFrame or None

[Geo] dataframe of diversions.

loggerlogging.Logger

Logger to show messages.

Methods

add_model_topbot_to_reaches()

Get top and bottom elevation of the model cell containing each reach.

connectiondata_series(style)

Return Series of CONNECTIONDATA for MODFLOW 6 SFR.

default_packagedata([hyd_cond1, ...])

High-level function to set MODFLOW 6 SFR PACKAGEDATA defaults.

diversions_frame(style)

Return DataFrame of DIVERSIONS for MODFLOW 6 SFR.

fix_reach_elevs([minslope, minincise, ...])

Fix reach elevations.

flopy_connectiondata()

Return list of lists for flopy.

flopy_diversions()

Return list of lists for flopy.

flopy_package_period(package[, auxiliary, ...])

Return dict of lists of lists for flopy's stress_period_data.

flopy_packagedata([auxiliary, boundname])

Return list of lists for flopy.

from_pickle(path[, swn, model])

Read a pickled format from a file.

from_swn_flopy(swn, model[, idomain_action, ...])

Create a MODFLOW 6 SFR structure from a surface water network.

gather_reaches(*[, upstream, downstream, ...])

Return reaches upstream (inclusive) and downstream (exclusive).

get_location_frame_reach_info(loc_df[, ...])

Get reach information to location data frame, matched by segnum.

package_period_frame(package, style[, ...])

Return DataFrame of PERIOD data for MODFLOW 6 packages.

packagedata_frame(style[, auxiliary, boundname])

Return DataFrame of PACKAGEDATA for MODFLOW 6 SFR.

plot([column, cmap, colorbar, ax])

Show map of reaches with inflow segments in royalblue.

plot_profile(segnum[, upstream, downstream, ax])

Plot stream top profiles vs model grid top and bottom.

plot_reaches_vs_model(seg[, dem, ...])

Plot map of stream elevations relative to model surfaces.

route_reaches(start, end, *[, allow_indirect])

Return a list of reach numbers that connect a pair of reaches.

set_package_obj(package[, auxiliary, boundnames])

Set MODFLOW 6 package data to flopy model.

set_reach_data_from_array(name, array)

Set reach data from an array that matches the model (nrow, ncol).

set_reach_data_from_segments(name, value[, ...])

Set reach data based on segment series (or scalar).

set_reach_slope([method, min_slope])

Set slope for reaches.

set_sfr_obj([auxiliary, boundnames])

Set MODFLOW 6 SFR package data to flopy model.

set_tsvar_from_segments(name, data[, where])

Set time-varying data from data defined at segments.

to_pickle(path[, protocol])

Pickle (serialize) non-flopy object data to file.

write_connectiondata(fname)

Write CONNECTIONDATA file for MODFLOW 6 SFR.

write_diversions(fname)

Write DIVERSIONS file for MODFLOW 6 SFR.

write_package_period(package, fname[, ...])

Write PERIOD file for MODFLOW 6 packages, to be used within OPEN/CLOSE.

write_packagedata(fname[, auxiliary, boundname])

Write PACKAGEDATA file for MODFLOW 6 SFR.

__init__(logger=None)#

Initialise SwnMf6.

Parameters:
loggerlogging.Logger, optional

Logger to show messages.

Methods

__init__([logger])

Initialise SwnMf6.

add_model_topbot_to_reaches()

Get top and bottom elevation of the model cell containing each reach.

connectiondata_series(style)

Return Series of CONNECTIONDATA for MODFLOW 6 SFR.

default_packagedata([hyd_cond1, ...])

High-level function to set MODFLOW 6 SFR PACKAGEDATA defaults.

diversions_frame(style)

Return DataFrame of DIVERSIONS for MODFLOW 6 SFR.

fix_reach_elevs([minslope, minincise, ...])

Fix reach elevations.

flopy_connectiondata()

Return list of lists for flopy.

flopy_diversions()

Return list of lists for flopy.

flopy_package_period(package[, auxiliary, ...])

Return dict of lists of lists for flopy's stress_period_data.

flopy_packagedata([auxiliary, boundname])

Return list of lists for flopy.

from_pickle(path[, swn, model])

Read a pickled format from a file.

from_swn_flopy(swn, model[, idomain_action, ...])

Create a MODFLOW 6 SFR structure from a surface water network.

gather_reaches(*[, upstream, downstream, ...])

Return reaches upstream (inclusive) and downstream (exclusive).

get_location_frame_reach_info(loc_df[, ...])

Get reach information to location data frame, matched by segnum.

package_period_frame(package, style[, ...])

Return DataFrame of PERIOD data for MODFLOW 6 packages.

packagedata_frame(style[, auxiliary, boundname])

Return DataFrame of PACKAGEDATA for MODFLOW 6 SFR.

plot([column, cmap, colorbar, ax])

Show map of reaches with inflow segments in royalblue.

plot_profile(segnum[, upstream, downstream, ax])

Plot stream top profiles vs model grid top and bottom.

plot_reaches_vs_model(seg[, dem, ...])

Plot map of stream elevations relative to model surfaces.

route_reaches(start, end, *[, allow_indirect])

Return a list of reach numbers that connect a pair of reaches.

set_package_obj(package[, auxiliary, boundnames])

Set MODFLOW 6 package data to flopy model.

set_reach_data_from_array(name, array)

Set reach data from an array that matches the model (nrow, ncol).

set_reach_data_from_segments(name, value[, ...])

Set reach data based on segment series (or scalar).

set_reach_slope([method, min_slope])

Set slope for reaches.

set_sfr_obj([auxiliary, boundnames])

Set MODFLOW 6 SFR package data to flopy model.

set_tsvar_from_segments(name, data[, where])

Set time-varying data from data defined at segments.

to_pickle(path[, protocol])

Pickle (serialize) non-flopy object data to file.

write_connectiondata(fname)

Write CONNECTIONDATA file for MODFLOW 6 SFR.

write_diversions(fname)

Write DIVERSIONS file for MODFLOW 6 SFR.

write_package_period(package, fname[, ...])

Write PERIOD file for MODFLOW 6 packages, to be used within OPEN/CLOSE.

write_packagedata(fname[, auxiliary, boundname])

Write PACKAGEDATA file for MODFLOW 6 SFR.

Attributes

diversions

[Geo] dataframe of diversions.

model

Flopy model object.

reaches

Geo dataframe of model cell-by-cell reaches.

segments

Geo dataframe of segments.

swn

Surface water network object.