docs: def get_site_model(oqparam):
      """
      Convert the NRML file into an array of site parameters.
  
      :param oqparam:
          an :class:`openquake.commonlib.oqvalidation.OqParam` instance
      :returns:
          an array with fields lon, lat, vs30, ...
      """
      req_site_params = get_gsim_lt(oqparam).req_site_params
      arrays = []
      for fname in oqparam.inputs['site_model']:
          if isinstance(fname, str) and fname.endswith('.csv'):
              sm = read_csv(fname)
              if 'site_id' in sm.dtype.names:
                  raise InvalidFile('%s: you passed a sites.csv file instead of '
                                    'a site_model.csv file!' % fname)
              z = numpy.zeros(len(sm), sorted(sm.dtype.descr))
              for name in z.dtype.names:  # reorder the fields
                  z[name] = sm[name]
              arrays.append(z)
              continue
          nodes = nrml.read(fname).siteModel
          params = [valid.site_param(node.attrib) for node in nodes]
          missing = req_site_params - set(params[0])
          if 'vs30measured' in missing:  # use a default of False
              missing -= {'vs30measured'}
              for param in params:
                  param['vs30measured'] = False
          if 'backarc' in missing:  # use a default of False
              missing -= {'backarc'}
              for param in params:
                  param['backarc'] = False
          if missing:
              raise InvalidFile('%s: missing parameter %s' %
                                (oqparam.inputs['site_model'],
                                 ', '.join(missing)))
          # NB: the sorted in sorted(params[0]) is essential, otherwise there is
          # an heisenbug in scenario/test_case_4
          site_model_dt = numpy.dtype([(p, site.site_param_dt[p])
                                       for p in sorted(params[0])])
          sm = numpy.array([tuple(param[name] for name in site_model_dt.names)
                            for param in params], site_model_dt)
          arrays.append(sm)
      return numpy.concatenate(arrays)