openquake.hme.model_test_frameworks.gem.gem_test_functionsΒΆ

Utility functions for running tests in the GEM model test framework.

Functions

catalog_ground_motion_eval_fn(test_config, ...)

Compares observed ground motions from a flatfile with model predictions.

get_catalog_moment(eq_df[, eq_groups])

Computes the total seismic moment per spatial cell and overall from an earthquake catalog.

get_closest_rupture(eq, rupture_df)

Returns the rupture closest to the given earthquake in 3D distance.

get_distances(eq, rup_gdf)

Calculates 3D distances between an earthquake and a set of ruptures.

get_flatfile_records_for_eq(event_id, gm_df)

Returns all flatfile records for a given earthquake event ID.

get_matching_rups(eq, rup_gdf[, ...])

Finds and ranks modeled ruptures that match an observed earthquake.

get_moment_from_mfd(mfd)

Calculates total seismic moment from an MFD dictionary.

get_nearby_rups(eq, rup_df)

Finds ruptures in the earthquake's H3 cell and its immediate neighbors.

get_rups_in_mag_range(eq, rup_df[, mag_window])

Filters ruptures to those within a magnitude window of the earthquake.

get_rupture_gdf_cell_moment(rupture_gdf, t_yrs)

Computes the expected seismic moment per spatial cell and total, given rupture occurrence rates scaled by duration.

mag_diff_likelihood(eq_mag, rup_mags[, ...])

Calculates a linear likelihood based on the magnitude difference between an earthquake and candidate ruptures.

match_eqs_to_rups(eq_gdf, rup_gdf[, ...])

Matches all earthquakes in a catalog to their best-matching modeled ruptures using get_matching_rups().

model_mfd_eval_fn(rup_gdf, eq_gdf, mag_bins)

Computes and compares model and observed magnitude-frequency distributions.

moment_over_under_eval_fn(rup_df, eq_gdf, ...)

Compares observed seismic moment release to stochastic moment release from the model, per cell and in total.

predict_gms_for_eq(eq, gm_df, gsim_lt, ...)

Predicts ground motions at recording sites for a given earthquake using the ground motion models from the logic tree, and compares with observed values from the flatfile.

rupture_matching_eval_fn(rup_gdf, eq_gdf[, ...])

Runs the rupture matching evaluation, matching all observed earthquakes to modeled ruptures and collecting matched/unmatched results.