From bd55b20063f1e7c6e47bf88e87585812c477edc7 Mon Sep 17 00:00:00 2001 From: Samuel Jackson <samueljackson@outlook.com> Date: Mon, 15 Jan 2018 13:58:54 +0000 Subject: [PATCH] Refs #20883 Add documentation file --- .../algorithms/RefineSatellitePeaks-v1.rst | 80 +++++++++++++++++++ docs/source/release/v3.12.0/diffraction.rst | 1 - 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 docs/source/algorithms/RefineSatellitePeaks-v1.rst diff --git a/docs/source/algorithms/RefineSatellitePeaks-v1.rst b/docs/source/algorithms/RefineSatellitePeaks-v1.rst new file mode 100644 index 00000000000..5d8c517ee73 --- /dev/null +++ b/docs/source/algorithms/RefineSatellitePeaks-v1.rst @@ -0,0 +1,80 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +RefineSatellitePeaks cane be used to refine the locations of "satellite" peaks +occurring at fractional HKL locations in reciprocal space. RefineSatellitePeaks +takes a MDWorkspace of experimental data, a PeaksWorkspace containing the +locations of peaks with integer HKL, and another PeaksWorkspace containing a +subset of peaks found at fractional HKL. + +For each satellite peak the difference between the nearest integer peak and +satellite are computed. Offsets are then grouped using using the properties +`NumOfQs` and `ClusterThreshold`. If `NumOfQs` is specified then each offset +will be grouped into exactly `k` clusters. If `ClusterThreshold` is specified +then offsets will be grouped into clusters seperated by no more than a +cophenetic distance below this threshold. The centroid of each cluster +calculated for each group and is used as the offset to predict the location of +fractional peaks everywhere in the MDWorkspace. + +For each predicted fractional peak, the local centroid (the radius of which is +defined by `PeakRadius`) in the MD data is found and this is taken as the actual +position of the satellite peaks. + +Finally the found satellite peaks are integerated using the IntegrateMD +algorithm with the parameters `PeakRadius`, `BackgroundInnerRadius`, and +`BackgroundOuterRadius`. Satellite peaks are discarded if there I/sigma value is less +than the parameter `IOverSigma`. + +Usage +----- + +.. include:: ../usagedata-note.txt + + +**Example - calling RefineSatellitePeaks:** + +.. testcode:: RefineSatellitePeaks + + md_workspace = Load(Filename='WISH_md_small.nxs', OutputWorkspace='WISH_md_small') + satellite_peaks = Load(Filename='WISH_peak_hkl_frac_small.nxs', OutputWorkspace='WISH_peak_hkl_frac_small') + main_peaks = Load(Filename='WISH_peak_hkl_small.nxs',OutputWorkspace='WISH_peak_hkl_small') + + params = { + "PeakRadius": 0.3, + "BackgroundInnerRadius": 0.3, + "BackgroundOuterRadius": 0.4, + "OutputWorkspace": "refined_peaks", + "NumOfQs": 2 + } + + + satellites_refined = RefineSatellitePeaks(MainPeaks=main_peaks, SatellitePeaks=satellite_peaks, MDWorkspace=md_workspace, **params) + + print len(satellites_refined) + +.. testcleanup:: RefineSatellitePeaks + + DeleteWorkspace('WISH_md_small') + DeleteWorkspace('WISH_peak_hkl_small') + DeleteWorkspace('WISH_peak_hkl_frac_small') + DeleteWorkspace('refined_peaks') + +Output: + +.. testoutput:: RefineSatellitePeaks + + 4 + +.. categories:: + +.. sourcelink:: + :cpp: None + :h: None diff --git a/docs/source/release/v3.12.0/diffraction.rst b/docs/source/release/v3.12.0/diffraction.rst index 80babc99adb..9a97e27af40 100644 --- a/docs/source/release/v3.12.0/diffraction.rst +++ b/docs/source/release/v3.12.0/diffraction.rst @@ -56,7 +56,6 @@ Improvements - :ref:`SaveVulcanGSS <algm-SaveVulcanGSS>` has been moved to a workflow algorithm and largely rewritten by using recent change in histogram and Workspace2D. It is also improved such that there is no contraint on the number of spectra and number of various binning parameters on the workspace to be saved to a GSAS file for VULCAN. - :ref:`PDLoadCharacterizations <algm-PDLoadCharacterizations>` now allows for the azimuthal angles to be optionally specified in the file. - Engineering Diffraction ----------------------- -- GitLab