analysis package#
Submodules#
PyHydroGeophysX.analysis.sensitivity module#
Sensitivity and resolution analysis utilities.
- PyHydroGeophysX.analysis.sensitivity.compute_cumulative_sensitivity(J: Any) Any[source]#
Compute cumulative sensitivity as absolute column sums of the Jacobian.
- PyHydroGeophysX.analysis.sensitivity.compute_depth_of_investigation(inv_class: Any, data: Any, mesh: Any, scale_low: float = 0.8, scale_high: float = 1.2, reference_resistivity: float | None = None) Tuple[ndarray, Dict[str, ndarray]][source]#
Estimate DOI using two inversions with different reference/initial models.
This follows the Oldenburg-Li style idea of quantifying model sensitivity to reference-model choice. The two starting models are
reference_resistivity * scale_lowandreference_resistivity * scale_high; whenreference_resistivityis None it is taken as the median apparent resistivity ofdataso the perturbation brackets the survey’s actual background instead of an arbitrary absolute value.The index is only as meaningful as the inversion’s use of its reference.
ERTInversionregularizes with first-order smoothness, which ignores a homogeneous reference, so give it areference_weightfor this (a smallness term, as Oldenburg and Li (1999) use). Let both runs converge as well: a run stopped at its target misfit keeps its starting model wherever the data are weak, and the index then reflects where each run stopped. A cell that follows its reference completely scores(scale_high - scale_low) / (scale_high + scale_low); dividing by it gives Oldenburg and Li’s index, from 0 to 1.
- PyHydroGeophysX.analysis.sensitivity.compute_resolution_matrix(J: Any, Wd: Any, Wm: Any, lam: Any) Any[source]#
Compute model resolution matrix:
R = (J^T Wd^T Wd J + lam Wm^T Wm)^(-1) J^T Wd^T Wd J
Wdwhitens the data, so the data term is(Wd J)^T (Wd J). A whitening matrix need not be symmetric (the inverse Cholesky factor of a data covariance is triangular), andJ^T Wd Wd J, which this used to form, is then a different matrix; for a symmetric or diagonalWdthe two are the same.lhsis the Gauss-Newton normal matrix, which is symmetric positive definite, so the inverse is applied as a Cholesky solve rather than formed. The two agree here to within 5e-9 across condition numbers from 1e4 to 1e8, so this is a cost change rather than an accuracy one: the pseudo-inverse it replaces is an SVD, measured at 16.5 times the Cholesky’s runtime for a matrix of order 800.
Module contents#
Sensitivity and resolution analysis utilities.
- PyHydroGeophysX.analysis.compute_cumulative_sensitivity(J: Any) Any[source]#
Compute cumulative sensitivity as absolute column sums of the Jacobian.
- PyHydroGeophysX.analysis.compute_depth_of_investigation(inv_class: Any, data: Any, mesh: Any, scale_low: float = 0.8, scale_high: float = 1.2, reference_resistivity: float | None = None) Tuple[ndarray, Dict[str, ndarray]][source]#
Estimate DOI using two inversions with different reference/initial models.
This follows the Oldenburg-Li style idea of quantifying model sensitivity to reference-model choice. The two starting models are
reference_resistivity * scale_lowandreference_resistivity * scale_high; whenreference_resistivityis None it is taken as the median apparent resistivity ofdataso the perturbation brackets the survey’s actual background instead of an arbitrary absolute value.The index is only as meaningful as the inversion’s use of its reference.
ERTInversionregularizes with first-order smoothness, which ignores a homogeneous reference, so give it areference_weightfor this (a smallness term, as Oldenburg and Li (1999) use). Let both runs converge as well: a run stopped at its target misfit keeps its starting model wherever the data are weak, and the index then reflects where each run stopped. A cell that follows its reference completely scores(scale_high - scale_low) / (scale_high + scale_low); dividing by it gives Oldenburg and Li’s index, from 0 to 1.
- PyHydroGeophysX.analysis.compute_resolution_matrix(J: Any, Wd: Any, Wm: Any, lam: Any) Any[source]#
Compute model resolution matrix:
R = (J^T Wd^T Wd J + lam Wm^T Wm)^(-1) J^T Wd^T Wd J
Wdwhitens the data, so the data term is(Wd J)^T (Wd J). A whitening matrix need not be symmetric (the inverse Cholesky factor of a data covariance is triangular), andJ^T Wd Wd J, which this used to form, is then a different matrix; for a symmetric or diagonalWdthe two are the same.lhsis the Gauss-Newton normal matrix, which is symmetric positive definite, so the inverse is applied as a Cholesky solve rather than formed. The two agree here to within 5e-9 across condition numbers from 1e4 to 1e8, so this is a cost change rather than an accuracy one: the pseudo-inverse it replaces is an SVD, measured at 16.5 times the Cholesky’s runtime for a matrix of order 800.