gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Disaggregation by MDE does not work for NBCC2015_AA13 #8352

Closed Shreyasvi91 closed 1 year ago

Shreyasvi91 commented 1 year ago

While performing disaggregation for Canada, NBCC2015_AA13 shows an error that corresponds to this line in the GMPE. I tried with a small disaggregation demo we have in our engine and the error persists. The error is as shown below.

2023-01-17T17:16:11.16,INFO,MainProcess/2159716,Sent 93 compute_disagg tasks, 226.68 MB in 0 seconds

2023-01-17T17:16:14.39,INFO,MainProcess/2159716,Received {} in 3 seconds from compute_disagg

2023-01-17T17:16:14.40,CRITICAL,MainProcess/2159716,

2023-01-17T17:16:15.14,CRITICAL,MainProcess/2159716,Traceback (most recent call last):
  File "/opt/openquake/oq-engine/openquake/engine/engine.py", line 280, in run_calc
    calc.run(shutdown=True)
  File "/opt/openquake/oq-engine/openquake/calculators/base.py", line 241, in run
    self.result = self.execute()
  File "/opt/openquake/oq-engine/openquake/calculators/disaggregation.py", line 247, in execute
    return self.full_disaggregation()
  File "/opt/openquake/oq-engine/openquake/calculators/disaggregation.py", line 329, in full_disaggregation
    return self.compute()
  File "/opt/openquake/oq-engine/openquake/calculators/disaggregation.py", line 386, in compute
    results = smap.reduce(self.agg_result)
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 875, in reduce
    return self.submit_all().reduce(agg, acc)
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 587, in reduce
    for result in self:
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 575, in __iter__
    yield from self._iter()
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 545, in _iter
    val = result.get()
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 393, in get
    raise etype(msg)
ValueError: 
  File "/opt/openquake/oq-engine/openquake/baselib/parallel.py", line 416, in new
    val = func(*args)
  File "/opt/openquake/oq-engine/openquake/calculators/disaggregation.py", line 158, in compute_disagg
    matrix = weighted_disagg(close, cmaker, g_by_z[s],
  File "/opt/openquake/oq-engine/openquake/calculators/disaggregation.py", line 185, in weighted_disagg
    return disagg.disaggregate(close, cmaker, g_by_z,
  File "/opt/openquake/oq-engine/openquake/hazardlib/calc/disagg.py", line 169, in disaggregate
    mean_std = cmaker.get_mean_stds([ctx])[:2]  # (2, G, M, U)
  File "/opt/openquake/oq-engine/openquake/hazardlib/contexts.py", line 1071, in get_mean_stds
    adj = compute(gsim, ctx, self.imts, *out[:, g, :, slc])
  File "/opt/openquake/oq-engine/openquake/hazardlib/gsim/can15/nbcc2015_aa13.py", line 129, in compute
    [mag] = np.unique(np.round(ctx.mag, 6))
ValueError: too many values to unpack (expected 1)
micheles commented 1 year ago

I need the files to reproduce this.