parameters: (workspace_name)
return_statement: return masked_spec
docstring: Identify detectors which should be masked
  
      @param workspace_name Name of workspace to use to get masking detectors
      @return List of masked spectra
docstring_summary: Identify detectors which should be masked
docstring_tokens: Identify detectors which should be masked
function: def identify_bad_detectors(workspace_name):
      """
      Identify detectors which should be masked
  
      @param workspace_name Name of workspace to use to get masking detectors
      @return List of masked spectra
      """
      from mantid.simpleapi import (IdentifyNoisyDetectors, DeleteWorkspace)
  
      instrument = mtd[workspace_name].getInstrument()
  
      try:
          masking_type = instrument.getStringParameter('Workflow.Masking')[0]
      except IndexError:
          masking_type = 'None'
  
      logger.information('Masking type: %s' % masking_type)
  
      masked_spec = list()
  
      if masking_type == 'IdentifyNoisyDetectors':
          ws_mask = '__workspace_mask'
          IdentifyNoisyDetectors(InputWorkspace=workspace_name,
                                 OutputWorkspace=ws_mask)
  
          # Convert workspace to a list of spectra
          num_spec = mtd[ws_mask].getNumberHistograms()
          masked_spec = [spec for spec in range(0, num_spec) if mtd[ws_mask].readY(spec)[0] == 0.0]
  
          # Remove the temporary masking workspace
          DeleteWorkspace(ws_mask)
  
      logger.debug('Masked spectra for workspace %s: %s' % (workspace_name, str(masked_spec)))
  
      return masked_spec
function_tokens: def identify_bad_detectors ( workspace_name ) : from mantid . simpleapi import ( IdentifyNoisyDetectors , DeleteWorkspace ) instrument = mtd [ workspace_name ] . getInstrument ( ) try : masking_type = instrument . getStringParameter ( 'Workflow.Masking' ) [ 0 ] except IndexError : masking_type = 'None' logger . information ( 'Masking type: %s' % masking_type ) masked_spec = list ( ) if masking_type == 'IdentifyNoisyDetectors' : ws_mask = '__workspace_mask' IdentifyNoisyDetectors ( InputWorkspace = workspace_name , OutputWorkspace = ws_mask ) # Convert workspace to a list of spectra num_spec = mtd [ ws_mask ] . getNumberHistograms ( ) masked_spec = [ spec for spec in range ( 0 , num_spec ) if mtd [ ws_mask ] . readY ( spec ) [ 0 ] == 0.0 ] # Remove the temporary masking workspace DeleteWorkspace ( ws_mask ) logger . debug ( 'Masked spectra for workspace %s: %s' % ( workspace_name , str ( masked_spec ) ) ) return masked_spec