diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateSelfScatteringCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateSelfScatteringCorrection.py index a5a109e09bf9ea2110f5f92b41663676b31a688b..254202eb557413e1cf8b1e3126011168c0c934ef 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateSelfScatteringCorrection.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateSelfScatteringCorrection.py @@ -1,6 +1,6 @@ # Mantid Repository : https://github.com/mantidproject/mantid # -# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, +# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + @@ -16,11 +16,18 @@ import numpy as np class CalculateSelfScatteringCorrection(DataProcessorAlgorithm): + def __init__(self): + """Initialize an instance of the algorithm.""" + DataProcessorAlgorithm.__init__(self) + + def name(self): + return 'CalculateSelfScatteringCorrection' + def category(self): return "Workflow\\Diffraction" def seeAlso(self): - return [""] + return [] def summary(self): return "Calculates the self scattering correction factor for total scattering data." @@ -28,6 +35,9 @@ class CalculateSelfScatteringCorrection(DataProcessorAlgorithm): def checkGroups(self): return False + def version(self): + return 1 + def PyInit(self): self.declareProperty(WorkspaceProperty('RawWorkspace', '', direction=Direction.Input), doc='Raw workspace') diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MergeWorkspacesWithLimits.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MergeWorkspacesWithLimits.py index d7dc72a3e09341688c7f52501dfa94f27a6e6cdf..385ece4468d12ddeb540806b90d94df05bb7c5d5 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MergeWorkspacesWithLimits.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MergeWorkspacesWithLimits.py @@ -1,6 +1,6 @@ # Mantid Repository : https://github.com/mantidproject/mantid # -# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, +# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + diff --git a/docs/source/algorithms/CalculateSelfScatteringCorrection-v1.rst b/docs/source/algorithms/CalculateSelfScatteringCorrection-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..d87aebfaa29527780cd5edf3efd61bad88960b1c --- /dev/null +++ b/docs/source/algorithms/CalculateSelfScatteringCorrection-v1.rst @@ -0,0 +1,31 @@ +.. algorithm:: + +.. summary:: + +.. relatedalgorithms:: + +.. properties:: + +Description +----------- + +This is a workflow algorithm that calculates the placzek self scattering +factor focused by into detector banks. This is done by executing several +sub-algorithms as listed below. + +#. :ref:`algm-SetSample` Sets sample data for the run that is to be corrected to the raw workspace. +#. :ref:`algm-ExtractSpectra` Extracts the monitor spectrum closest to the sample (incident spectrum). +#. :ref:`algm-ConvertUnits` Converts incident spectrum to wavelength. +#. :ref:`algm-FitIncidentSpectrum` Fit a curve to the incident spectrum. +#. :ref:`algm-CalculatePlaczekSelfScattering` Calculate the Placzek self scattering factor for each pixel. +#. :ref:`algm-LoadCalFile` Loads the detector calibration. +#. :ref:`algm-DiffractionFocussing` Focus the Placzek self scattering factor into detector banks. +#. :ref:`algm-CreateWorkspace` Create a workspace containing the number of pixels in each detector bank. +#. :ref:`algm-Divide` Normalize the Placzek correction by pixel number in bank +#. :ref:`algm-ConvertToDistribution` Change the workspace into a format that can be subtracted. +#. :ref:`algm-ConvertUnits` Converts correction into MomentumTransfer. + +Workflow +######## + +.. diagram:: CalculateSelfScatteringCorrection-v1_wkflw.dot diff --git a/docs/source/algorithms/MergeWorkspacesWithLimits-v1.rst b/docs/source/algorithms/MergeWorkspacesWithLimits-v1.rst index 091a34f48ccba742e79edbc19780ee996d070dcd..ad36ed0062aa380590e2d382aeba569f5a81bd53 100644 --- a/docs/source/algorithms/MergeWorkspacesWithLimits-v1.rst +++ b/docs/source/algorithms/MergeWorkspacesWithLimits-v1.rst @@ -14,12 +14,12 @@ and sums the spectra using weighted mean and Ranges for each spectra. This is done by executing several sub-algorithms as listed below. -#. :ref:`algm-Rebin` To rebin all spectra to have common bins -#. :ref:`algm-ConjoinWorkspaces` repeated for every workspaces in the workspace group -#. :ref:`algm-MatchSpectra` Matched against the spectra with the largest original x range -#. :ref:`algm-CropWorkspaceRagged` to cut spectra to match the X limits given -#. :ref:`algm-Rebin` To rebin all spectra to have common bins -#. :ref:`algm-SumSpectra` using `WeightedSum=True` and `MultiplyBySpectra=False` +#. :ref:`algm-Rebin` To rebin all spectra to have common bins. +#. :ref:`algm-ConjoinWorkspaces` repeated for every workspaces in the workspace group. +#. :ref:`algm-MatchSpectra` Matched against the spectra with the largest original x range. +#. :ref:`algm-CropWorkspaceRagged` to cut spectra to match the X limits given. +#. :ref:`algm-Rebin` To rebin all spectra to have common bins. +#. :ref:`algm-SumSpectra` using `WeightedSum=True` and `MultiplyBySpectra=False`. Workflow ######## diff --git a/docs/source/diagrams/CalculateSelfScatteringCorrection-v1_wkflw.dot b/docs/source/diagrams/CalculateSelfScatteringCorrection-v1_wkflw.dot index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..eee3de93e4a18d8eb534c664f270990ee80f02a7 100644 --- a/docs/source/diagrams/CalculateSelfScatteringCorrection-v1_wkflw.dot +++ b/docs/source/diagrams/CalculateSelfScatteringCorrection-v1_wkflw.dot @@ -0,0 +1,54 @@ +digraph CalculateSelfScatteringCorrection { +label = "CalculateSelfScatteringCorrection Workflow Diagram" +$global_style + +subgraph params { + $param_style + inputWorkspace [label="RawWorkspace"] + outputWorkspace [label="CorrectionsWorkspace"] + calFileName [label="CalFileName"] + sampleGeometry [label="SampleGeometry"] + sampleMaterial [label="SampleMaterial"] +} + +subgraph algorithms { + $algorithm_style + SetSample [label="SetSample v1"] + ExtractSpectra [label="ExtractSpectra v1"] + ConvertUnits1 [label="ConvertUnits v1"] + FitIncidentSpectrum [label="FitIncidentSpectrum v1"] + CalculatePlaczekSelfScattering [label="CalculatePlaczekSelfScattering v1"] + LoadCalFile [label="LoadCalFile v1"] + DiffractionFocussing [label="DiffractionFocussing v2"] + CreateWorkspace [label="CreateWorkspace v1"] + Divide [label="Divide v1"] + ConvertToDistribution [label="ConvertToDistribution v1"] + ConvertUnits2 [label="ConvertUnits v1"] +} + +subgraph process { + $process_style + FindMonitorSpectra [label="Find the Monitor\n spectra closest to the sample"] + GetPixelNumberInDetector [label="Count the number\n of pixels in each detector"] +} + +inputWorkspace -> SetSample +sampleGeometry -> SetSample +sampleMaterial -> SetSample +SetSample -> FindMonitorSpectra +SetSample -> ExtractSpectra +FindMonitorSpectra -> ExtractSpectra +ExtractSpectra -> ConvertUnits1 +ConvertUnits1 -> FitIncidentSpectrum +FitIncidentSpectrum -> CalculatePlaczekSelfScattering +calFileName -> LoadCalFile +LoadCalFile -> DiffractionFocussing +CalculatePlaczekSelfScattering -> DiffractionFocussing +LoadCalFile -> GetPixelNumberInDetector +GetPixelNumberInDetector -> CreateWorkspace +CreateWorkspace -> Divide +DiffractionFocussing -> Divide +Divide -> ConvertToDistribution +ConvertToDistribution -> ConvertUnits2 +ConvertUnits2 -> outputWorkspace +} \ No newline at end of file diff --git a/docs/source/diagrams/MergeWorkspacesWithLimits-v1_wkflw.dot b/docs/source/diagrams/MergeWorkspacesWithLimits-v1_wkflw.dot index 50983a36a53a74edf3d4ff7e397b0dc193adf2f2..1a027789cf4925366d69ec3d64ed3260c7ab7533 100644 --- a/docs/source/diagrams/MergeWorkspacesWithLimits-v1_wkflw.dot +++ b/docs/source/diagrams/MergeWorkspacesWithLimits-v1_wkflw.dot @@ -27,8 +27,8 @@ subgraph algorithms { } subgraph process { - $process_style - findLargestRange [label="Find detector data with the largest X range"] + $process_style + findLargestRange [label="Find detector data with the largest X range"] } inputWorkspace -> findLargestRange