geoprior.scripts.plot_hotspot_analytics#
Script helpers for plotting hotspot analytics.
Functions
|
Build point/year hotspot tables for one city. |
|
|
|
|
|
|
|
Classes
|
- geoprior.scripts.plot_hotspot_analytics.exceed_prob_from_quantiles(q10, q50, q90, *, threshold)[source]#
- 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:
- 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
CityHotspotDatawithdf_pointsfor the requested per-point metrics anddf_yearsfor the requested per-year summaries.- Parameters:
city (str)
color (str)
eval_df (DataFrame)
fut_df (DataFrame)
base_year (int)
subsidence_kind (str)
hotspot_q (float)
risk_threshold (float)
use_abs_risk (bool)
hotspot_rule (str)
hotspot_abs (float | None)
risk_min (float | None)
exposure_df (DataFrame | None)
exposure_col (str)
exposure_default (float)
- Return type:
- 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:
cities (list[CityHotspotData])
focus_year (int)
grid_res (int)
clip (float)
cmap_metric (str)
cmap_prob (str)
persistence_mode (str)
cluster_top (int)
risk_threshold (float)
show_legend (bool)
show_title (bool)
show_panel_titles (bool)
title (str | None)
out (str)
out_points (str | None)
out_years (str | None)
out_clusters (str | None)
timeline_mode (str)
timeline_overlay_current (bool)
dpi (int)
font (int)
cluster_rank (str)
add_persistence (bool)
add_compare (bool)
compare_metric (str)
hotspot_rule (str)
hotspot_abs (float | None)
risk_min (float | None)
ns_future_b (str | None)
zh_future_b (str | None)
- Return type:
None