parameters: (self, ylow, xlow, ydim, xdim)
return_statement: return output.rstrip(",")
docstring: Compile a list of spectrum Numbers for rectangular block of size xdim by ydim
docstring_summary: Compile a list of spectrum Numbers for rectangular block of size xdim by ydim
docstring_tokens: Compile a list of spectrum Numbers for rectangular block of size xdim by ydim
function: def spectrum_block(self, ylow, xlow, ydim, xdim):
          """
              Compile a list of spectrum Numbers for rectangular block of size xdim by ydim
          """
          if ydim == 'all':
              ydim = self._shape.height()
          if xdim == 'all':
              xdim = self._shape.width()
          det_dimension = self._shape.width()
          base = self._first_spec_num
  
          if not self._shape.isRectangle():
              sanslog.warning(
                  'Attempting to block rows or columns in a non-rectangular detector, this is likely to give unexpected results!')
  
          output = ''
          if self._orientation == 'Horizontal':
              start_spec = base + ylow * det_dimension + xlow
              for y in range(0, ydim):
                  for x in range(0, xdim):
                      output += str(start_spec + x + (y * det_dimension)) + ','
          elif self._orientation == 'Vertical':
              start_spec = base + xlow * det_dimension + ylow
              for x in range(det_dimension - 1, det_dimension - xdim - 1, -1):
                  for y in range(0, ydim):
                      std_i = start_spec + y + ((det_dimension - x - 1) * det_dimension)
                      output += str(std_i) + ','
          elif self._orientation == 'Rotated':
              # This is the horizontal one rotated so need to map the xlow and vlow to their rotated versions
              start_spec = base + ylow * det_dimension + xlow
              max_spec = det_dimension * det_dimension + base - 1
              for y in range(0, ydim):
                  for x in range(0, xdim):
                      std_i = start_spec + x + (y * det_dimension)
                      output += str(max_spec - (std_i - base)) + ','
  
          return output.rstrip(",")
function_tokens: def spectrum_block ( self , ylow , xlow , ydim , xdim ) : if ydim == 'all' : ydim = self . _shape . height ( ) if xdim == 'all' : xdim = self . _shape . width ( ) det_dimension = self . _shape . width ( ) base = self . _first_spec_num if not self . _shape . isRectangle ( ) : sanslog . warning ( 'Attempting to block rows or columns in a non-rectangular detector, this is likely to give unexpected results!' ) output = '' if self . _orientation == 'Horizontal' : start_spec = base + ylow * det_dimension + xlow for y in range ( 0 , ydim ) : for x in range ( 0 , xdim ) : output += str ( start_spec + x + ( y * det_dimension ) ) + ',' elif self . _orientation == 'Vertical' : start_spec = base + xlow * det_dimension + ylow for x in range ( det_dimension - 1 , det_dimension - xdim - 1 , - 1 ) : for y in range ( 0 , ydim ) : std_i = start_spec + y + ( ( det_dimension - x - 1 ) * det_dimension ) output += str ( std_i ) + ',' elif self . _orientation == 'Rotated' : # This is the horizontal one rotated so need to map the xlow and vlow to their rotated versions start_spec = base + ylow * det_dimension + xlow max_spec = det_dimension * det_dimension + base - 1 for y in range ( 0 , ydim ) : for x in range ( 0 , xdim ) : std_i = start_spec + x + ( y * det_dimension ) output += str ( max_spec - ( std_i - base ) ) + ',' return output . rstrip ( "," )