docs: def assert_angle_or_pixel(name, q):
      """
      Check that ``q`` is either an angular or a pixel
      :class:`~astropy.units.Quantity`.
      """
  
      if isinstance(q, u.Quantity):
          if q.unit.physical_type == 'angle' or q.unit == u.pixel:
              pass
          else:
              raise ValueError("{0} should have angular or pixel "
                               "units".format(name))
      else:
          raise TypeError("{0} should be a Quantity instance".format(name))