docs: def orbit2frame(name, ref_orbit, orientation=None, center=None, bypass=False):
      """Create a frame based on a Orbit or Ephem object.
  
      Args:
          name (str): Name to give the created frame
          ref_orbit (Orbit or Ephem):
          orientation (str): Orientation of the created frame
          bypass (bool): By-pass the warning when creating a frame with an already
              taken name
      Return:
          Frame:
  
      If orientation is ``None``, the new frame will keep the orientation of the
      reference frame of the Orbit and move along with the orbit.
      Other acceptable values are ``"QSW"`` (and its aliases "LVLH" and "RSW") or ``"TNW"``.
  
      See :py:func:`~beyond.frames.local.to_qsw` and :py:func:`~beyond.frames.local.to_tnw`
      for informations regarding these orientations.
      """
  
      if orientation is None:
          orientation = ref_orbit.frame.orientation
      elif orientation.upper() in ("RSW", "LVLH"):
          orientation = "QSW"
      elif orientation.upper() not in ("QSW", "TNW"):
          raise ValueError("Unknown orientation '%s'" % orientation)
  
      if center is None:
          center = Earth
  
      def _to_parent_frame(self):
          """Conversion from orbit frame to parent frame
          """
          offset = ref_orbit.propagate(self.date).base.copy()
  
          if orientation.upper() in ("QSW", "TNW"):
  
              # propagation of the reference orbit to the date of the
              # converted orbit
              orb = ref_orbit.propagate(self.date)
  
              m = to_qsw(orb) if orientation.upper() == "QSW" else to_tnw(orb)
  
              # we transpose the matrix because it represents the conversion
              # from inertial to local frame, and we'd like the other way around
              rotation = Frame._convert(m, m).T
          else:
              # The orientation is the same as the parent reference frame
              rotation = np.identity(6)
  
          return rotation, offset
  
      # define the name of the method of conversion
      mtd = '_to_%s' % ref_orbit.frame.__name__
  
      # dictionary which defines attributes of the created class
      dct = {
          mtd: _to_parent_frame,
          "orientation": orientation,
          "center": center,
          "bypass": bypass,
      }
  
      # Creation of the class
      cls = _MetaFrame(name, (Frame,), dct)
  
      # Link to the parent
      cls + ref_orbit.frame
      return cls