nhlibi: calculation results post-processing: mean/quantile curves
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
Medium
|
matley |
Bug Description
Right now the nhlib based psha calculator only calculates plain hazard curves. We need to add post-processing logic that calculates mean/quantile curves as well.
The calculator should read the post_process configuration (for quantile/mean curves computation) from the .ini file in the [output] section. E.g.
[output]
mean_hazard_curves = true
quantile_
see also: https:/
Please mind that with the new calculator mean/quantile curves are calculated differently when no montecarlo sampling is considered.
When no Montecarlo sampling is considered, each path (ergo each realization) has a weight, then a weighted mean/quantile need to be computed (this was pointed out from a conversation with the dr. Monelli).
The output will be serialized into the db as follows:
For mean:
L Output, L HazardCurve L * N HazardCurveData.
where L is the number of Intensity Measure Types (IMTS) and N is the number of sites
For quantile:
L*M Output, L*M HazardCurve, L*M*N HazardCurveData,
where L is the number of IMTs, M is the number of quantile levels
Weighted quantile for a level can be computed as the inverse of the cdf of a discrete distribution where the values are given by the poe at that level (for the different realization) and the probabilities are given by the weights. To this aim, it is possible to use scipy.stats.
def weighted_
result_curve = []
for poes in curves:
sorted_poes = poes[sorted_
cum_weights = numpy.cumsum(
return result_curve
Changed in openquake: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
milestone: | none → 0.8.2 |
tags: | added: hazard nhlibi |
summary: |
- nhlib calculation results post-processing: mean/quantile curves + nhlibi: calculation results post-processing: mean/quantile curves |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in openquake: | |
assignee: | nobody → matley (matley) |
description: | updated |
description: | updated |
Changed in openquake: | |
status: | Confirmed → Fix Committed |
Changed in openquake: | |
status: | Fix Committed → Fix Released |