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
380 stars 275 forks source link

Extract disagg_layer for LonLat #5791

Closed micheles closed 4 years ago

micheles commented 4 years ago

@ptormene says that it fails for the Colombia calculation with this error:

ValueError: could not broadcast input array from shape (8,5,5) into shape (8,5,4)
  File "/home/paolo/projects/oq-engine/openquake/server/views.py", line 735, in extract
    aw = _extract(ds, what + query_string)
  File "/home/paolo/projects/oq-engine/openquake/calculators/extract.py", line 184, in _call_
    data = self[k](dstore, v)
  File "/home/paolo/projects/oq-engine/openquake/calculators/extract.py", line 1196, in extract_disagg_layer
    rec['poes'] = grp[label][()]
micheles commented 4 years ago

The underlying problem problem is hard: not only the Lon_Lat bins are site-dependent (which is fine), but also the number of Lon_Lat bins is site-dependent (which is bad)! So we have to change the function generating the Lon_Lat bins in such a way to preserve the number of bins.