Skip to content

Commit

Permalink
Merge pull request #9063 from gem/quantiles
Browse files Browse the repository at this point in the history
Optimized the calculation of quantile hazard maps
  • Loading branch information
micheles committed Oct 3, 2023
2 parents c3747b5 + abf2de8 commit c3f56f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
[Michele Simionato]
* Optimized the calculation of quantile hazard maps (7x)
* Internal: stored `_rates` instead of `_poes` in classical calculations

[Lana Todorovic, Anirudh Rao]
* Added several regional liquefaction models to the secondary perils module, including:
ZhuEtAl2017LiquefactionCoastal and ZhuEtAl2017LiquefactionGeneral,
* Added several regional liquefaction models to the secondary perils module,
including:
ZhuEtAl2017LiquefactionCoastal and ZhuEtAl2017LiquefactionGeneral,
RashidianBaise2020Liquefaction, AllstadtEtAl2022Liquefaction,
AkhlagiEtAl2021LiquefactionA and AkhlagiEtAl2021LiquefactionB (experimental),
AkhlagiEtAl2021LiquefactionA and AkhlagiEtAl2021LiquefactionB
(experimental),
Bozzoni2021LiquefactionEurope, TodorovicSilva2022NonParametric
* Added new site parameters required by some of these new models to site.py
* Added LiqOccur as a valid IMT, referring to the occurrence or non-occurrence
of liquefaction at a site
* Added basic documentation for the secondary perils module
* Added LiqOccur as a valid IMT, referring to the occurrence or
non-occurrence of liquefaction at a site
* Added basic documentation for the secondary perils module
(originally written by @cossatot and extended by @LanaTodorovic93)
* Added rock-slope co-seismic failure computation of Grant et al. (2016)

Expand Down
2 changes: 1 addition & 1 deletion openquake/hazardlib/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def quantile_curve(quantile, curves, weights=None):
assert len(weights) == R, (len(weights), R)
result = numpy.zeros(curves.shape[1:])
for idx, _ in numpy.ndenumerate(result):
data = numpy.array([a[idx] for a in curves])
data = curves[(slice(None), ) + idx]
sorted_idxs = numpy.argsort(data)
cum_weights = numpy.cumsum(weights[sorted_idxs])
# get the quantile from the interpolated CDF
Expand Down

0 comments on commit c3f56f0

Please sign in to comment.