diff --git a/openquake/calculators/extract.py b/openquake/calculators/extract.py index 501e63072bd..79ff0777235 100644 --- a/openquake/calculators/extract.py +++ b/openquake/calculators/extract.py @@ -979,9 +979,8 @@ def extract_gmf_npz(dstore, what): # zero GMF yield 'rlz-%03d' % rlzi, [] else: - imts = list(oq.imtls) - sec_imts = oq.sec_imts - gmfa = _gmf(df, n, imts, sec_imts) + prim_imts = list(oq.get_primary_imtls()) + gmfa = _gmf(df, n, prim_imts, oq.sec_imts) yield 'rlz-%03d' % rlzi, util.compose_arrays(sites, gmfa) diff --git a/openquake/calculators/tests/multi_risk_test.py b/openquake/calculators/tests/multi_risk_test.py index 40529792cdf..163021ebb8c 100644 --- a/openquake/calculators/tests/multi_risk_test.py +++ b/openquake/calculators/tests/multi_risk_test.py @@ -32,7 +32,13 @@ def test_case_1(self): # case with volcanic multiperil ASH, LAVA, LAHAR, PYRO self.run_calc(case_1.__file__, 'job.ini') - # check extract + # check extract gmf_data, called by QGIS + aw = extract(self.calc.datastore, 'gmf_data?event_id=0') + ae(len(aw['rlz-000']), 173) + ae(aw['rlz-000'].dtype.names, + ('custom_site_id', 'lon', 'lat', 'ASH', 'LAVA', 'LAHAR', 'PYRO')) + + # check extract exposure_metadata md = json.loads(extract(self.calc.datastore, 'exposure_metadata').json) ae(md['names'], ['value-number', 'value-structural', 'occupants_night']) ae(md['multi_risk'], ['collapse-structural-ASH_DRY', diff --git a/openquake/commonlib/oqvalidation.py b/openquake/commonlib/oqvalidation.py index 032047c64fe..0342a3366a7 100644 --- a/openquake/commonlib/oqvalidation.py +++ b/openquake/commonlib/oqvalidation.py @@ -1697,9 +1697,8 @@ def get_primary_imtls(self): """ :returns: IMTs and levels which are not secondary """ - sec_imts = set(self.sec_imts) or self.inputs.get('multi_peril', ()) return {imt: imls for imt, imls in self.imtls.items() - if imt not in sec_imts} + if imt not in self.sec_imts} def hmap_dt(self): # used for CSV export """ @@ -1840,6 +1839,9 @@ def sec_imts(self): """ :returns: a list of secondary outputs """ + mp = self.inputs.get('multi_peril', ()) + if mp: + return list(mp) # ASH, PYRO, etc outs = [] for sp in self.get_sec_perils(): outs.extend(sp.outputs) diff --git a/openquake/hazardlib/gsim/abrahamson_2014.py b/openquake/hazardlib/gsim/abrahamson_2014.py index 8dc4b899186..f7ef8b66a69 100644 --- a/openquake/hazardlib/gsim/abrahamson_2014.py +++ b/openquake/hazardlib/gsim/abrahamson_2014.py @@ -421,6 +421,7 @@ def get_epistemic_sigma(ctx): return sigma_epi + class AbrahamsonEtAl2014(GMPE): """ Implements GMPE by Abrahamson, Silva and Kamai developed within the