CHT Queries for eq catalogue db.

Bug #979915 reported by Giuseppe Vallarelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Medium
Giuseppe Vallarelli

Bug Description

The purpose of this bug is to define the queries needed for the Earthquake Catalogue Tool.

Example Queries are the following:

1 - Find all events in the catalogue that have a "Mw" magnitude AND a "mb" magnitude
2 - Find all events that have agency [e.g. ISC] AND "Ms" magnitude AND a "mb" magnitude
3 - Find all events that have a Ms solution for both Agency 1 (ISC) AND Agency 2 (BJI)
4 - Find all events that have magnitude type Mw for Agency 1 (e.g. HVRD), AND magnitude type Ms for Agency 2 (e.g. ISC)

All of the above could be applied to a subset of the catalogue that is defined on the basis of time and or spatial dimension:
- events later than (e.g. 1970) or for events before (e.g. 1995), or for events later than (e.g. 1960) AND before (e.g. 2000).
- events inside polygon [Lon, Lat, Lon, Lat, ... Lon, Lat],
- events within a distance of (e.g. 300 km) from point (Lon, Lat),
- events inside polygon [Lon, Lat, Lon, Lat, ... Lon, Lat] AND with depth less than (e.g. 50 km)
- events inside polygon [Lon, Lat, Lon, Lat, ... Lon, Lat] AND with depth greater than (e.g. 20 km) AND less than (e.g. 50 km)
- events within a distance of (e.g. 300 km) from point (Lon, Lat) AND depth greater than (e.g. 20 km) AND less than (e.g. 50 km)

Revision history for this message
Graeme Weatherill (graeme-9) wrote :

The attached files contain the first set of queries for the Myanmar sample catalogue (myanmar_sample_catalogue_for_queries.csv) and some expected results

Revision history for this message
Graeme Weatherill (graeme-9) wrote :
Revision history for this message
matley (matley) wrote :

AFAIK, the goal should be to query for events having a distance < threshold from a source model (let's start with area source model and simple fault source) where threshold is given in input.

Then, this base query can be refined as the user must be able to filter results by providing in input datetime, depth, magnitude and agency.

IMHO the catalog filter API should look like:

# e.g.
a_source_model = SimpleFaultSource(**params_to_create_this_object)
Event.from(a_source_model).filter(distance__lt=5000, magnitude__lt=3000).exclude(agency='ISC')

where #filter and #exclude return a Queryset object that implements a python iterator that is lazy in querying the db.

matley (matley)
summary: - ECT Queries for eq catalogue db.
+ CHT Queries for eq catalogue db.
Revision history for this message
Graeme Weatherill (graeme-9) wrote :

Some changes to the test data:

test_query_input_catalogue.csv - Revised short catalogue for testing

matley (matley)
Changed in openquake:
status: New → 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.