code: def get_pmap_from_nrml(oqparam, fname):
      
      hcurves_by_imt = {}
      oqparam.hazard_imtls = imtls = {}
      for hcurves in nrml.read(fname):
          imt = hcurves['IMT']
          oqparam.investigation_time = hcurves['investigationTime']
          if imt == 'SA':
              imt += '(%s)' % hcurves['saPeriod']
          imtls[imt] = ~hcurves.IMLs
          data = sorted((~node.Point.pos, ~node.poEs) for node in hcurves[1:])
          hcurves_by_imt[imt] = numpy.array([d[1] for d in data])
      lons, lats = [], []
      for xy, poes in data:
          lons.append(xy[0])
          lats.append(xy[1])
      mesh = geo.Mesh(numpy.array(lons), numpy.array(lats))
      num_levels = sum(len(v) for v in imtls.values())
      array = numpy.zeros((len(mesh), num_levels))
      imtls = DictArray(imtls)
      for imt_ in hcurves_by_imt:
          array[:, imtls(imt_)] = hcurves_by_imt[imt_]
      return mesh, ProbabilityMap.from_array(array, range(len(mesh)))
docs: :param oqparam:
          an :class:`openquake.commonlib.oqvalidation.OqParam` instance
      :param fname:
          an XML file containing hazard curves
      :returns:
          site mesh, curve array