Skip to content

fragility

Hazus 6.1 equivalent-PGA damage at bracketing design levels.

quakecascade.fragility

Hazus 6.1 equivalent-PGA building fragility.

Damage is driven by peak ground acceleration and evaluated with the Hazus lognormal fragility function (FEMA 2024, Hazus 6.1 Earthquake Model Technical Manual, Section 5.4, Equation 5-2)::

P(DS >= ds | PGA) = Phi( ln(PGA / theta_ds) / beta_ds )

with theta_ds the median equivalent PGA of damage state ds and beta_ds the dispersion of its natural logarithm. Discrete damage-state probabilities follow by differencing the exceedance curves.

Calibration

The curves are calibrated for US construction practice: Hazus maps its design levels onto US code eras and its reference demand spectrum onto a large magnitude western-US earthquake at a soil site. Mapping a building stock outside the US onto these design levels is an analyst's assumption, so the year-to-level mapping (design_level_from_year) has no default: the caller supplies the tiers and their source. Bracketing a scenario with several design levels (damage does this by default) shows how much of the answer rests on that assumption.

Source of the arithmetic: PlanX engine/seismic.py (same author), ported without change to the arithmetic. One deliberate change: a non-finite PGA now propagates NaN instead of reading as "no damage" (missing is never zero).

DAMAGE_STATES module-attribute

DAMAGE_STATES = (
    "none",
    "slight",
    "moderate",
    "extensive",
    "complete",
)

Damage-state ladder, lightest first. Index into every per-state array.

HAZUS_DAMAGE_STATES module-attribute

HAZUS_DAMAGE_STATES = (
    "slight",
    "moderate",
    "extensive",
    "complete",
)

The four damage states Hazus tabulates, in its own order.

HAZUS_PGA_BETA module-attribute

HAZUS_PGA_BETA = 0.64

Total dispersion of the equivalent-PGA structural curves (FEMA 2024, Section 5.4.3, Tables 5-37 to 5-40): the SRSS of the damage-state threshold uncertainty beta_M(SPGA) = 0.4 and the spatial variability of long-period demand beta_D(V) = 0.5; sqrt(0.4^2 + 0.5^2) = 0.64, the value printed in all four tables (manual p. 5-65 to 5-66).

HAZUS_PGA_BETA_THRESHOLD module-attribute

HAZUS_PGA_BETA_THRESHOLD = 0.4

The two components of HAZUS_PGA_BETA (same source), kept separately so a simulation can tell the building-specific part (threshold) from the part shared by neighbours through the shaking (demand).

HAZUS_PGA_BETA_DEMAND module-attribute

HAZUS_PGA_BETA_DEMAND = 0.5

The two components of HAZUS_PGA_BETA (same source), kept separately so a simulation can tell the building-specific part (threshold) from the part shared by neighbours through the shaking (demand).

HAZUS_EQUIVALENT_PGA_FRAGILITY module-attribute

HAZUS_EQUIVALENT_PGA_FRAGILITY = ...

Equivalent-PGA structural fragility medians, in g, taken VERBATIM from the Hazus Earthquake Model Technical Manual 6.1 (FEMA, 2024) Section 5.4.3, Tables 5-37 to 5-40. Transcribed from the published PDF, not recalled. Every tabulated dispersion is beta_SPGA = 0.64 = sqrt(0.4^2 + 0.5^2), the SRSS of the damage-state threshold uncertainty and the spatial variability of long-period ground-motion demand (manual p. 5-65). Order within each tuple: (slight, moderate, extensive, complete). None = the manual marks the type as not permitted at that design level.

HAZUS_DESIGN_LEVELS module-attribute

HAZUS_DESIGN_LEVELS = ('pre', 'low', 'moderate', 'high')

Hazus design levels, weakest first. The manual's own terms are Pre-Code, Low-Code, Moderate-Code and High-Code (FEMA 2024, Section 5.4.3).

BUILDING_TYPES module-attribute

BUILDING_TYPES = ...

Hazus base building types offered for height resolution, with the manual's short description (FEMA 2024, Table 5-1). C3, S5 and URM are not listed here because Hazus prints no Moderate-Code or High-Code curve for them; their height-resolved labels (C3L ...) can still be passed directly and are evaluated where the manual tabulates them.

HEIGHT_CLASS_BOUNDARIES module-attribute

HEIGHT_CLASS_BOUNDARIES = (3, 7)

Height-class boundaries in storeys (FEMA 2024, Table 5-1): low-rise 1-3 storeys, mid-rise 4-7, high-rise 8 or more.

normal_cdf

normal_cdf(z)

