Example #1
0
 def _integrate(self, mainWS, wsCleanup, subalgLogging):
     """Integrate mainWS applying Debye-Waller correction, if requested."""
     eppWS = self.getProperty(common.PROP_EPP_WS).value
     calibrationWS = self.getProperty(common.PROP_OUTPUT_WS).value
     dwfEnabled = self.getProperty(common.PROP_DWF_CORRECTION).value == common.DWF_ON
     temperature = self.getProperty(common.PROP_TEMPERATURE).value
     calibrationWS = ComputeCalibrationCoefVan(VanadiumWorkspace=mainWS,
                                               EPPTable=eppWS,
                                               OutputWorkspace=calibrationWS,
                                               Temperature=temperature,
                                               EnableDWF=dwfEnabled,
                                               EnableLogging=subalgLogging)
     wsCleanup.cleanup(mainWS)
     return calibrationWS
Example #2
0
 def _integrate(self, mainWS, wsCleanup, subalgLogging):
     """Integrate mainWS applying Debye-Waller correction, if requested."""
     eppWS = self.getProperty(common.PROP_EPP_WS).value
     calibrationWS = self.getPropertyValue(common.PROP_OUTPUT_WS)
     if self.getProperty(common.PROP_DWF_CORRECTION).value == common.DWF_ON:
         if not self.getProperty(common.PROP_TEMPERATURE).isDefault:
             temperature = self.getProperty(common.PROP_TEMPERATURE).value
         else:
             temperature = 293.0
             ILL_TEMPERATURE_ENTRY = 'sample.temperature'
             if mainWS.run().hasProperty(ILL_TEMPERATURE_ENTRY):
                 temperatureProperty = mainWS.run().getProperty(
                     ILL_TEMPERATURE_ENTRY)
                 if hasattr(temperatureProperty, 'getStatistics'):
                     temperature = temperatureProperty.getStatistics().mean
                 else:
                     temperature = temperatureProperty.value
         calibrationWS = ComputeCalibrationCoefVan(
             VanadiumWorkspace=mainWS,
             EPPTable=eppWS,
             OutputWorkspace=calibrationWS,
             Temperature=temperature,
             EnableLogging=subalgLogging)
         wsCleanup.cleanup(mainWS)
         return calibrationWS
     # No DWF correction - integrate manually.
     # TODO revise when ComputeCalibrationCoefVan supports this option.
     size = eppWS.rowCount()
     starts = numpy.zeros(size)
     ends = numpy.zeros(size)
     for i in range(size):
         row = eppWS.row(i)
         if row['FitStatus'] == 'success':
             fwhm = 2.0 * numpy.sqrt(2.0 * numpy.log(2.0)) * row['Sigma']
             centre = row['PeakCentre']
             starts[i] = centre - 3.0 * fwhm
             ends[i] = centre + 3.0 * fwhm
     calibrationWS = Integration(InputWorkspace=mainWS,
                                 OutputWorkspace=calibrationWS,
                                 RangeLowerList=starts,
                                 RangeUpperList=ends,
                                 EnableLogging=subalgLogging)
     wsCleanup.cleanup(mainWS)
     return calibrationWS