code: def doppler(self, rf='', v0=0.0, off=None):
          
          if isinstance(v0, float):
              v0 = str(v0)
          loc = {'type': "doppler",
                 'refer': rf,
                 'm0': dq.quantity(v0)}
          if is_measure(off):
              if not off['type'] == "doppler":
                  raise TypeError('Illegal offset type specified.')
              loc["offset"] = off
          return self.measure(loc, rf)
docs: Defines a doppler measure. It has to specify a reference code,
          doppler quantity value (see introduction for the action on a scalar
          quantity with either a vector or scalar value, and when a vector of
          quantities is given), and optionally it can specify an offset, which
          in itself has to be a doppler.
  
          :param rf: reference code string; Allowable reference
                     codes are: *RADIO OPTICAL Z RATIO RELATIVISTIC BETA GAMMA*.
                     Note that additional ones may become available. Check with::
  
                         dm.list_codes(dm.doppler())
  
          :param v0: doppler ratio as quantity, string or float value. It
                     should be either non-dimensioned to specify a ratio of
                     the light velocity, or in velocity. (examples all give
                     same doppler):
          :param off: an optional offset measure of same type
  
          Example::
  
              >>> from casacore import quanta
              >>> dm.doppler('radio', 0.4)
              >>> dm.doppler('radio', '0.4')
              >>> dm.doppler('RADIO', quanta.constants['c']*0.4))