geoprior.scripts.plot_uncertainty#

Script helpers for plotting uncertainty diagnostics.

Functions

interval_stats(df, *, by_horizon[, lower, ...])

Coverage + sharpness for the 80% interval.

main([argv, prog])

per_horizon_from_phys(meta)

Extract per-horizon coverage/sharpness from GeoPrior JSON.

plot_fig5_uncertainty(*, ns_df, zh_df, ...)

Fig. 5:

plot_fig5_uncertainty_main([argv, prog])

plot_horizon_row(fig, gs_row, rel_items, *, ...)

Row of mini reliability panels (H1..Hk).

plot_radial(ax, stats_h, *, city, color, ...)

plot_reliability(ax, rel, *, city, color, ...)

quantile_reliability(df, *, by_horizon[, ycol])

Empirical Pr(Y <= q_pred) versus nominal q.

geoprior.scripts.plot_uncertainty.quantile_reliability(df, *, by_horizon, ycol='subsidence_actual')[source]#

Empirical Pr(Y <= q_pred) versus nominal q.

If by_horizon=True, returns:

forecast_step, nominal, empirical

else:

nominal, empirical

Parameters:
Return type:

DataFrame

geoprior.scripts.plot_uncertainty.interval_stats(df, *, by_horizon, lower='subsidence_q10', upper='subsidence_q90', ycol='subsidence_actual')[source]#

Coverage + sharpness for the 80% interval.

If by_horizon=True:

forecast_step, coverage80, sharpness80

else:

one-row DataFrame with coverage80, sharpness80

Parameters:
Return type:

DataFrame

geoprior.scripts.plot_uncertainty.per_horizon_from_phys(meta)[source]#

Extract per-horizon coverage/sharpness from GeoPrior JSON.

Expected:
per_horizon:

coverage80: {“H1”:…, “H2”:…} sharpness80: {“H1”:…, “H2”:…}

Returns empty DataFrame if missing.

Parameters:

meta (dict[str, Any])

Return type:

DataFrame

geoprior.scripts.plot_uncertainty.plot_reliability(ax, rel, *, city, color, show_point_values, show_legend, show_labels, show_ticklabels, show_panel_titles, title_txt)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_uncertainty.plot_horizon_row(fig, gs_row, rel_items, *, horizons, show_mini_titles, show_mini_legend, show_labels, show_ticklabels)[source]#

Row of mini reliability panels (H1..Hk).

Each mini panel shows:
  • y=x diagonal

  • one curve per city in rel_items

rel_items is:

[(city_name, rel_by_h_df, color), …]

where rel_by_h_df has:

forecast_step, nominal, empirical

Parameters:
Return type:

None

geoprior.scripts.plot_uncertainty.plot_radial(ax, stats_h, *, city, color, title_mode, show_ticklabels, show_panel_titles)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_uncertainty.plot_fig5_uncertainty(*, ns_df, zh_df, ns_meta, zh_meta, split_ns, split_zh, out, out_csv, dpi, font, show_legend, show_labels, show_ticklabels, show_title, show_panel_titles, show_point_values, show_mini_titles, show_mini_legend, show_json_notes, radial_title, title)[source]#
Fig. 5:
  • Top row: per-city reliability (overall)

  • Mid row: per-horizon mini reliability (all cities)

  • Bot row: per-city radial sharpness (edge cov err)

Supports 1-city and 2-city layouts.

Parameters:
Return type:

None

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

None

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

None