code: def _lnqmed_residual(catchment):
          
          analysis = QmedAnalysis(catchment, year=2000)  # Probably should set the year to the midpoint of amax rec.
          logmedian_amax = log(analysis.qmed(method='amax_records'))
          logmedian_descr = log(analysis.qmed(method='descriptors'))
          return logmedian_amax - logmedian_descr
docs: Return ln(QMED) model error at a gauged catchment
  
          :param catchment: Gauged catchment
          :type catchment: :class:`Catchment`
          :return: Model error
          :rtype: float