parameters: (x, yFit, yData, bg, pp_lambda=0, fracStop=0.01, totEvents=1, bgEvents=1, varFit=0.)
return_statement: return intensity, sigma, xStart, xStop
docstring: integratePeak does 1D integration of the peak.  This is currently done by rectangular integration (i.e.
      we just sum the values at each point on the curve for values considered to be the peak.)  The peak is
      defined as all x values with yFit/max(yFit) > fracStop.
      Note that this function will only integrate the 1D TOF peak - for 3D profile fitting, integration is done in
      doBVGFit or (for mantid) in the algorithm itself.)
  
      Input:
          x - the TOf values for the TOF histogram
          yFit - the fit for the TOF histogram
          yData - the counts for the TOF histogram
          pp_lambda - the pp_lambda background level.  Not used in integration. TODO: Remove this
          fracStop - the threshold at which we consider the peak to be a peak
          totEvents - not used
          bgEvents - total number of background events including events removed by pp_lambda filtering.
          varFit - the variance of the fit (float)
      Output:
          intensity - total number of counts in the peak
          sigma - sigma(I) for the peak
          xStart - the time (in us) the peak started at
          xStop - the time (in us) the peak stopped at
docstring_summary: integratePeak does 1D integration of the peak.  This is currently done by rectangular integration (i.e.
      we just sum the values at each point on the curve for values considered to be the peak.)  The peak is
      defined as all x values with yFit/max(yFit) > fracStop.
      Note that this function will only integrate the 1D TOF peak - for 3D profile fitting, integration is done in
      doBVGFit or (for mantid) in the algorithm itself.)
docstring_tokens: integratePeak does 1D integration of the peak . This is currently done by rectangular integration ( i . e . we just sum the values at each point on the curve for values considered to be the peak . ) The peak is defined as all x values with yFit / max ( yFit ) > fracStop . Note that this function will only integrate the 1D TOF peak - for 3D profile fitting integration is done in doBVGFit or ( for mantid ) in the algorithm itself . )
function: def integratePeak(x, yFit, yData, bg, pp_lambda=0, fracStop=0.01, totEvents=1, bgEvents=1, varFit=0.):
      """
      integratePeak does 1D integration of the peak.  This is currently done by rectangular integration (i.e.
      we just sum the values at each point on the curve for values considered to be the peak.)  The peak is
      defined as all x values with yFit/max(yFit) > fracStop.
      Note that this function will only integrate the 1D TOF peak - for 3D profile fitting, integration is done in
      doBVGFit or (for mantid) in the algorithm itself.)
  
      Input:
          x - the TOf values for the TOF histogram
          yFit - the fit for the TOF histogram
          yData - the counts for the TOF histogram
          pp_lambda - the pp_lambda background level.  Not used in integration. TODO: Remove this
          fracStop - the threshold at which we consider the peak to be a peak
          totEvents - not used
          bgEvents - total number of background events including events removed by pp_lambda filtering.
          varFit - the variance of the fit (float)
      Output:
          intensity - total number of counts in the peak
          sigma - sigma(I) for the peak
          xStart - the time (in us) the peak started at
          xStop - the time (in us) the peak stopped at
  
      """
      # Find out start/stop point
      yScaled = (yFit-bg) / np.max(yFit-bg)
      goodIDX = yScaled > fracStop
      if np.sum(goodIDX) > 0:
          iStart = np.min(np.where(goodIDX))
          iStop = np.max(np.where(goodIDX))
          xStart = x[iStart]
          xStop = x[iStop]
      else:
          logger.warning('ICCFITTOOLS:integratePeak - NO GOOD START/STOP POINT!!')
          return 0.0, 1.0, x[0], x[-1]
  
      # Do the integration
      intensity = np.sum(yFit[iStart:iStop] - bg[iStart:iStop]) - bgEvents
  
      # Calculate the background sigma = sqrt(var(Fit) + sum(BG))
      # sigma = np.sqrt(totEvents + bgEvents)
      sigma = np.sqrt(intensity + 2.0*bgEvents + varFit)
      return intensity, sigma, xStart, xStop
function_tokens: def integratePeak ( x , yFit , yData , bg , pp_lambda = 0 , fracStop = 0.01 , totEvents = 1 , bgEvents = 1 , varFit = 0. ) : # Find out start/stop point yScaled = ( yFit - bg ) / np . max ( yFit - bg ) goodIDX = yScaled > fracStop if np . sum ( goodIDX ) > 0 : iStart = np . min ( np . where ( goodIDX ) ) iStop = np . max ( np . where ( goodIDX ) ) xStart = x [ iStart ] xStop = x [ iStop ] else : logger . warning ( 'ICCFITTOOLS:integratePeak - NO GOOD START/STOP POINT!!' ) return 0.0 , 1.0 , x [ 0 ] , x [ - 1 ] # Do the integration intensity = np . sum ( yFit [ iStart : iStop ] - bg [ iStart : iStop ] ) - bgEvents # Calculate the background sigma = sqrt(var(Fit) + sum(BG)) # sigma = np.sqrt(totEvents + bgEvents) sigma = np . sqrt ( intensity + 2.0 * bgEvents + varFit ) return intensity , sigma , xStart , xStop