Public bug reported:
Currently, hazard calculations are parallelized over sources (i.e. a
task is defined for each source and for the entire set of sites defined
in the configuration file).
However, for regional scale calculations (e.g. Europe) it can happen
that a source (say in North Africa) is assigned to an entire set of
sites that covers entire Europe (from North Africa up to Norway), while
it's clear that a source is only affecting sites close to it (those that
are within the 'maximum_distance' defined in the configuration file).
Currently we are using the NHLIB source filtering mechanism
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/filters.py#L55)
that is passed both to the classical hazard curve calculator
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/hazard_curve.py#L25)
and used in the event based calculator (
https://github.com/gem/oq-
engine/blob/master/openquake/calculators/hazard/event_based/core_next.py#L161)
in order to remove those sites that are too far from the considered
source. However this filtering mechanism requires distance calculation
from the source to the entire set of sites (which is of the order of
100k(s) for regional scale calculations). This calculations need be done
for each source.
We can avoid doing distance calculation for each source, by saving into
the DB the sites locations where hazard results need to be computed for,
create (only once) a geospatial index
(
http://postgis.refractions.net/documentation/manual-1.3/ch03.html) and
for each source query only those sites that are within the bounding box
containing the source 'rupture enclosing polygon' (which is already
saved into the DB). No need to do any distance calculation at the DB
level.
For each source, we can then compute hazard curves/GMFs only for the
sites of interest (for the remaining sites hazard curve and GMFs values
can be set to 0)
In this way we can avoid calling the source site distance filter in both
the classical and event based calculator and just use the rupture site
distance filter
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/filters.py#L75)
which will exclude the sites that are too far from each rupture.
** Affects: openquake
Importance: Undecided
Status: New
--
You received this bug notification because you are subscribed to
OpenQuake.
Matching subscriptions: openquake-bugs
https://bugs.launchpad.net/bugs/1096915
Title:
OQ-Engine: define hazard task only for site close to each source and
not for the entire region of interest
Status in OpenQuake:
New
Bug description:
Currently, hazard calculations are parallelized over sources (i.e. a
task is defined for each source and for the entire set of sites
defined in the configuration file).
However, for regional scale calculations (e.g. Europe) it can happen
that a source (say in North Africa) is assigned to an entire set of
sites that covers entire Europe (from North Africa up to Norway),
while it's clear that a source is only affecting sites close to it
(those that are within the 'maximum_distance' defined in the
configuration file).
Currently we are using the NHLIB source filtering mechanism
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/filters.py#L55)
that is passed both to the classical hazard curve calculator
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/hazard_curve.py#L25)
and used in the event based calculator (
https://github.com/gem/oq-
engine/blob/master/openquake/calculators/hazard/event_based/core_next.py#L161)
in order to remove those sites that are too far from the considered
source. However this filtering mechanism requires distance calculation
from the source to the entire set of sites (which is of the order of
100k(s) for regional scale calculations). This calculations need be
done for each source.
We can avoid doing distance calculation for each source, by saving
into the DB the sites locations where hazard results need to be
computed for, create (only once) a geospatial index
(
http://postgis.refractions.net/documentation/manual-1.3/ch03.html)
and for each source query only those sites that are within the
bounding box containing the source 'rupture enclosing polygon' (which
is already saved into the DB). No need to do any distance calculation
at the DB level.
For each source, we can then compute hazard curves/GMFs only for the
sites of interest (for the remaining sites hazard curve and GMFs
values can be set to 0)
In this way we can avoid calling the source site distance filter in
both the classical and event based calculator and just use the rupture
site distance filter
(
https://github.com/gem/nhlib/blob/master/nhlib/calc/filters.py#L75)
which will exclude the sites that are too far from each rupture.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openquake/+bug/1096915/+subscriptions