geoprior.scripts.plot_external_validation#

Plot point-support external validation of inferred effective fields.

Panels#

  1. Zhongshan H_eff field with borehole / pumping-test locations (SW1–SW5) and matched pixels.

  2. Borehole-derived compressible thickness vs model H_eff.

  3. Late-step specific capacity vs model effective K.

Inputs#

  • site-level validation table (.csv or .xlsx)

  • full_inputs.npz

  • physics_payload_fullcity.npz

  • optional coord scaler (.joblib)

Outputs#

  • <out>.png

  • <out>.svg

  • optional summary JSON

Functions

annotate_sites(ax, df, *, x_col, y_col[, ...])

apply_no_offset(ax, *[, x, y])

Disable Matplotlib offset/scientific-offset text on linear axes.

build_pixel_table(inputs_npz, payload_npz, ...)

field_extent(pixels[, pad_frac])

grid_mean(x, y, v, *, res, extent)

inverse_txy(coords_bh3, coord_scaler_path)

load_boundary_xy(path)

Load an optional boundary polyline/polygon.

load_npz_dict(path)

mae(x, y)

main([argv, prog])

median_bias(obs, pred)

plot_external_validation(*, site_csv, ...)

plot_external_validation_main([argv, prog])

read_table(path)

reduce_horizon(arr, n_seq, horizon, how)

spearman_rho(x, y)

geoprior.scripts.plot_external_validation.load_npz_dict(path)[source]#
Parameters:

path (str)

Return type:

dict[str, ndarray]

geoprior.scripts.plot_external_validation.read_table(path)[source]#
Parameters:

path (str)

Return type:

DataFrame

geoprior.scripts.plot_external_validation.load_boundary_xy(path)[source]#

Load an optional boundary polyline/polygon.

Preferred behaviour: - if nat.com.utils exposes load_boundary_xy(), use it - otherwise fall back to CSV/XLSX with x/y-like columns

Accepted fallback column names: x, x_m, coord_x y, y_m, coord_y

NaN rows are preserved so multi-part boundaries can be drawn with line breaks.

Parameters:

path (str | None)

Return type:

tuple[ndarray, ndarray] | None

geoprior.scripts.plot_external_validation.apply_no_offset(ax, *, x=True, y=True)[source]#

Disable Matplotlib offset/scientific-offset text on linear axes.

Parameters:
Return type:

None

geoprior.scripts.plot_external_validation.inverse_txy(coords_bh3, coord_scaler_path)[source]#
Parameters:
  • coords_bh3 (ndarray)

  • coord_scaler_path (str | None)

Return type:

ndarray

geoprior.scripts.plot_external_validation.reduce_horizon(arr, n_seq, horizon, how)[source]#
Parameters:
Return type:

ndarray

geoprior.scripts.plot_external_validation.build_pixel_table(inputs_npz, payload_npz, coord_scaler_path, horizon_reducer, site_reducer)[source]#
Parameters:
  • inputs_npz (str)

  • payload_npz (str)

  • coord_scaler_path (str | None)

  • horizon_reducer (str)

  • site_reducer (str)

Return type:

DataFrame

geoprior.scripts.plot_external_validation.grid_mean(x, y, v, *, res, extent)[source]#
Parameters:
Return type:

tuple[ndarray, tuple[float, float, float, float]]

geoprior.scripts.plot_external_validation.field_extent(pixels, pad_frac=0.02)[source]#
Parameters:
Return type:

tuple[float, float, float, float]

geoprior.scripts.plot_external_validation.spearman_rho(x, y)[source]#
Parameters:
Return type:

float

geoprior.scripts.plot_external_validation.mae(x, y)[source]#
Parameters:
Return type:

float

geoprior.scripts.plot_external_validation.median_bias(obs, pred)[source]#
Parameters:
Return type:

float

geoprior.scripts.plot_external_validation.annotate_sites(ax, df, *, x_col, y_col, label_col='well_id', fontsize=8)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_external_validation.plot_external_validation(*, site_csv, full_inputs_npz, full_payload_npz, coord_scaler, out, out_json, horizon_reducer, site_reducer, grid_res, dpi, font, city, show_legend, show_labels, show_ticklabels, show_title, show_panel_titles, title, boundary, paper_format, paper_no_offset)[source]#
Parameters:
  • site_csv (str)

  • full_inputs_npz (str)

  • full_payload_npz (str)

  • coord_scaler (str | None)

  • out (str)

  • out_json (str | None)

  • horizon_reducer (str)

  • site_reducer (str)

  • grid_res (int)

  • dpi (int)

  • font (int)

  • city (str)

  • show_legend (bool)

  • show_labels (bool)

  • show_ticklabels (bool)

  • show_title (bool)

  • show_panel_titles (bool)

  • title (str | None)

  • boundary (str | None)

  • paper_format (bool)

  • paper_no_offset (bool)

Return type:

None

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

None

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

None