Hazard+Risk calculations cannot be run on a list of sites

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

Bug Description

You can run a hazard+risk computation on a REGION_VERTEX, but not on a list of SITES.

The reason for this is, the classical risk calculator (for example) reads sites from the exposure input based on the 'region'... but the region is only set if REGION_VERTEX is specified.

There are 2 primary factors involved here:
1) The RiskMandatoryParamsValidator (https://github.com/gem/openquake/blob/fa280a3503853da871d9dbb6b6566fe6547a8d37/openquake/job/config.py#L156) specifies that a risk calculation must contain a REGION_VERTEX and REGION_GRID_SPACING. This is wrong. With this limitation, the hazard calculation phase cannot run on a list of 1 or more sites.
2) The exposure model parser, which is based on the FileProducer class (https://github.com/gem/openquake/blob/fa280a3503853da871d9dbb6b6566fe6547a8d37/openquake/producer.py#L99) requires a RegionConstraint to extract assets. The sites/assets of interest for a risk calculation (at least in the case of Classical Risk) can only be read if the 'region' is available.

For the first issue, I propose that we simply remove these contraints from the validators. Hazard+Risk calculations should be able to run on either a region or a list of sites (this is especially important for QA tests).

For the second issue, we need to refactor the exposure parser to support filtering on a list of sites (not just RegionConstraints).

Tags: risk techdebt
Changed in openquake:
status: New → Incomplete
description: updated
Changed in openquake:
status: Incomplete → Confirmed
assignee: nobody → Lars Butler (lars-butler)
summary: - Classical Hazard+Risk calculations cannot be run on a list of sites
+ Hazard+Risk calculations cannot be run on a list of sites
description: updated
Revision history for this message
Vitor Silva (vitor-silva) wrote :

Lars, regardless the approach (computing the hazard in a grid or reading the sites from the exposure model), a user must always provide the coordinates of a polygon. Even if I'm using the location of the assets, I might want to consider only the assets within a certain region. An example could be, say I have the Switzerland exposure model, and I want to run calculations considering the location of each asset only within a polygon that defines the administrative limits of zurich.

Revision history for this message
Lars Butler (lars-butler) wrote :

Vitor, yes, that's correct. Currently, you select exposure assets from the input model, filtering on the region of interest. The problem is, if you define a list of sites (instead of a region/polygon), the risk engine does not support this.

The risk engine is currently to assume that ALL calculations are on a region/polygon, not on a list of sites. If you run hazard only, you can specify a region or a list of sites; that works. When you throw risk into the mix, it breaks.

John Tarter (toh2)
summary: - Hazard+Risk calculations cannot be run on a list of sites
+ SDAC - Hazard+Risk calculations cannot be run on a list of sites
Changed in openquake:
assignee: Lars Butler (lars-butler) → nobody
tags: added: rsik techdebt
tags: added: risk
removed: rsik
John Tarter (toh2)
summary: - SDAC - Hazard+Risk calculations cannot be run on a list of sites
+ Hazard+Risk calculations cannot be run on a list of sites
Revision history for this message
Lars Butler (lars-butler) wrote :

This works now. Users can run hazard calculations on list of sites using either `sites` (a list of coordinates) or a `sites_csv` (a csv file containing lon,lat).

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.