docs: def extract_hmaps(dstore, what):
      """
      Extracts hazard maps. Use it as /extract/hmaps?imt=PGA
      """
      info = get_info(dstore)
      if what == '':  # npz exports for QGIS
          sitecol = dstore['sitecol']
          mesh = get_mesh(sitecol, complete=False)
          dic = _get_dict(dstore, 'hmaps-stats',
                          {imt: info['poes'] for imt in info['imtls']},
                          info['stats'])
          yield from hazard_items(
              dic, mesh, investigation_time=info['investigation_time'])
          return
      params = parse(what, info)
      if 'imt' in params:
          [imt] = params['imt']
          m = info['imt'][imt]
          s = slice(m, m + 1)
      else:
          s = ALL
      if params['rlzs']:
          dset = dstore['hmaps-rlzs']
          for k in params['k']:
              yield 'rlz-%03d' % k, hdf5.extract(dset, ALL, k, s, ALL)[:, 0]
      else:
          dset = dstore['hmaps-stats']
          stats = list(info['stats'])
          for k in params['k']:
              yield stats[k], hdf5.extract(dset, ALL, k, s, ALL)[:, 0]
      yield from params.items()