Skip to content

Several redundant functions for fitting exceedance freq to return periods #904

Open
@ValentinGebhart

Description

@ValentinGebhart

Is your feature request related to a problem? Please describe.
There are several functions that do the same computation (fitting the relation between exceedance frequency and return periods) but in different interpolation ways. They might be worth to combine. The ones I can find now are:

  1. Impact.calc_freq_curve
    impact exceedance frequency curve (aggregated over centroids)
    method: np.interp(freq_cum, imp)
  2. Impact.local_exceedance_imp using loc_return_impusing _cen_return_imp
    impact exceedance frequency per centroid for several return periods
    method: np.polyfit( np.log(freq_cum), imp, deg = 1)
  3. Hazard.local_exceedance_inten using _loc_return_inten using _cen_return_inten
    hazard exceedance frequency per centroid for several return periods
    method: np.polyfit( np.log(freq_cum), haz, deg = 1)
  4. Hazard.local_return_period using _loc_return_period
    return period per centroid for several threshold intensities
    method: np.searchsorted() (i.e. fitting a step function between haz and freq_cum)

Describe the solution you'd like
We could write one or two flexible functions that do the computation for all above cases, and maybe some wrapper functions.

Describe alternatives you've considered
None
Additional context
related to issue #209

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions