code: def get_pmap_from_csv(oqparam, fnames):
      
      if not oqparam.imtls:
          oqparam.set_risk_imtls(get_risk_models(oqparam))
      if not oqparam.imtls:
          raise ValueError('Missing intensity_measure_types_and_levels in %s'
                           % oqparam.inputs['job_ini'])
  
      dic = {wrapper.imt: wrapper.array
             for wrapper in map(writers.read_composite_array, fnames)}
      array = dic[next(iter(dic))]
      mesh = geo.Mesh(array['lon'], array['lat'])
      num_levels = sum(len(imls) for imls in oqparam.imtls.values())
      data = numpy.zeros((len(mesh), num_levels))
      level = 0
      for im in oqparam.imtls:
          arr = dic[im]
          for poe in arr.dtype.names[3:]:
              data[:, level] = arr[poe]
              level += 1
          for field in ('lon', 'lat', 'depth'):  # sanity check
              numpy.testing.assert_equal(arr[field], array[field])
      return mesh, ProbabilityMap.from_array(data, range(len(mesh)))
docs: :param oqparam:
          an :class:`openquake.commonlib.oqvalidation.OqParam` instance
      :param fnames:
          a space-separated list of .csv relative filenames
      :returns:
          the site mesh and the hazard curves read by the .csv files