wntr.metrics.water_security module

The wntr.metrics.water_security module contains water security metrics.

Contents

mass_contaminant_consumed(demand, quality[, ...])

Mass of contaminant consumed [USEPA15].

volume_contaminant_consumed(demand, quality)

Volume of contaminant consumed [USEPA15].

extent_contaminant(quality, flowrate, wn[, ...])

Extent of contaminant in the pipes [USEPA15].

wntr.metrics.water_security.mass_contaminant_consumed(demand, quality, detection_limit=0)[source]

Mass of contaminant consumed [USEPA15].

Parameters
  • demand (pandas DataFrame) – A pandas DataFrame containing junction demand (index = times, columns = junction names).

  • quality (pandas DataFrame) – A pandas DataFrame containing junctions water quality (index = times, columns = junction names).

  • detection_limit (float) – Contaminant detection limit.

Returns

A pandas DataFrame containing mass consumed

wntr.metrics.water_security.volume_contaminant_consumed(demand, quality, detection_limit=0)[source]

Volume of contaminant consumed [USEPA15].

Parameters
  • demand (pandas DataFrame) – A pandas DataFrame containing junctions demand (index = times, columns = junction names).

  • quality (pandas DataFrame) – A pandas DataFrame containing junctions water quality (index = times, columns = junction names).

  • detection_limit (float) – Contaminant detection limit

Returns

A pandas DataFrame containing volume consumed

wntr.metrics.water_security.extent_contaminant(quality, flowrate, wn, detection_limit=0)[source]

Extent of contaminant in the pipes [USEPA15].

Parameters
  • quality (pandas DataFrame) – A pandas DataFrame containing node water quality (index = times, columns = node names).

  • flowrate (pandas DataFrame) – A pandas DataFrame containing pipe flowrate (index = times, columns = pipe names).

  • wn (wntr WaterNetworkModel) – Water network model. The water network model is needed to get pipe length, and pipe start and end node.

  • detection_limit (float) – Contaminant detection limit.

Returns

A pandas Series with extent of contamination (m)