Storage of GMF Scenario IMT information is inconsistent

Bug #1167324 reported by Lars Butler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Engine
Fix Released
High
Michele Simionato

Bug Description

The storage of IMT information for `GmfScenario` results (https://github.com/gem/oq-engine/blob/9b17fe4f7da998716ae8d58eaa897b8d6c350afa/openquake/engine/db/models.py#L2172) is inconsistent with other artifacts, such as hazard curves (https://github.com/gem/oq-engine/blob/9b17fe4f7da998716ae8d58eaa897b8d6c350afa/openquake/engine/db/models.py#L1751).

This causes results exported in XML format to be slightly wrong.

We get this:
<nrml xmlns:gml="http://www.opengis.net/gml" xmlns="http://openquake.org/xmlns/nrml/0.4">
  <gmfSet>
    <gmf IMT="SA(0.1)">
      <node gmv="1.11323674151e-24" lon="0.0" lat="0.1"/>
      <node gmv="1.36015602637e-24" lon="0.0" lat="0.0"/>
      <node gmv="1.37733022435e-24" lon="0.0" lat="0.2"/>
    </gmf>
...

We expect this:
<nrml xmlns:gml="http://www.opengis.net/gml" xmlns="http://openquake.org/xmlns/nrml/0.4">
  <gmfSet>
    <gmf IMT="SA" saPeriod="0.1" saDamping="5.0">
      <node gmv="1.11323674151e-24" lon="0.0" lat="0.1"/>
      <node gmv="1.36015602637e-24" lon="0.0" lat="0.0"/>
      <node gmv="1.37733022435e-24" lon="0.0" lat="0.2"/>
    </gmf>
...

Changed in oq-engine:
assignee: nobody → Michele Simionato (michele-simionato)
Revision history for this message
Michele Simionato (michele-simionato) wrote :

There is an easy fix in the function openquake.engine.db.models.get_gmfs_scenario. I have also added in the export tests a check to make sure that the generate XML is valid for the NRML schema. See https://github.com/gem/oq-engine/pull/1132

matley (matley)
Changed in oq-engine:
status: New → In Progress
Changed in oq-engine:
importance: Undecided → High
Changed in oq-engine:
status: In Progress → Fix Committed
Changed in oq-engine:
milestone: none → 1.0.0
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.