Classical risk calculator is checking sites outside of the region of interest

Bug #885612 reported by Lars Butler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Medium
Unassigned

Bug Description

[et=unknown]
[at=]

Reproducible by running the classical_psha_based_risk demo.

Here is a snippet of the output of this demo:
$ bin/openquake --config_file=demos/classical_psha_based_risk/config.gem --debug=debug
Ignoring GROUND_MOTION_CORRELATION in classical, it's meaningful only in deterministic, event_based
Ignoring GMF_RANDOM_SEED in classical, it's meaningful only in deterministic, event_based
Ignoring NUMBER_OF_SEISMICITY_HISTORIES in classical, it's meaningful only in event_based
Ignoring unknown parameter 'HAZARD_MAP_CPT'
No handlers could be found for logger "amqplib"
INFO:oq.job.106.supervisor:Entering supervisor for job 106
[2011-11-03 10:38:28,397 #106 - INFO MainProcess/27090 supervisor] Entering supervisor for job 106
DEBUG:root:Point (col 4 row 0) at 15.64 38.01 isn't on grid
DEBUG:root:Point (col 4 row 1) at 15.64 38.05 isn't on grid
DEBUG:root:Point (col 4 row 2) at 15.64 38.09 isn't on grid
DEBUG:root:Point (col 4 row 3) at 15.64 38.13 isn't on grid
DEBUG:root:Point (col 4 row 4) at 15.64 38.17 isn't on grid
DEBUG:root:Point (col 4 row 5) at 15.64 38.21 isn't on grid
DEBUG:root:Point (col 4 row 6) at 15.64 38.25 isn't on grid
DEBUG:root:Point (col 4 row 7) at 15.64 38.29 isn't on grid

The debug messages containing "Point x at y isn't on grid" shouldn't even be appearing. I think there is a bug here in the classical risk calculator; the calculator should just ignore these sites (and we should not get this debug message). (See related bug # 838973.)

Tags: risk
John Tarter (toh2)
Changed in openquake:
milestone: none → 0.4.6
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Lars Butler (lars-butler)
Changed in openquake:
assignee: Lars Butler (lars-butler) → nobody
importance: High → Medium
milestone: 0.4.6 → none
Revision history for this message
Anton Gritsay (angri) wrote :

For some combinations of REGION_VERTEX and REGION_GRID_SPACING this bug can lead to crash with the following traceback:

Task openquake.risk.job.general.compute_risk[6bec94a8-fdca-4a30-ad2f-013eef8e5436] raised exception: ObjectDoesNotExist('HazardCurveData matching query does not exist.',)
Traceback (most recent call last):
  File "/home/angri/projects/oq/lib-python/celery-2.3.1-py2.7.egg/celery/execute/trace.py", line 36, in trace
    return cls(states.SUCCESS, retval=fun(*args, **kwargs))
  File "/home/angri/projects/oq/lib-python/celery-2.3.1-py2.7.egg/celery/app/task/__init__.py", line 230, in __call__
    return self.run(*args, **kwargs)
  File "/home/angri/projects/oq/lib-python/celery-2.3.1-py2.7.egg/celery/app/__init__.py", line 142, in run
    return fun(*args, **kwargs)
  File "/home/angri/projects/oq/openquake/openquake/risk/job/general.py", line 130, in compute_risk
    return mixed.compute_risk(block_id, **kwargs)
  File "/home/angri/projects/oq/openquake/openquake/risk/job/classical_psha.py", line 91, in compute_risk
    return self._compute_bcr(block_id)
  File "/home/angri/projects/oq/openquake/openquake/risk/job/classical_psha.py", line 131, in _compute_bcr
    hazard_curve = self._get_db_curve(point.site)
  File "/home/angri/projects/oq/openquake/openquake/risk/job/classical_psha.py", line 76, in _get_db_curve
    where=["ST_GeoHash(location, 12) = %s"], params=[gh]).get()
  File "/home/angri/projects/oq/lib-python/Django-1.2.5-py2.7.egg/django/db/models/query.py", line 347, in get
    % self.model._meta.object_name)
DoesNotExist: HazardCurveData matching query does not exist.

In particular this error can be triggered by changing the value of REGION_GRID_SPACING from 0.04 to 0.1 in classical_psha_based_risk demo.

John Tarter (toh2)
Changed in openquake:
milestone: none → 0.5.1
John Tarter (toh2)
tags: added: risk
Revision history for this message
Lars Butler (lars-butler) wrote :

>>> Reproducible by running the classical_psha_based_risk demo.

This isn't true anymore. When I completed the classical risk QA test, I eliminated the ginormous input model files and replaced them with simpler ones.

Here's what we need to consider in order to design a proper solution for this defect"
- What is the region/site list of interest?
- What are the sites in the input exposure model?
- Based on the two above geometry definitions, what is the _actual_ risk calculation region/site-list of interest? And how do we determine it?

We're also going to need to think about how decoupling (temporally and otherwise) of the hazard and risk engines will affect the geometry calculation logic. (Right now, if you run a hazard+risk calculation, the specified geometry is ignored--I think--and is replace with a geometry derived from the exposure model... we need to confirm this; my memory is a bit fuzzy.)

description: updated
John Tarter (toh2)
Changed in openquake:
milestone: 0.5.1 → 0.6.0
Revision history for this message
Lars Butler (lars-butler) wrote :

No longer an issue.

Changed in openquake:
status: Confirmed → Fix Committed
Changed in openquake:
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.