parameters: (self, dark_run, monitor_selection)
return_statement: return dark_run
docstring: We copy the monitors, set everything to 0 and reset the monitors.
          Since there are only  a few monitors, this should not be very costly.
          @param dark_run: the dark run
          @param monitor_selection: the monitors which are selected
          @raise RuntimeError: If the selected monitor workspace index does not exist.
docstring_summary: We copy the monitors, set everything to 0 and reset the monitors.
          Since there are only  a few monitors, this should not be very costly.
docstring_tokens: We copy the monitors set everything to 0 and reset the monitors . Since there are only a few monitors this should not be very costly .
function: def set_pure_monitor_dark_run(self, dark_run, monitor_selection):
          '''
          We copy the monitors, set everything to 0 and reset the monitors.
          Since there are only  a few monitors, this should not be very costly.
          @param dark_run: the dark run
          @param monitor_selection: the monitors which are selected
          @raise RuntimeError: If the selected monitor workspace index does not exist.
          '''
          # Get the list of monitor workspace indices
          monitor_list = self.find_monitor_workspace_indices(dark_run)
  
          # Get the monitor selection
          selected_monitors = self._get_selected_monitors(monitor_selection, monitor_list)
  
          # Grab the monitor Y and E values
          list_dataY, list_dataE = self._get_monitor_values(dark_run, monitor_list)
  
          # Set everything to 0
          scale_factor = 0.0
          dark_run_scaled_name = "dark_run_scaled"
  
          alg_scale  = AlgorithmManager.createUnmanaged("Scale")
          alg_scale.initialize()
          alg_scale.setChild(True)
          alg_scale.setProperty("InputWorkspace", dark_run)
          alg_scale.setProperty("OutputWorkspace", dark_run_scaled_name)
          alg_scale.setProperty("Operation", "Multiply")
          alg_scale.setProperty("Factor", scale_factor)
          alg_scale.execute()
          dark_run = alg_scale.getProperty("OutputWorkspace").value
  
          # Reset the monitors which are required. Either we reset all monitors
          # or only a specific set of monitors which was selected by the user.
          if len(selected_monitors) > 0:
              dark_run = self._set_only_selected_monitors(dark_run, list_dataY, list_dataE,
                                                          monitor_list, selected_monitors)
          else:
              dark_run = self._set_all_monitors(dark_run, list_dataY,
                                                list_dataE, monitor_list)
          return dark_run
function_tokens: def set_pure_monitor_dark_run ( self , dark_run , monitor_selection ) : # Get the list of monitor workspace indices monitor_list = self . find_monitor_workspace_indices ( dark_run ) # Get the monitor selection selected_monitors = self . _get_selected_monitors ( monitor_selection , monitor_list ) # Grab the monitor Y and E values list_dataY , list_dataE = self . _get_monitor_values ( dark_run , monitor_list ) # Set everything to 0 scale_factor = 0.0 dark_run_scaled_name = "dark_run_scaled" alg_scale = AlgorithmManager . createUnmanaged ( "Scale" ) alg_scale . initialize ( ) alg_scale . setChild ( True ) alg_scale . setProperty ( "InputWorkspace" , dark_run ) alg_scale . setProperty ( "OutputWorkspace" , dark_run_scaled_name ) alg_scale . setProperty ( "Operation" , "Multiply" ) alg_scale . setProperty ( "Factor" , scale_factor ) alg_scale . execute ( ) dark_run = alg_scale . getProperty ( "OutputWorkspace" ) . value # Reset the monitors which are required. Either we reset all monitors # or only a specific set of monitors which was selected by the user. if len ( selected_monitors ) > 0 : dark_run = self . _set_only_selected_monitors ( dark_run , list_dataY , list_dataE , monitor_list , selected_monitors ) else : dark_run = self . _set_all_monitors ( dark_run , list_dataY , list_dataE , monitor_list ) return dark_run