docs: def extract_slitlet2d(self, image_2k2k):
          """Extract slitlet 2d image from image with original EMIR dimensions.
  
          Parameters
          ----------
          image_2k2k : numpy array
              Original image (dimensions EMIR_NAXIS1 * EMIR_NAXIS2)
  
          Returns
          -------
          slitlet2d : numpy array
              Image corresponding to the slitlet region defined by its
              bounding box.
  
          """
  
          # protections
          naxis2, naxis1 = image_2k2k.shape
          if naxis1 != EMIR_NAXIS1:
              raise ValueError('Unexpected naxis1')
          if naxis2 != EMIR_NAXIS2:
              raise ValueError('Unexpected naxis2')
  
          # extract slitlet region
          slitlet2d = image_2k2k[(self.bb_ns1_orig - 1):self.bb_ns2_orig,
                                 (self.bb_nc1_orig - 1):self.bb_nc2_orig]
  
          # transform to float
          slitlet2d = slitlet2d.astype(np.float)
  
          # display slitlet2d with boundaries and middle spectrum trail
          if abs(self.debugplot) in [21, 22]:
              ax = ximshow(slitlet2d, title="Slitlet#" + str(self.islitlet),
                           first_pixel=(self.bb_nc1_orig, self.bb_ns1_orig),
                           show=False)
              xdum = np.linspace(1, EMIR_NAXIS1, num=EMIR_NAXIS1)
              ylower = \
                  self.list_spectrails[self.i_lower_spectrail].poly_funct(xdum)
              ax.plot(xdum, ylower, 'b-')
              ymiddle = \
                  self.list_spectrails[self.i_middle_spectrail].poly_funct(xdum)
              ax.plot(xdum, ymiddle, 'b--')
              yupper = \
                  self.list_spectrails[self.i_upper_spectrail].poly_funct(xdum)
              ax.plot(xdum, yupper, 'b-')
              ylower_frontier = self.list_frontiers[0].poly_funct(xdum)
              ax.plot(xdum, ylower_frontier, 'b:')
              yupper_frontier = self.list_frontiers[1].poly_funct(xdum)
              ax.plot(xdum, yupper_frontier, 'b:')
              pause_debugplot(debugplot=self.debugplot, pltshow=True)
  
          # return slitlet image
          return slitlet2d