parameters: (self, ws_name, beamcentre, isSample, other_centre=None)
return_statement: return centre_shift
docstring: It will be called just after loading the workspace for sample and can
  
          It configures the instrument for the specific run of the workspace for handle historical changes in the instrument.
  
          It centralizes the detector bank to the beamcentre (tuple of two values)
docstring_summary: It will be called just after loading the workspace for sample and can
docstring_tokens: It will be called just after loading the workspace for sample and can
function: def on_load_sample(self, ws_name, beamcentre, isSample, other_centre=None):
          """It will be called just after loading the workspace for sample and can
  
          It configures the instrument for the specific run of the workspace for handle historical changes in the instrument.
  
          It centralizes the detector bank to the beamcentre (tuple of two values)
          """
          ws_ref = mtd[str(ws_name)]
          try:
              run_num = LARMOR.get_run_number_from_workspace_reference(ws_ref)
          except:
              run_num = int(re.findall(r'\d+', str(ws_name))[0])
  
          if isSample:
              self.set_up_for_run(run_num)
  
          if self._newCalibrationWS:
              # We are about to transfer the Instrument Parameter File from the
              # calibration to the original workspace. We want to add new parameters
              # which the calibration file has not yet picked up.
              # IMPORTANT NOTE: This takes the parameter settings from the original workspace
              # if they are old too, then we don't pick up newly added parameters
              self._add_parmeters_absent_in_calibration(ws_name, self._newCalibrationWS)
              self.changeCalibration(ws_name)
  
          # centralize the bank to the centre
          if other_centre:
              dummy_centre, centre_shift = self.move_components(ws_name, beamcentre[0], beamcentre[1],
                                                                xbeam_other=other_centre[0], ybeam_other=other_centre[1])
          else:
              dummy_centre, centre_shift = self.move_components(ws_name, beamcentre[0], beamcentre[1])
          return centre_shift
function_tokens: def on_load_sample ( self , ws_name , beamcentre , isSample , other_centre = None ) : ws_ref = mtd [ str ( ws_name ) ] try : run_num = LARMOR . get_run_number_from_workspace_reference ( ws_ref ) except : run_num = int ( re . findall ( r'\d+' , str ( ws_name ) ) [ 0 ] ) if isSample : self . set_up_for_run ( run_num ) if self . _newCalibrationWS : # We are about to transfer the Instrument Parameter File from the # calibration to the original workspace. We want to add new parameters # which the calibration file has not yet picked up. # IMPORTANT NOTE: This takes the parameter settings from the original workspace # if they are old too, then we don't pick up newly added parameters self . _add_parmeters_absent_in_calibration ( ws_name , self . _newCalibrationWS ) self . changeCalibration ( ws_name ) # centralize the bank to the centre if other_centre : dummy_centre , centre_shift = self . move_components ( ws_name , beamcentre [ 0 ] , beamcentre [ 1 ] , xbeam_other = other_centre [ 0 ] , ybeam_other = other_centre [ 1 ] ) else : dummy_centre , centre_shift = self . move_components ( ws_name , beamcentre [ 0 ] , beamcentre [ 1 ] ) return centre_shift