code: def degrade_to_order(self, new_order):
          
          shift = 2 * (AbstractMOC.HPY_MAX_NORDER - new_order)
          ofs = (int(1) << shift) - 1
          mask = ~ofs
          adda = int(0)
          addb = ofs
  
          iv_set = []
  
          for iv in self._interval_set._intervals:
              a = (iv[0] + adda) & mask
              b = (iv[1] + addb) & mask
              if b > a:
                  iv_set.append((a, b))
  
          return self.__class__(IntervalSet(np.asarray(iv_set)))
docs: Degrades the MOC instance to a new, less precise, MOC.
  
          The maximum depth (i.e. the depth of the smallest HEALPix cells that can be found in the MOC) of the
          degraded MOC is set to ``new_order``. 
  
          Parameters
          ----------
          new_order : int
              Maximum depth of the output degraded MOC.
  
          Returns
          -------
          moc : `~mocpy.moc.MOC` or `~mocpy.tmoc.TimeMOC`
              The degraded MOC.