parameters: (self, wksp)
docstring: Convert whatever calibration/grouping/masking into workspaces that will be passed down
docstring_summary: Convert whatever calibration/grouping/masking into workspaces that will be passed down
docstring_tokens: Convert whatever calibration / grouping / masking into workspaces that will be passed down
function: def __setupCalibration(self, wksp):
          '''Convert whatever calibration/grouping/masking into workspaces that will be passed down'''
          if self.haveDeterminedCalibration:
              return  # nothing to do
          self.haveDeterminedCalibration = True
  
          # first see if the workspaces have been specified
          # check that the canonical names don't already exist as a backup
          if not self.getProperty('CalibrationWorkspace').isDefault:
              self.__calWksp = self.getPropertyValue('CalibrationWorkspace')
          elif not self.getProperty('OffsetsWorkspace').isDefault:
              self.__calWksp = self.getPropertyValue('OffsetsWorkspace') + '_cal'
              ConvertDiffCal(OffsetsWorkspace=self.getPropertyValue('OffsetsWorkspace'),
                             OutputWorkspace=self.instr + '_cal')
              self.setProperty('CalibrationWorkspace', self.__calWksp)
          elif mtd.doesExist(self.instr + '_cal'):
              self.__calWksp = self.instr + '_cal'
  
          if not self.getProperty('GroupingWorkspace').isDefault:
              self.__grpWksp = self.getPropertyValue('GroupingWorkspace')
          elif mtd.doesExist(self.instr + '_group'):
              self.__grpWksp = self.instr + '_group'
  
          if not self.getProperty('MaskWorkspace').isDefault:
              self.__mskWksp = self.getPropertyValue('MaskWorkspace')
          elif mtd.doesExist(self.instr + '_mask'):
              self.__mskWksp = self.instr + '_mask'
  
          # check that anything was specified
          if self.getProperty('CalFileName').isDefault and self.getProperty('GroupFilename').isDefault:
              self.kwargs = self.__getAlignAndFocusArgs()
              return
  
          # decide what to load
          loadCalibration = not bool(self.__calWksp)
          loadGrouping = not bool(self.__grpWksp)
          loadMask = not bool(self.__mskWksp)
  
          # load and update
          if loadCalibration or loadGrouping or loadMask:
              if not wksp:
                  raise RuntimeError('Trying to load calibration without a donor workspace')
              LoadDiffCal(InputWorkspace=wksp,
                          Filename=self.getPropertyValue('CalFileName'),
                          GroupFilename=self.getPropertyValue('GroupFilename'),
                          MakeCalWorkspace=loadCalibration,
                          MakeGroupingWorkspace=loadGrouping,
                          MakeMaskWorkspace=loadMask,
                          WorkspaceName=self.instr)
          if loadCalibration:
              self.__calWksp = self.instr + '_cal'
              self.setPropertyValue('CalibrationWorkspace', self.instr + '_cal')
          if loadGrouping:
              self.__grpWksp = self.instr + '_group'
              self.setPropertyValue('GroupingWorkspace', self.instr + '_group')
          if loadMask:
              self.__mskWksp = self.instr + '_mask'
              self.setPropertyValue('MaskWorkspace', self.instr + '_mask')
          self.kwargs = self.__getAlignAndFocusArgs()
function_tokens: def __setupCalibration ( self , wksp ) : if self . haveDeterminedCalibration : return # nothing to do self . haveDeterminedCalibration = True # first see if the workspaces have been specified # check that the canonical names don't already exist as a backup if not self . getProperty ( 'CalibrationWorkspace' ) . isDefault : self . __calWksp = self . getPropertyValue ( 'CalibrationWorkspace' ) elif not self . getProperty ( 'OffsetsWorkspace' ) . isDefault : self . __calWksp = self . getPropertyValue ( 'OffsetsWorkspace' ) + '_cal' ConvertDiffCal ( OffsetsWorkspace = self . getPropertyValue ( 'OffsetsWorkspace' ) , OutputWorkspace = self . instr + '_cal' ) self . setProperty ( 'CalibrationWorkspace' , self . __calWksp ) elif mtd . doesExist ( self . instr + '_cal' ) : self . __calWksp = self . instr + '_cal' if not self . getProperty ( 'GroupingWorkspace' ) . isDefault : self . __grpWksp = self . getPropertyValue ( 'GroupingWorkspace' ) elif mtd . doesExist ( self . instr + '_group' ) : self . __grpWksp = self . instr + '_group' if not self . getProperty ( 'MaskWorkspace' ) . isDefault : self . __mskWksp = self . getPropertyValue ( 'MaskWorkspace' ) elif mtd . doesExist ( self . instr + '_mask' ) : self . __mskWksp = self . instr + '_mask' # check that anything was specified if self . getProperty ( 'CalFileName' ) . isDefault and self . getProperty ( 'GroupFilename' ) . isDefault : self . kwargs = self . __getAlignAndFocusArgs ( ) return # decide what to load loadCalibration = not bool ( self . __calWksp ) loadGrouping = not bool ( self . __grpWksp ) loadMask = not bool ( self . __mskWksp ) # load and update if loadCalibration or loadGrouping or loadMask : if not wksp : raise RuntimeError ( 'Trying to load calibration without a donor workspace' ) LoadDiffCal ( InputWorkspace = wksp , Filename = self . getPropertyValue ( 'CalFileName' ) , GroupFilename = self . getPropertyValue ( 'GroupFilename' ) , MakeCalWorkspace = loadCalibration , MakeGroupingWorkspace = loadGrouping , MakeMaskWorkspace = loadMask , WorkspaceName = self . instr ) if loadCalibration : self . __calWksp = self . instr + '_cal' self . setPropertyValue ( 'CalibrationWorkspace' , self . instr + '_cal' ) if loadGrouping : self . __grpWksp = self . instr + '_group' self . setPropertyValue ( 'GroupingWorkspace' , self . instr + '_group' ) if loadMask : self . __mskWksp = self . instr + '_mask' self . setPropertyValue ( 'MaskWorkspace' , self . instr + '_mask' ) self . kwargs = self . __getAlignAndFocusArgs ( )