parameters: (self, mainWS)
return_statement: return True
docstring: Return true if incident energy calibration should be perfomed, false if not.
docstring_summary: Return true if incident energy calibration should be perfomed, false if not.
docstring_tokens: Return true if incident energy calibration should be perfomed false if not .
function: def _eiCalibrationEnabled(self, mainWS):
          """Return true if incident energy calibration should be perfomed, false if not."""
          calibration = self.getProperty(common.PROP_INCIDENT_ENERGY_CALIBRATION).value
          state = None
          ENABLED_AUTOMATICALLY = 1
          if calibration == common.INCIDENT_ENERGY_CALIBRATION_OFF:
              return False
          elif calibration == common.INCIDENT_ENERGY_CALIBRATION_AUTO:
              instrument = mainWS.getInstrument()
              if instrument.hasParameter('enable_incident_energy_calibration'):
                  enabled = instrument.getBoolParameter('enable_incident_energy_calibration')[0]
                  if not enabled:
                      self._report.notice('Incident energy calibration disabled by the IPF.')
                      return False
                  else:
                      state = ENABLED_AUTOMATICALLY
          monitorCounts = _monitorCounts(mainWS)
          if monitorCounts < _MONSUM_LIMIT:
              self._report.warning("'monsum' less than {}. Disabling incident energy calibration.".format(_MONSUM_LIMIT))
              return False
          if state == ENABLED_AUTOMATICALLY:
              self._report.notice('Incident energy calibration enabled.')
          return True
function_tokens: def _eiCalibrationEnabled ( self , mainWS ) : calibration = self . getProperty ( common . PROP_INCIDENT_ENERGY_CALIBRATION ) . value state = None ENABLED_AUTOMATICALLY = 1 if calibration == common . INCIDENT_ENERGY_CALIBRATION_OFF : return False elif calibration == common . INCIDENT_ENERGY_CALIBRATION_AUTO : instrument = mainWS . getInstrument ( ) if instrument . hasParameter ( 'enable_incident_energy_calibration' ) : enabled = instrument . getBoolParameter ( 'enable_incident_energy_calibration' ) [ 0 ] if not enabled : self . _report . notice ( 'Incident energy calibration disabled by the IPF.' ) return False else : state = ENABLED_AUTOMATICALLY monitorCounts = _monitorCounts ( mainWS ) if monitorCounts < _MONSUM_LIMIT : self . _report . warning ( "'monsum' less than {}. Disabling incident energy calibration." . format ( _MONSUM_LIMIT ) ) return False if state == ENABLED_AUTOMATICALLY : self . _report . notice ( 'Incident energy calibration enabled.' ) return True