.. algorithm:: .. summary:: .. relatedalgorithms:: .. properties:: Description ----------- Integrates SCD peaks with a range of radii, in order to plot graphs of the integrated intensity vs radius. This can be useful to determine the correct integration radius for each peak. .. figure:: /images/PeakIntensityVsRadius_fig.png :alt: {Integrated peak intensity vs integration radius for 3 SCD peaks} The algorithm requires a :ref:`MDWorkspace ` of SCD data in reciprocal space; generated by e.g. :ref:`algm-ConvertToDiffractionMDWorkspace`. Also, you will need a :ref:`PeaksWorkspace ` as the list of peaks to integrate. This can be generated using :ref:`algm-FindPeaksMD`, for example. The output will be a :ref:`Workspace2D ` with one spectrum per peak, where: - X = peak radius - Y/E = integrated intensity and error for the corresponding radius. - Each peak is labeled with a string with "H K L". Use :ref:`algm-IndexPeaks` to automatically find HKL values for peaks. This algorithm calls :ref:`algm-IntegratePeaksMD` repeatedly, with the following parameters filled in: - **PeakRadius** = the radius, ranging from RadiusStart to RadiusEnd in NumSteps steps. - **BackgroundInnerRadius** = radius \* BackgroundInnerFactor *OR* BackgroundInnerRadius - **BackgroundOuterRadius** = radius \* BackgroundOuterFactor *OR* BackgroundOuterRadius Usage ----- **Example - PeakIntensityVsRadius:** The code itself works but disabled from doc tests as takes too long to complete. User should provide its own event nexus file instead of **TOPAZ_3132_event.nxs** used within this example. The original **TOPAZ_3132_event.nxs** file is available in `Mantid system tests repository `_. .. code-block:: python # Load a SCD data set from systemtests Data and find the peaks LoadEventNexus(Filename=r'TOPAZ_3132_event.nxs',OutputWorkspace='TOPAZ_3132_nxs') ConvertToDiffractionMDWorkspace(InputWorkspace='TOPAZ_3132_nxs',OutputWorkspace='TOPAZ_3132_md',LorentzCorrection='1') FindPeaksMD(InputWorkspace='TOPAZ_3132_md',PeakDistanceThreshold='0.15',MaxPeaks='100',OutputWorkspace='peaks') FindUBUsingFFT(PeaksWorkspace='peaks',MinD='2',MaxD='16') IndexPeaks(PeaksWorkspace='peaks') # Run the PeakIntensityVsRadius algorithm, where the background shell scales with the PeakRadius PeakIntensityVsRadius(InputWorkspace='TOPAZ_3132_md',PeaksWorkspace='peaks', RadiusStart=0.00, RadiusEnd=0.15, NumSteps=51, BackgroundInnerFactor=1.5,BackgroundOuterFactor=2, OutputWorkspace='peak_vs_rad') # Run the PeakIntensityVsRadius algorithm, with fixed background shell radius PeakIntensityVsRadius(InputWorkspace='TOPAZ_3132_md',PeaksWorkspace='peaks', RadiusStart=0.00, RadiusEnd=0.15, NumSteps=51, BackgroundInnerRadius=0.15,BackgroundOuterRadius=0.2, OutputWorkspace='peak_vs_rad_fixed') # Plot a few of the peaks plotSpectrum('peak_vs_rad', [0,2,3], error_bars=True) .. categories:: .. sourcelink::