Use log-log interpolation for hazard map and disaggregation calculations

Bug #1252770 reported by Damiano Monelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Engine
Fix Released
High
Michele Simionato

Bug Description

When deriving a hazard map or when doing a disaggregation calculation, the ground motion value associated to a probability of exceedance value, is computed by performing a liner interpolation between the two closest probability of exceedance values (see https://github.com/gem/oq-engine/blob/master/openquake/engine/calculators/hazard/classical/post_processing.py#L77, https://github.com/gem/oq-engine/blob/master/openquake/engine/calculators/hazard/disaggregation/core.py#L137.

For more precise results the interpolation should be done in log space, that is instead of:

numpy.interp(poes, curve[::-1], imls)

we should use:

10 ** (numpy.interp(numpy.log10(poes), numpy.log10(curve[::-1]),
numpy.log10(imls)))

description: updated
description: updated
Revision history for this message
Michele Simionato (michele-simionato) wrote :

If a curve has zero values, or extremely small values, we use a cutoff to avoid issues with the logarithm. We choose 1e-30 as a reasonable value for the cutoff (notice that in postgres poes are stored as 32 bit floats and the minimum possible float is 1e-38).

See https://github.com/gem/oq-engine/pull/1338 for the implementation.

Changed in oq-engine:
assignee: nobody → Michele Simionato (michele-simionato)
milestone: none → 1.0.1
importance: Undecided → High
status: New → Fix Committed
Changed in oq-engine:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.