Templates

The simplest way to use HazImp is with a template, which sets up a PipeLine to run a collection of Job functions. There are currently templates for wind, earthquake and flood hazard events. Templates take into account internal vulnerability curves and the data flow needed to produce loss information, simplifying the configuration file.

Templates are used to set out the flow of processing invoked in separate Job functions that are then connected into a PipeLine that is subsequently executed.

Note

Because some of the Job functions in the templates are essential, the order of key/value pairs in the configuration files is important. The code will raise a RuntimeError if the order is incorrect, or if a mandatory configuration key is missing. This is even more important if not using the pre-defined templates.

We take the example of the wind_v4 template. It sets up the following job sequence in a specific order:

  1. LOADCVSEXPOSURE - load the exposure data

  2. LOADRASTER - load the hazard raster data

  3. LOADXMLVULNERABILITY - load the vulnerability functions

  4. SIMPLELINKER - select a group of vulnerability functions - some vulnerability files may have multiple sets of curves identified by vulnerabilitySetID

  5. SELECTVULNFUNCTION - link the selected vulnerability function set (specified by the vulnerabilitySetID option) to each exposure asset

  6. LOOKUP - do a table lookup to determine the damage index for each asset, based on the intensity measure level (e.g. the wind speed)

  7. CALCSTRUCTLOSS - combine the calculated damage index with the building value to calculate $$$ loss

  8. SAVE - should speak for itself - saves the building level loss data

  9. SAVEPROVENANCE - saves provenance data (like the version of HazImp, source of the hazard data, etc.)

Available templates

There are currently 6 templates pre-packaged with HazImp (plus one deprecated template). Most are built around wind impacts, but there are also templates for earthquake and flood (both structural and contents losses):

  1. ‘wind_v3’ - (DEPRECATED) a basic wind impact template for structural loss and structural loss ratio.

  2. ‘wind_v4’ - Base wind impact template. Allows user to specify the vulnerability function set in the configuration.

  3. ‘wind_v5’ - Optional categorisation and tabulation of output data.

  4. ‘wind_nc’ - Includes option to permute exposure data for mean and upper limit of impact (structural loss ratio).

  5. ‘earthquake_v1’ - Base earthquake impact template. Allows similar functions (aggregation, permutation, etc.) to the wind_nc template.

  6. ‘flood_fabric_v2’ - calculate structural loss due to flood inundation.

  7. ‘flood_contents_v2’ - contents loss due to flood inundation.