oq-engine icon indicating copy to clipboard operation
oq-engine copied to clipboard

Extend `oq extract ruptures`

Open raoanirudh opened this issue 2 years ago • 1 comments

A CSV rupture extract command was added in https://github.com/gem/oq-engine/pull/5932, allowing users to extract the full geometries of the ruptures, which is not available through the regular oq export command.

The extract command however, prints the rupture seed rather than the rupture id, making it difficult to associate the rupture geometries to the events and ruptures exported through the regular oq export command.

In use cases such as hazard or loss disaggregation using the event_based calculators, it would also be useful to know the source that generated each rupture.

Also, in most circumstances, the user might wish to extract the full geometry for only a single rupture by providing its rupture id. This is not possible with the current extractor.

Thus, it would be useful to extend the oq extract ruptures command with the following:

  • Printing the rup_id rather than (or in addition to) the rupture seed
  • Adding the source_id field that would allow users to understand which source the rupture belongs to
  • Adding the option to extract a single rupture, given its rup_id

raoanirudh avatar Jul 28 '22 14:07 raoanirudh

The difficult thing here is to make sure that the rupture ID is reproducible, i.e. running twice the same calculation should produce the same IDs, even on different machines. Perhaps this is already the case (but it seems unlikely), I need to check.

micheles avatar Sep 14 '22 07:09 micheles