code: def torestfrequency(self, f0, d0):
          
          if is_measure(f0) and f0['type'] == 'frequency' \
                  and is_measure(d0) and d0['type'] == 'doppler':
              return self.torest(f0, d0)
          else:
              raise TypeError('Illegal Doppler or rest frequency specified')
docs: Convert a frequency measure and a doppler measure (e.g.
          obtained from another spectral line with a known rest frequency) to
          a rest frequency.
  
          :param f0: frequency reference code (see :meth:`frequency`)
          :param v0: a doppler measure
  
          Example::
  
              dp = dm.doppler('radio', '2196.24984km/s')  # a measured doppler speed
              f = dm.frequency('lsrk','1410MHz')    # a measured frequency
              dm.torestfrequency(f, dp)        # the corresponding rest frequency