code: def to_frame(self, frame, current_frame=None, **kwargs):
          
  
          kw = kwargs.copy()
  
          # TODO: need a better way to do this!
          from ..potential.frame.builtin import ConstantRotatingFrame
          for fr in [frame, current_frame, self.frame]:
              if isinstance(fr, ConstantRotatingFrame):
                  if 't' not in kw:
                      kw['t'] = self.t
  
          psp = super(Orbit, self).to_frame(frame, current_frame, **kw)
  
          return Orbit(pos=psp.pos, vel=psp.vel, t=self.t,
                       frame=frame, potential=self.potential)
docs: TODO:
  
          Parameters
          ----------
          frame : `gala.potential.CFrameBase`
              The frame to transform to.
          current_frame : `gala.potential.CFrameBase` (optional)
              If the Orbit has no associated Hamiltonian, this specifies the
              current frame of the orbit.
  
          Returns
          -------
          orbit : `gala.dynamics.Orbit`
              The orbit in the new reference frame.