Skip to content

Commit

Permalink
Re #5199 Document python workflow algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed May 1, 2012
1 parent 867e728 commit f447581
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""*WIKI*
Compute the resolution in Q according to Mildner-Carpenter.
See [http://www.mantidproject.org/Reduction_for_HFIR_SANS SANS Reduction] documentation for details.
*WIKI*"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""*WIKI*
Finds the reflectivity peak in a data set and estimates the peak boundaries
to give the reduction process.
*WIKI*"""

from MantidFramework import *
from mantidsimple import *
import math
Expand Down
50 changes: 35 additions & 15 deletions Code/Mantid/Framework/PythonAPI/PythonAlgorithms/RefLReduction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""*WIKI*
Liquids Reflectometer (REFL) reduction
*WIKI*"""

from MantidFramework import *
from mantidsimple import *
from numpy import zeros, shape, arange
Expand All @@ -16,28 +22,42 @@ def version(self):

def PyInit(self):
self.declareListProperty("RunNumbers", [0],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("NormalizationRunNumber", 0, Description="")
Validator=ArrayBoundedValidator(Lower=0),
Description="List of run numbers to process")
self.declareProperty("NormalizationRunNumber", 0,
Description="Run number of the normalization run to use")
self.declareListProperty("SignalPeakPixelRange", [126, 134],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("SubtractSignalBackground", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range defining the data peak")
self.declareProperty("SubtractSignalBackground", True,
Description="If true, the background will be subtracted from the data peak")
self.declareListProperty("SignalBackgroundPixelRange", [123, 137],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("NormFlag", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range defining the background")
self.declareProperty("NormFlag", True, Description="If true, the data will be normalized")
self.declareListProperty("NormPeakPixelRange", [127, 133],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("SubtractNormBackground", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range defining the normalization peak")
self.declareProperty("SubtractNormBackground", True,
Description="If true, the background will be subtracted from the normalization peak")
self.declareListProperty("NormBackgroundPixelRange", [123, 137],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("LowResDataAxisPixelRangeFlag", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range defining the background for the normalization")
self.declareProperty("LowResDataAxisPixelRangeFlag", True,
Description="If true, the low-resolution direction of the data will be cropped according to the LowResDataAxisPixelRange property")
self.declareListProperty("LowResDataAxisPixelRange", [115, 210],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("LowResNormAxisPixelRangeFlag", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range to use in the low-resolution direction of the data")
self.declareProperty("LowResNormAxisPixelRangeFlag", True,
Description="If true, the low-resolution direction of the normalization run will be cropped according to the LowResNormAxisPixelRange property")
self.declareListProperty("LowResNormAxisPixelRange", [115, 210],
Validator=ArrayBoundedValidator(Lower=0))
Validator=ArrayBoundedValidator(Lower=0),
Description="Pixel range to use in the low-resolution direction of the normalization run")
self.declareListProperty("TOFRange", [9000., 23600.],
Validator=ArrayBoundedValidator(Lower=0))
self.declareProperty("TofRangeFlag", True)
Validator=ArrayBoundedValidator(Lower=0),
Description="TOF range to use")
self.declareProperty("TofRangeFlag", True,
Description="If true, the TOF will be cropped according to the TOFRange property")
self.declareProperty("QMin", 0.001,
Description="Minimum Q-value")
self.declareProperty("QStep", 0.001,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def PyInit(self):
# Input workspace
self.declareWorkspaceProperty("InputWorkspace", "", Direction=Direction.InOut, Description="Workspace to be normalised")
self.declareProperty("NormaliseToBeam", True, Description="If true, the data will also be normalise by the beam profile")
self.declareProperty("BeamSpectrumFile", "", Direction=Direction.Input)
self.declareProperty("BeamSpectrumFile", "", Direction=Direction.Input,
Description="Beam spectrum to be used for normalisation [takes precedence over default]")
self.declareProperty("OutputMessage", "", Direction=Direction.Output)

def PyExec(self):
Expand Down

0 comments on commit f447581

Please sign in to comment.