Skip to content

Commit

Permalink
Merge pull request #46 from usgs/updates
Browse files Browse the repository at this point in the history
add a default return beta of 1 if the beta calculation fails
  • Loading branch information
dslosky-usgs authored Jun 22, 2021
2 parents 75d5651 + ab99809 commit 123457b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions shakecastaebm/capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,14 @@ def get_capacity(mbt, sdl, bid, height, stories, year, performance_rating='basel
post_yield = post_yield if post_yield else get_post_yield(mbt, bid)
max_strength = max_strength if max_strength else get_max_strength(pre_yield, post_yield, modal_weight, design_coefficient)
ductility = ductility if ductility else get_ductility(stories)
default_damage_state_beta = (
default_damage_state_beta if default_damage_state_beta else
get_default_damage_state_beta(quality_rating, performance_rating, year, stories)
)

try:
default_damage_state_beta = (
default_damage_state_beta if default_damage_state_beta else
get_default_damage_state_beta(quality_rating, performance_rating, year, stories)
)
except:
default_damage_state_beta = 1

yield_point = get_yield_point(design_coefficient, elastic_period, modal_weight, pre_yield)
ultimate_point = get_ultimate_point(ductility, yield_point['disp'], yield_point['acc'], post_yield)
Expand Down

0 comments on commit 123457b

Please sign in to comment.