Standard normal cumulative distribution function, elementwise.

Uses scipy.special.ndtr when SciPy is installed and 0.5 * (1 + erf(z / sqrt(2))) otherwise.

height_class

height_class(floors, default='M')

Height class letter ("L", "M" or "H") for each storey count.

Boundaries from FEMA (2024) Table 5-1. A non-finite storey count gets default; mid-rise is the PlanX screening convention, not a Hazus value, and damage reports every row where it was used.

resolve_building_type

resolve_building_type(
    base_type, floors=None, default_height="M"
)

Hazus label for a base type and storey count, e.g. C1 + 5 -> C1M.

Types Hazus does not split by height (W1, W2, S3, PC1, MH) are returned unchanged, as is a label that already carries its height class (C1L). RM1 and URM have no high-rise class, so tall ones stay mid-rise. When no floor count is available default_height is used.

Raises:

Type Description
ValueError

For an empty or unknown type, so a typo cannot reach the fragility tables as a silent default.

damage_medians

damage_medians(design_levels, building_types)

Median equivalent PGA (g) per damage state, state on axis 0.

Returns an array of shape (4,) + input_shape holding the Slight, Moderate, Extensive and Complete medians (FEMA 2024, Tables 5-37 to 5-40).

Raises:

Type Description
ValueError

For a type the manual does not tabulate at that design level.

damage_probabilities

damage_probabilities(
    im, design_levels, building_types, beta=HAZUS_PGA_BETA
)

Discrete damage-state probabilities for each building.

Parameters:

Name Type Description Default
im float or array_like

Peak ground acceleration in g, broadcastable against the level and type arrays. Zero or negative PGA means no demand (P(none) = 1); a non-finite PGA gives NaN in every state.

required
design_levels str or array_like

Hazus design level(s) and height-resolved label(s).

required
building_types str or array_like

Hazus design level(s) and height-resolved label(s).

required
beta float

Lognormal dispersion; default 0.64 (FEMA 2024, Tables 5-37 to 5-40).

HAZUS_PGA_BETA

Returns:

Type Description
dict

Keyed by every entry of DAMAGE_STATES; values sum to 1 per building where the PGA is finite.

design_level_from_year

design_level_from_year(years, tiers)

Hazus design level for each construction year, from caller-supplied tiers.

Parameters:

Name Type Description Default
years array_like

Construction years.

required
tiers sequence of (max_year, level)

Oldest first, cutoffs strictly increasing. A year at or below a cutoff gets that level. There is no default: which local code era corresponds to which Hazus level is an analyst's judgement that must carry its own source. Use (math.inf, "high") as the last tier to cover every later year.

required

Returns:

Type Description
numpy.ndarray of object

Level names; None where the year is non-finite or newer than the last cutoff, so the gap stays visible (damage reports it as no_design_level).

damage

damage(
    pga_g,
    building_type,
    floors=None,
    design_levels=HAZUS_DESIGN_LEVELS,
    beta=HAZUS_PGA_BETA,
    default_height="M",
)

Damage-state table for a building stock.

Parameters:

Name Type Description Default
pga_g array_like or Series

PGA in g per building. A Series index becomes building_id; otherwise buildings are numbered 0..n-1. NaN PGA -> no_pga.

required
building_type str or array_like

Hazus base type ("C1") or height-resolved label ("C1M"), scalar or per building. A missing type (None, NaN, empty) gives no_building_type rows; an unknown string still raises, so a typo cannot pass as a missing value.

required
floors array_like

Storey counts used to resolve the height class (FEMA 2024, Table 5-1).

None
design_levels str, sequence of str, or array/Series

A string or a list/tuple of level names brackets the scenario: every building is evaluated at each listed level and the table is long, with a design_level column (default: all four Hazus levels). A NumPy array or Series with one level per building (e.g. from design_level_from_year) evaluates each building once at its own level; None entries give no_design_level.

HAZUS_DESIGN_LEVELS
beta float

Lognormal dispersion, default 0.64 (FEMA 2024).

HAZUS_PGA_BETA
default_height ('L', 'M', 'H')

Height class used where floors is missing (PlanX convention: mid-rise). Rows where it was used carry height_assumed = True.

"L"

Returns:

Type Description
DataFrame

building_id, design_level, building_type, height_assumed, pga_g, pe_slight .. pe_complete (exceedance P(DS >= ds)), p_none .. p_complete (discrete state probabilities, summing to 1) and dmg_status: computed, no_building_type, no_pga, no_design_level or no_fragility_curve (type not tabulated at that level, e.g. C3 at High-Code). Non-computed rows carry NaN, never 0.