validate_gf_h5

Validate separation-indexed Green-tensor HDF5 output.

The production solver already rejects non-finite values. This module adds a post-run spectral continuity check because adaptive quadrature can return a finite value after emitting an IntegrationWarning. Such values are valid floating-point data but may still be unconverged numerical outliers.

mqed.analysis.validate_gf_h5._spike_records(values: numpy.ndarray, energy_eV: numpy.ndarray, rx_nm: numpy.ndarray, ratio_threshold: float) → list[dict[str, Any]][source]

Return isolated componentwise spectral excursions.

A point is flagged when its magnitude exceeds both adjacent magnitudes by ratio_threshold. Endpoints are compared with their sole neighbor. A small per-component magnitude floor prevents ratios between numerical zeros from being reported without allowing unrelated tensor components to set the comparison scale.

mqed.analysis.validate_gf_h5.main() → int[source]

Run Green-tensor HDF5 validation from the command line.

mqed.analysis.validate_gf_h5.validate_separation_gf_h5(h5_path: str | Path, *, spike_ratio: float = 10.0) → dict[str, Any][source]

Validate one separation-indexed Green-tensor file.

Parameters:
  • h5_path – HDF5 file produced by the planar Green-function solvers.

  • spike_ratio – Minimum center-to-neighbor magnitude ratio used to flag an isolated spectral excursion.

Returns:

A report containing structural errors, finite-value counts, and componentwise outlier coordinates for the scattering tensor.