geoprior.scripts.plot_hotspot_analytics#

Script helpers for plotting hotspot analytics.

Functions

build_hotspot_tables(*, city, color, ...)

Build point/year hotspot tables for one city.

exceed_prob_from_quantiles(q10, q50, q90, *, ...)

main([argv, prog])

plot_hotspot_analytics(*, cities, ...[, ...])

plot_hotspot_analytics_main([argv, prog])

Classes

CityHotspotData(city, color, years, ...)

geoprior.scripts.plot_hotspot_analytics.exceed_prob_from_quantiles(q10, q50, q90, *, threshold)[source]#
Parameters:
Return type:

ndarray

class geoprior.scripts.plot_hotspot_analytics.CityHotspotData(city: 'str', color: 'str', years: 'list[int]', base_year: 'int', df_points: 'pd.DataFrame', df_years: 'pd.DataFrame', extent: 'tuple[float, float, float, float]')[source]#

Bases: object

Parameters:
city: str#
color: str#
years: list[int]#
base_year: int#
df_points: DataFrame#
df_years: DataFrame#
extent: tuple[float, float, float, float]#
__init__(city, color, years, base_year, df_points, df_years, extent)#
Parameters:
Return type:

None

geoprior.scripts.plot_hotspot_analytics.build_hotspot_tables(*, city, color, eval_df, fut_df, years, base_year, subsidence_kind, hotspot_q, risk_threshold, use_abs_risk, hotspot_rule, hotspot_abs, risk_min, exposure_df, exposure_col, exposure_default)[source]#

Build point/year hotspot tables for one city.

Robust points:

  • If kind="cumulative", annual rates are derived via diffs. For the first requested year, the previous year is included automatically when available, preferring future data and otherwise evaluation data.

  • The hotspot rule can be percentile, abs, risk, or combo.

  • Risk can be exposure-weighted as \(P * |\Delta s| * exposure\).

Returns CityHotspotData with df_points for the requested per-point metrics and df_years for the requested per-year summaries.

Parameters:
Return type:

CityHotspotData

geoprior.scripts.plot_hotspot_analytics.plot_hotspot_analytics(*, cities, focus_year, grid_res, clip, cmap_metric, cmap_prob, persistence_mode, cluster_top, risk_threshold, show_legend, show_title, show_panel_titles, title, out, out_points, out_years, out_clusters, timeline_mode, timeline_overlay_current, dpi, font, cluster_rank, add_persistence, add_compare, compare_metric, hotspot_rule, hotspot_abs, risk_min, ns_future_b=None, zh_future_b=None, gdf=None)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_hotspot_analytics.plot_hotspot_analytics_main(argv=None, *, prog=None)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_hotspot_analytics.main(argv=None, *, prog=None)[source]#
Parameters:
Return type:

None