parameters: (self, mainWS)
return_statement: return bkgSubtractedWS
docstring: Subtract flat background from a detector workspace.
docstring_summary: Subtract flat background from a detector workspace.
docstring_tokens: Subtract flat background from a detector workspace .
function: def _flatBkgDet(self, mainWS):
          """Subtract flat background from a detector workspace."""
          if not self._flatBgkEnabled(mainWS):
              return mainWS
          if not self.getProperty(common.PROP_FLAT_BKG_WS).isDefault:
              bkgWS = self.getProperty(common.PROP_FLAT_BKG_WS).value
              self._cleanup.protect(bkgWS)
          else:
              windowWidth = self.getProperty(common.PROP_FLAT_BKG_WINDOW).value
              bkgWS = _createFlatBkg(mainWS, common.WS_CONTENT_DETS, windowWidth, self._names, self._subalgLogging)
          if not self.getProperty(common.PROP_OUTPUT_FLAT_BKG_WS).isDefault:
              self.setProperty(common.PROP_OUTPUT_FLAT_BKG_WS, bkgWS)
          bkgScaling = self.getProperty(common.PROP_FLAT_BKG_SCALING).value
          bkgSubtractedWS = _subtractFlatBkg(mainWS, common.WS_CONTENT_DETS, bkgWS, bkgScaling, self._names,
                                             self._cleanup, self._subalgLogging)
          self._cleanup.cleanup(mainWS)
          self._cleanup.cleanup(bkgWS)
          return bkgSubtractedWS
function_tokens: def _flatBkgDet ( self , mainWS ) : if not self . _flatBgkEnabled ( mainWS ) : return mainWS if not self . getProperty ( common . PROP_FLAT_BKG_WS ) . isDefault : bkgWS = self . getProperty ( common . PROP_FLAT_BKG_WS ) . value self . _cleanup . protect ( bkgWS ) else : windowWidth = self . getProperty ( common . PROP_FLAT_BKG_WINDOW ) . value bkgWS = _createFlatBkg ( mainWS , common . WS_CONTENT_DETS , windowWidth , self . _names , self . _subalgLogging ) if not self . getProperty ( common . PROP_OUTPUT_FLAT_BKG_WS ) . isDefault : self . setProperty ( common . PROP_OUTPUT_FLAT_BKG_WS , bkgWS ) bkgScaling = self . getProperty ( common . PROP_FLAT_BKG_SCALING ) . value bkgSubtractedWS = _subtractFlatBkg ( mainWS , common . WS_CONTENT_DETS , bkgWS , bkgScaling , self . _names , self . _cleanup , self . _subalgLogging ) self . _cleanup . cleanup ( mainWS ) self . _cleanup . cleanup ( bkgWS ) return bkgSubtractedWS