2.7. floodestimation.analysis — Flood estimation analyses

2.7.1. Analysis — Generic analysis object

class floodestimation.analysis.Analysis(year=None, results_log=None)[source]

Generic analysis object

Parameters:
  • year (float) – Year to base analysis on. Default: current year.
  • results_log (dict) – Dict to store intermediate results

2.7.2. QmedAnalysis — Estimating the median annual flood

class floodestimation.analysis.QmedAnalysis(catchment, gauged_catchments=None, year=None, results_log=None)[source]

Bases: floodestimation.analysis.Analysis

Class to undertake QMED analyses.

Example:

>>> from floodestimation.entities import Catchment, Descriptors
>>> from floodestimation.analysis import QmedAnalysis
>>> catchment = Catchment("Aberdeen", "River Dee")
>>> catchment.descriptors = Descriptors(dtm_area=1, bfihost=0.50, sprhost=50, saar=1000, farl=1, urbext2000=0)
>>> QmedAnalysis(catchment).qmed_all_methods()
{'descriptors': 0.5908579150223052, 'pot_records': None, 'channel_width': None,
'descriptors_1999': 0.2671386414098229, 'area': 1.172, 'amax_records': None}
Parameters:
qmed(method='best', **method_options)[source]

Return QMED estimate using best available methodology depending on what catchment attributes are available.

The preferred/best order of methods is defined by qmed_methods. Alternatively, a method can be supplied e.g. method=’descriptors_1999’ to force the use of a particular method.

method method_options notes
amax_records n/a Simple median of annual maximum flow records using Catchment.amax_records.
pot_records n/a Uses peaks-over-threshold (POT) flow records. Suitable for flow records shorter than 14 years.
descriptors   Synonym for method=descriptors2008.
descriptors2008 as_rural=False donor_catchments=None FEH 2008 regression methodology using Catchment.descriptors. Setting as_rural=True returns rural estimate and setting donor_catchments to a specific list of Catchment object overrides automatic selection of the most suitable donor catchment. An empty list forces no donors to be used at all.
descriptors1999 as_rural=False FEH 1999 regression methodology.
area n/a Simplified FEH 1999 regression methodology using Cachment.descriptors.dtm_area only.
channel_width n/a Emperical regression method using the river channel width only.
Parameters:
  • method (str) – methodology to use to estimate QMED. Default: automatically choose best method.
  • method_options (kwargs) – any optional parameters for the QMED method function, e.g. as_rural=True
Returns:

QMED in m³/s

Return type:

float

qmed_all_methods()[source]

Returns a dict of QMED methods using all available methods.

Available methods are defined in qmed_methods. The returned dict keys contain the method name, e.g. amax_record with value representing the corresponding QMED estimate in m³/s.

Returns:dict of QMED estimates
Return type:dict
urban_adj_factor()[source]

Return urban adjustment factor (UAF) used to adjust QMED and growth curves.

Methodology source: eqn. 8, Kjeldsen 2010

Returns:urban adjustment factor
Return type:float
find_donor_catchments(limit=6, dist_limit=500)[source]

Return a suitable donor catchment to improve a QMED estimate based on catchment descriptors alone.

Parameters:
  • limit (int) – maximum number of catchments to return. Default: 6. Set to None to return all available catchments.
  • dist_limit (float or int) – maximum distance in km. between subject and donor catchment. Default: 500 km. Increasing the maximum distance will increase computation time!
Returns:

list of nearby catchments

Return type:

floodestimation.entities.Catchment

2.7.3. GrowthCurveAnalysis — Estimating the flood growth curve

class floodestimation.analysis.GrowthCurveAnalysis(catchment, gauged_catchments=None, year=None, results_log=None)[source]

Bases: floodestimation.analysis.Analysis

Class to undertake a growth curve analysis.

Parameters:
methods = ('enhanced_single_site', 'single_site', 'pooling_group')

Methods available to estimate the growth curve

distributions = ('glo', 'gev')

Available distribution functions for growth curves

donor_catchments = None

List of donor catchments. Either set manually or by calling GrowthCurveAnalysis.find_donor_catchments() or implicitly when calling growth_curve().

growth_curve(method='best', **method_options)[source]

Return QMED estimate using best available methodology depending on what catchment attributes are available.

method method_options notes
enhanced_single_site distr=’glo’ as_rural=False Preferred method for gauged catchments (i.e. with Catchment.amax_record).
single_site distr=’glo’ Alternative method for gauged catchments. Uses AMAX data from subject station only.
pooling_group distr=’glo’ as_rural=False Only possible method for ungauged catchments.
Parameters:
  • method (str) – methodology to use to estimate the growth curve. Default: automatically choose best method.
  • method_options (kwargs) – any optional parameters for the growth curve method function
Returns:

Inverse cumulative distribution function, callable class with one parameter aep (annual exceedance probability)

Type:

GrowthCurve

similarity_params = {'fpext': (0.2, 0.04), 'saar': (0.5, 0.37, <built-in function log>), 'dtm_area': (3.2, 1.28, <built-in function log>), 'farl': (0.1, 0.05)}

Dict of weighting factors and standard deviation for catchment descriptors to use in calculating the similarity distance measure between the subject catchment and each donor catchment. The dict is structured like this: {parameter: (weight, standard deviation, transform method)}. The transform method is optional and is typically omitted or set to log.

find_donor_catchments(include_subject_catchment='auto')[source]

Find list of suitable donor cachments, ranked by hydrological similarity distance measure. This method is implicitly called when calling the growth_curve() method unless the attribute donor_catchments is set manually.

The results are stored in donor_catchments. The (list of) floodestimation.entities.Catchment will have an additional attribute similarity_dist.

Parameters:include_subject_catchment (str) –
  • auto: include subject catchment if suitable for pooling and if urbext2000 < 0.03
  • force: always include subject catchment
  • exclude: do not include the subject catchment

2.7.4. GrowthCurve — The flood growth curve object

class floodestimation.analysis.GrowthCurve(distr, var, skew, kurtosis=None)[source]

Growth curve constructed using sample L-VAR and L-SKEW.

The GrowthCurve class is callable, i.e. it can be used as a function. It has one parameter aep, which is an annual exceedance probability and can be either a single value or a list of values. In the latter case, a numpy ndarray is returned.

Example:

>>> from floodestimation.analysis import GrowthCurve
>>> growth_curve = GrowthCurve(distr='glo', var=0.2, skew=-0.1, kurtosis=0.185)
>>> growth_curve(aep=0.5)
1.0
>>> growth_curve(aep=[0.1, 0.01, 0.001])
array([ 1.38805928,  1.72475593,  1.98119739])
>>> growth_curve.params
[1.0, 0.1967263286166932, 0.1]
>>> growth_curve.distr_kurtosis
0.175
>>> growth_curve.kurtosis_fit()
0.010000000000000009
distr = None

Statistical distribution function abbreviation, e.g. ‘glo’, ‘gev’. Any supported by the lmoments3 package can be used.

var = None

Sample L-variance (t2)

skew = None

Sample L-skew (t3)

kurtosis = None

Sample L-kurtosis (t4, not used to create distribution function)

distr_f = None

Statistical distribution as scipy rv_continous class, extended with L-moment methods.

params = None

Distribution function parameter. Except for the loc parameter, all other parameters are estimated using the sample variance and skew linear moments.

distr_kurtosis = None

The distribution’s L-kurtosis which may be different from the sample L-kurtosis (t4).

kurtosis_fit()[source]

Estimate the goodness of fit by calculating the difference between sample L-kurtosis and distribution function L-kurtosis.

Returns:Goodness of fit measure
Return type:float