gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
378 stars 273 forks source link

Improve error message in ShakeMap calculations #7216

Closed CatalinaYepes closed 2 years ago

CatalinaYepes commented 2 years ago

When working with a large number of sites, the following error can appear:

/site-packages/numpy/linalg/linalg.py", line 100, in _raise_linalgerror_nonposdef
    raise LinAlgError("Matrix is not positive definite")
numpy.linalg.LinAlgError: Matrix is not positive definite

We can improve the error message. For instance:

Correlation matrix is not positively defined.
Try to reduce number of hazard sites, or set to `no` the parameters `spatial_correlation` and `cross_correlation`.
Mor info at https://docs.openquake.org/oq-engine/advanced/risk-features.html#correlation
micheles commented 2 years ago

I need an example calculation raising the error, @CatalinaYepes