gfail.models.zhu_2017

class gfail.models.zhu_2017.Zhu2017Model(shakefile, config, bounds=None, uncertfile=None, trimfile=None, slopefile=None, saveinputs=False)[source]

Bases: LogisticModelBase

Initialize LogisticModelBase object.

Parameters
  • shakefile (str) – Path to ShakeMap grid.xml file.

  • config (dict) – Dict like object as a result of reading in “logbase” format INI files.

  • bounds (dict) – Fields are ‘xmin’, ‘xmax’, ‘ymin’, ‘ymax’.

  • uncertfile (str) – Path to ShakeMap uncertainty.xml file.

  • trimfile (str) – Path to shapefile to use for masking ocean pixels.

  • slopefile (str) – File containing slope data to be used for slope masking.

  • saveinputs (bool) – Save input layer grids with model output.

Notes: All input data grids are loaded in one at a time, and saved to a temporary folder that is deleted when the object is deleted. The file names loaded are stored in the self.layers dictionary.

COEFFS = {'b0': 8.801, 'b1': 0.334, 'b2': -1.918, 'b3': 0.0005408, 'b4': -0.2054, 'b5': -0.0333}
TERMS = {'b1': 'np.log(pgv._data*(1/(1+np.power(2.71828,-2*(MW-6)))))', 'b2': 'np.log(vs30._data)', 'b3': 'precip._data', 'b4': 'np.minimum(dc._data, dr._data)', 'b5': 'wtd._data'}
TERMLAYERS = {'b1': 'pgv', 'b2': 'vs30', 'b3': 'precip', 'b4': 'dc, dr', 'b5': 'wtd'}
pre_process(key, grid)[source]

This method should be implemented by child classes.

modify_slope(slope)[source]

Perform modifications to slope to convert to degrees.

calculate_coverage(P)[source]

This method should be implemented by child classes.

calculate_uncertainty()[source]

This method should be implemented by child classes.

modify_probability(P)[source]

This method should be implemented by child classes.