parameters: (self, filename=None, m4_instrument_component_name = None)
docstring: Reads the instrument definition xml file
              @param filename: the name of the instrument definition file to read
              @raise IndexError: if any parameters (e.g. 'default-incident-monitor-spectrum') aren't in the xml definition
docstring_summary: Reads the instrument definition xml file
docstring_tokens: Reads the instrument definition xml file
function: def __init__(self, filename=None, m4_instrument_component_name = None):
          """
              Reads the instrument definition xml file
              @param filename: the name of the instrument definition file to read
              @raise IndexError: if any parameters (e.g. 'default-incident-monitor-spectrum') aren't in the xml definition
          """
          super(ISISInstrument, self).__init__(instr_filen=filename)
  
          self.idf_path = self._definition_file
  
          # the spectrum with this number is used to normalize the workspace data
          self._incid_monitor = int(self.definition.getNumberParameter(
              'default-incident-monitor-spectrum')[0])
          self.cen_find_step = float(self.definition.getNumberParameter('centre-finder-step-size')[0])
          # see if a second step size is defined. If not set the second value to the first for compatibility
          # logger.warning("Trying to find centre-finder-step-size2")
          try:
              self.cen_find_step2 = float(self.definition.getNumberParameter('centre-finder-step-size2')[0])
          except:
              # logger.warning("Failed to find centre-finder-step-size2")
              self.cen_find_step2 = self.cen_find_step
  
          try:
              self.beam_centre_scale_factor1 = float(self.definition.getNumberParameter('beam-centre-scale-factor1')[0])
          except:
              logger.information("Setting beam-centre-scale-factor1 to default (1000).")
              self.beam_centre_scale_factor1 = 1000.0
  
          try:
              self.beam_centre_scale_factor2 = float(self.definition.getNumberParameter('beam-centre-scale-factor2')[0])
          except:
              logger.information("Setting beam-centre-scale-factor1 to default (1000).")
              self.beam_centre_scale_factor2 = 1000.0
  
          firstDetect = DetectorBank(self.definition, 'low-angle')
          # firstDetect.disable_y_and_rot_corrs()
          secondDetect = DetectorBank(self.definition, 'high-angle')
          secondDetect.place_after(firstDetect)
          # add det_selection variable that will receive the DET/ REAR/FRONT/BOTH/MERGED
          self.det_selection = 'REAR'
          self.DETECTORS = {'low-angle': firstDetect}
          self.DETECTORS['high-angle'] = secondDetect
  
          self.setDefaultDetector()
          # if this is set InterpolationRebin will be used on the monitor spectrum used to normalize the sample,
          #  useful because wavelength resolution in the monitor spectrum can be course in the range of interest
          self._use_interpol_norm = False
          # remove use_interpol_trans_calc once the beam centre finder has been converted
          self.use_interpol_trans_calc = False
  
          # the sample will be moved this distance a long the beam axis
          self.SAMPLE_Z_CORR = 0
  
          # Detector position information for SANS2D
          # why are these not defined in SANS2D
          self.FRONT_DET_RADIUS = 306.0
          self.FRONT_DET_DEFAULT_SD_M = 4.0
          self.FRONT_DET_DEFAULT_X_M = 1.1
          self.REAR_DET_DEFAULT_SD_M = 4.0
  
          # LOG files for SANS2D will have these encoder readings
          # why are these not defined in SANS2D
          self.FRONT_DET_X = 0.0
          self.FRONT_DET_Z = 0.0
          self.FRONT_DET_ROT = 0.0
          self.REAR_DET_Z = 0.0
          self.REAR_DET_X = 0
  
          # LOG files for Larmor will have these encoder readings
          # why are these not defined in Larmor
          self.BENCH_ROT = 0.0
  
          # spectrum number of the monitor used to as the incidient in the transmission calculations
          self.default_trans_spec = int(self.definition.getNumberParameter(
              'default-transmission-monitor-spectrum')[0])
          self.incid_mon_4_trans_calc = self._incid_monitor
  
          isis = config.getFacility('ISIS')
          # Number of digits in standard file name
          self.run_number_width = isis.instrument(self._NAME).zeroPadding(0)
  
          # Set a flag if the instrument has an M4 monitor or not
          self.has_m4_monitor = self._has_m4_monitor_in_idf(m4_instrument_component_name)
  
          # this variable isn't used again and stops the instrument from being deep copied if this instance is deep copied
          self.definition = None
  
          # remove this function
          self._del_incidient_set = False
  
          # it is possible to set the TOF regions that is assumed to be background for each monitors
          self._back_ground = {}
          # the default start region, used for any monitors that a specific one wasn't set for
          self._back_start = None
          # default end region
          self._back_end = None
          # the background TOF region for ROI data. Note that either this or a transmission monitor is used.
          self._back_start_ROI = None
          self._back_end_ROI = None
          # if the user moves a monitor to this z coordinate (with MON/LENGTH ...) this will be recorded here.
          # These are overridden lines like TRANS/TRANSPEC=4/SHIFT=-100
          self.monitor_zs = {}
          # Used when new calibration required.
          self._newCalibrationWS = None
          # Centre of beam after a move has been applied,
          self.beam_centre_pos1_after_move = 0.0
          self.beam_centre_pos2_after_move = 0.0
