[et=8h]
[at=4h]
Bug # 823801 specifies a NRML XML export format for aggregate loss curves. The database model for agg. loss curves already exists. We need to implement a way of exporting this data from the database into NRML format and connect it up to calculator and/or engine code.
--------
Analysis
--------
From the analysis I've done in the current codebase, the following changes are required to complete this functionality:
- Add a new output type to the DB and corresponding model (new output type: 'agg_loss_curve'). The schema is in place for Aggregate loss curves, but it's not being used.
- Modify the Event-Based Risk calculator to save the aggregate loss curve (there is only 1 per calculation) to the database.
- Create a new XML writer class to write the agg loss curve NRML artifact (see https://github.com/gem/nrml/blob/master/schema/examples/agg-loss-curve.xml).
- Create an aggregate loss curve export function within the newly-created export framework. See https://bugs.launchpad.net/openquake/+bug/934166.
- Write a QA test for the export (to exercise the export agg loss curve CLI functionality).
This needs to be completed and packaged in advance of a course is Pavia March 13th.
Lars is presently building the frame work for this function. When he has completed that, he will do this work.