geoprior.scripts.summarize_hotspots#

Summarise hotspot point clouds.

  • subsidence level (mm/yr): value

  • anomaly / delta metric (mm/yr): metric_value

Input#

Hotspot CSV produced by the Fig.6 spatial script (e.g., make_figure6_spatial_forecasts.py) with columns:

city, panel, kind, year, coord_x, coord_y, value, hotspot_mode, hotspot_quantile, metric_value, baseline_value, threshold

Only these are required:

city, year, kind, value, metric_value

Output#

A tidy summary grouped by (city, year, kind) with:

n_hotspots value_min, value_mean, value_max metric_min, metric_mean, metric_max baseline_min, baseline_mean, baseline_max (if present) threshold_min, threshold_max (if present)

API conventions#

  • Use scripts.utils.resolve_out_out() for tables/artifacts.

  • Use cfg.OUT_DIR as default output location.

  • Expose a stable main(argv) wrapper.

  • CLI has a program name (hyphenated).

Examples

Write to scripts/out/ by default:
python nat.com/summarize_hotspots.py

–hotspot-csv results/figs/fig6_hotspot_points.csv

Explicit output (relative -> scripts/out/):
python nat.com/summarize_hotspots.py

–hotspot-csv results/figs/fig6_hotspot_points.csv –out fig6_hotspot_summary.csv

Functions

main([argv, prog])

summarize_hotspots(df)

Summarize hotspot points into a group-level table.

summarize_hotspots_main([argv, prog])

geoprior.scripts.summarize_hotspots.summarize_hotspots(df)[source]#

Summarize hotspot points into a group-level table.

Groups:

(city, year, kind)

Returns:

summary DataFrame with stable column ordering.

Parameters:

df (DataFrame)

Return type:

DataFrame

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

None

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

None