iwfm.diagnostics.select_parameters

iwfm.diagnostics.select_parameters(node_coords, n_reps, sensitivity=None, bundle=None, param_prefix='PKH', layer=1, min_spacing=None, candidate_nodes=None, diagnostic_weight=0.3, verbose=False)[source]

Select representative nodes for PEST parameter estimation.

Uses a greedy algorithm that balances three criteria: 1. Sensitivity — prefer nodes where parameters have high PEST sensitivity 2. Diagnostic signal — prefer nodes near convergence/residual trouble 3. Spatial coverage — enforce minimum spacing to avoid clustering

Parameters:
  • node_coords (dict or list) – Node coordinates. If dict: {node_id: (x, y)}. If list of (x, y), indexed 1-based (node 1 = index 0).

  • n_reps (int) – Number of representative nodes to select.

  • sensitivity (dict, optional) – From read_pest_sensitivity: {param_name: {sensitivity: float}}. Used to score nodes by their parameter’s sensitivity.

  • bundle (DiagnosticBundle, optional) – Diagnostic bundle for signal-based scoring.

  • param_prefix (str) – Parameter name prefix for matching sensitivity data. ‘PKH’ for Kh, ‘PL’ for leakance, ‘PN’ for Sy, ‘PS’ for Ss, ‘c_sn’ for stream conductance.

  • layer (int) – Layer number (1-based) for GW params. Ignored for stream.

  • min_spacing (float, optional) – Minimum distance between representatives. If None, computed as domain_extent / (2 * sqrt(n_reps)).

  • candidate_nodes (list of int, optional) – Restrict selection to these node IDs only. If None, all nodes in node_coords are candidates. Use this when only a subset of nodes have PEST parameters in the template file.

  • diagnostic_weight (float) – Weight for diagnostic signals vs sensitivity (0-1). 0 = sensitivity only, 1 = diagnostics only.

  • verbose (bool) – Print progress.

Returns:

  • list of int – Selected representative node IDs (1-based).

  • dict

    Scores: {node_id: {‘sensitivity’: float, ‘diagnostic’: float,

    ’combined’: float}}.