Lib_frag module
- opseestools.Lib_frag.calculate_fragility(df, limit_name, limits, IM_column, EDP_column, plot=True)
Function to calculate fragility based on a dataframe. The dataframe must have a column named bin which containst the values for the intensity measure. It also must have a column that you
- Inputs:
df: dataframe limit_name: how you want to name your limits limits: values to define the limits column_limit: dataframe column to check the exceedance of the values in limits plot: by default is True, meaning that it returns the plots. Set to false if you do not want them
- Outputs:
thetas: median of the lognormal distribution betas: deviation of the lognormal distribution
- opseestools.Lib_frag.calculate_vulnerability(thetas, betas, ratios=[0.05, 0.3, 0.65, 1.0], x=numpy.linspace)
Calculates the vulnerability function based on thetas and betas
- Parameters:
thetas (list of float) – Theta of the fragility function.
betas (list float) – beta of the fragility function.
ratios (list of floats, optional) – ratios of the damage states costs. The default is [0.05,0.3,0.65,1.0].
x (list of floats, optional) – range for plotting
- Returns:
x (float.) – range for ploting
vul (float) – vulnerability values
- opseestools.Lib_frag.fn_mle_pc(IM, num_gmrs, num_collapse)
- opseestools.Lib_frag.mlefit(theta, num_gmrs, num_collapse, IM)
- opseestools.Lib_frag.plotfrag(theta, beta, x=numpy.linspace)
- opseestools.Lib_frag.values_in_bins(data, bins='fd')
Divide the values of a NumPy array into histogram bins and return the values in each bin.
Parameters: - data: NumPy array of data points. - bins: Number of bins or a sequence of bin edges.
Returns: - bins_values: A list of NumPy arrays, each containing the values in each bin. - bin_edges: The edges of the bins. - bin_midpoint: midpoint of the bin