function_tokens: def __init__ ( self , filename = None , m4_instrument_component_name = None ) : super ( ISISInstrument , self ) . __init__ ( instr_filen = filename ) self . idf_path = self . _definition_file # the spectrum with this number is used to normalize the workspace data self . _incid_monitor = int ( self . definition . getNumberParameter ( 'default-incident-monitor-spectrum' ) [ 0 ] ) self . cen_find_step = float ( self . definition . getNumberParameter ( 'centre-finder-step-size' ) [ 0 ] ) # see if a second step size is defined. If not set the second value to the first for compatibility # logger.warning("Trying to find centre-finder-step-size2") try : self . cen_find_step2 = float ( self . definition . getNumberParameter ( 'centre-finder-step-size2' ) [ 0 ] ) except : # logger.warning("Failed to find centre-finder-step-size2") self . cen_find_step2 = self . cen_find_step try : self . beam_centre_scale_factor1 = float ( self . definition . getNumberParameter ( 'beam-centre-scale-factor1' ) [ 0 ] ) except : logger . information ( "Setting beam-centre-scale-factor1 to default (1000)." ) self . beam_centre_scale_factor1 = 1000.0 try : self . beam_centre_scale_factor2 = float ( self . definition . getNumberParameter ( 'beam-centre-scale-factor2' ) [ 0 ] ) except : logger . information ( "Setting beam-centre-scale-factor1 to default (1000)." ) self . beam_centre_scale_factor2 = 1000.0 firstDetect = DetectorBank ( self . definition , 'low-angle' ) # firstDetect.disable_y_and_rot_corrs() secondDetect = DetectorBank ( self . definition , 'high-angle' ) secondDetect . place_after ( firstDetect ) # add det_selection variable that will receive the DET/ REAR/FRONT/BOTH/MERGED self . det_selection = 'REAR' self . DETECTORS = { 'low-angle' : firstDetect } self . DETECTORS [ 'high-angle' ] = secondDetect self . setDefaultDetector ( ) # if this is set InterpolationRebin will be used on the monitor spectrum used to normalize the sample, #  useful because wavelength resolution in the monitor spectrum can be course in the range of interest self . _use_interpol_norm = False # remove use_interpol_trans_calc once the beam centre finder has been converted self . use_interpol_trans_calc = False # the sample will be moved this distance a long the beam axis self . SAMPLE_Z_CORR = 0 # Detector position information for SANS2D # why are these not defined in SANS2D self . FRONT_DET_RADIUS = 306.0 self . FRONT_DET_DEFAULT_SD_M = 4.0 self . FRONT_DET_DEFAULT_X_M = 1.1 self . REAR_DET_DEFAULT_SD_M = 4.0 # LOG files for SANS2D will have these encoder readings # why are these not defined in SANS2D self . FRONT_DET_X = 0.0 self . FRONT_DET_Z = 0.0 self . FRONT_DET_ROT = 0.0 self . REAR_DET_Z = 0.0 self . REAR_DET_X = 0 # LOG files for Larmor will have these encoder readings # why are these not defined in Larmor self . BENCH_ROT = 0.0 # spectrum number of the monitor used to as the incidient in the transmission calculations self . default_trans_spec = int ( self . definition . getNumberParameter ( 'default-transmission-monitor-spectrum' ) [ 0 ] ) self . incid_mon_4_trans_calc = self . _incid_monitor isis = config . getFacility ( 'ISIS' ) # Number of digits in standard file name self . run_number_width = isis . instrument ( self . _NAME ) . zeroPadding ( 0 ) # Set a flag if the instrument has an M4 monitor or not self . has_m4_monitor = self . _has_m4_monitor_in_idf ( m4_instrument_component_name ) # this variable isn't used again and stops the instrument from being deep copied if this instance is deep copied self . definition = None # remove this function self . _del_incidient_set = False # it is possible to set the TOF regions that is assumed to be background for each monitors self . _back_ground = { } # the default start region, used for any monitors that a specific one wasn't set for self . _back_start = None # default end region self . _back_end = None # the background TOF region for ROI data. Note that either this or a transmission monitor is used. self . _back_start_ROI = None self . _back_end_ROI = None # if the user moves a monitor to this z coordinate (with MON/LENGTH ...) this will be recorded here. # These are overridden lines like TRANS/TRANSPEC=4/SHIFT=-100 self . monitor_zs = { } # Used when new calibration required. self . _newCalibrationWS = None # Centre of beam after a move has been applied, self . beam_centre_pos1_after_move = 0.0 self . beam_centre_pos2_after_move = 0.0