diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h index 54dbce1c9c955409430e0c788ba745b8dc294ef8..27431ceea9f361c799adb364315505f8d420ac4f 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h @@ -66,7 +66,7 @@ public: /// Algorithm's name virtual const std::string name() const { return "SphericalAbsorption"; } ///Summary of algorithms purpose - virtual const std::string summary() const {return "Calculates bin-by-bin correction factors for attenuation due to absorption and scattering in a 'spherical' sample.";} + virtual const std::string summary() const {return "Calculates bin-by-bin or event correction factors for attenuation due to absorption and scattering in a 'spherical' sample.";} /// Algorithm's version virtual int version() const { return (1); } diff --git a/Code/Mantid/Framework/Algorithms/src/SphericalAbsorption.cpp b/Code/Mantid/Framework/Algorithms/src/SphericalAbsorption.cpp index cd34c0f4708c7feb72d008360905c234d1512da8..1c902cec509584627e22006e6251b84efa287d2e 100644 --- a/Code/Mantid/Framework/Algorithms/src/SphericalAbsorption.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SphericalAbsorption.cpp @@ -46,11 +46,11 @@ void SphericalAbsorption::init() auto mustBePositive = boost::make_shared<BoundedValidator<double> >(); mustBePositive->setLower(0.0); declareProperty("AttenuationXSection", EMPTY_DBL(), mustBePositive, - "The '''absorption''' cross-section, at 1.8 Angstroms, for the sample material in barns."); + "The '''absorption''' cross-section, at 1.8 Angstroms, for the sample material in barns, if not set with SetSampleMaterial."); declareProperty("ScatteringXSection", EMPTY_DBL(), mustBePositive, - "The (coherent + incoherent) scattering cross-section for the sample material in barns."); + "The (coherent + incoherent) scattering cross-section for the sample material in barns, if not set with SetSampleMaterial."); declareProperty("SampleNumberDensity", EMPTY_DBL(), mustBePositive, - "TThe number density of the sample in number of atoms per cubic angstrom, if not set with SetSampleMaterial"); + "The number density of the sample in number of atoms per cubic angstrom, if not set with SetSampleMaterial"); declareProperty("SphericalSampleRadius", EMPTY_DBL(), mustBePositive, "The radius of the spherical sample in centimetres"); diff --git a/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp b/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp index 42eb4eb2d8e08a78c86d72746d8e6ab1ce4f999c..2a5c0b7f3e96cb2eadd300da065004857d4514af 100644 --- a/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp +++ b/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp @@ -68,7 +68,7 @@ void UnwrapSNS::init() "Contains numbers counts against time of flight (TOF)." ); declareProperty( new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace","",Direction::Output), - "This workspace will be in the [[Units|units]] of time of flight." ); + "This workspace will be in the units of time of flight. (See http://www.mantidproject.org/Units)" ); auto validator = boost::make_shared<BoundedValidator<double> >(); validator->setLower(0.01); diff --git a/Code/Mantid/docs/source/algorithms/AlignDetectors-v1.rst b/Code/Mantid/docs/source/algorithms/AlignDetectors-v1.rst index 256c5e597f6ba6432e7669aef13174ff38b002d7..e0de33553a5e73432e854d7f5eaa9201bf985204 100644 --- a/Code/Mantid/docs/source/algorithms/AlignDetectors-v1.rst +++ b/Code/Mantid/docs/source/algorithms/AlignDetectors-v1.rst @@ -14,19 +14,43 @@ during the conversion from time-of-flight to dSpacing as follows: .. math:: d = \frac{h}{2m_N} \frac{t.o.f.}{L_{tot} sin \theta} (1+ \rm{offset}) -The detector offsets can be obtained from either: an -`OffsetsWorkspace <OffsetsWorkspace>`__ where each pixel has one value, +The detector offsets can be obtained from either: an OffsetsWorkspace where each pixel has one value, the offset; or a .cal file (in the form created by the ARIEL software). **Note:** the workspace that this algorithms outputs is a `Ragged -Workspace <Ragged Workspace>`__. +Workspace <http://www.mantidproject.org/Ragged_Workspace>`__. Restrictions on the input workspace ################################### The input workspace must contain histogram or event data where the X unit is time-of-flight and the Y data is raw counts. The -`instrument <instrument>`__ associated with the workspace must be fully +`instrument <http://www.mantidproject.org/instrument>`__ associated with the workspace must be fully defined because detector, source & sample position are needed. +Usage +----- + +**Example: Use offset to move peak in Dspace** + +.. testcode:: ExAlignDetectors + + ws = CreateSampleWorkspace("Event",NumBanks=1,BankPixelWidth=1) + ws = MoveInstrumentComponent(Workspace='ws', ComponentName='bank1', X=0.5, RelativePosition=False) + wsD = ConvertUnits(InputWorkspace='ws', Target='dSpacing') + maxD = Max(wsD) + offset = GetDetectorOffsets(InputWorkspace='wsD', DReference=2.5, XMin=2, XMax=3) + wsA = AlignDetectors(InputWorkspace='ws', OutputWorkspace='wsA', OffsetsWorkspace='offset') + maxA = Max(wsA) + print "Peak in dSpace", maxD.readX(0)[0] + print "Peak from calibration", maxA.readX(0)[0] + +Output: + +.. testoutput:: ExAlignDetectors + + Peak in dSpace 2.66413186052 + Peak from calibration 2.56009958218 + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/BroadcastWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/BroadcastWorkspace-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..ffc106aa3b48e11ce42e1e72d9b956a53fe90f6f --- /dev/null +++ b/Code/Mantid/docs/source/algorithms/BroadcastWorkspace-v1.rst @@ -0,0 +1,14 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +BroadcastWorkspace is only available for MPI builds. It is used to copy a workspace from one process to all the others. + +.. categories:: diff --git a/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v1.rst index 1461cffa477e9246c992087561dd009c32fed8c5..2929ce54e432f4c3d0708b635a0865b1b7ae7ea1 100644 --- a/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v1.rst @@ -9,9 +9,9 @@ Description ----------- -This algorithm converts from a `MatrixWorkspace <MatrixWorkspace>`__ (in +This algorithm converts from a `MatrixWorkspace <http://mantidproject.org/MatrixWorkspace>`__ (in detector/time-of-flight space) to a -`MDEventWorkspace <MDEventWorkspace>`__ containing events in reciprocal +`MDEventWorkspace <http://mantidproject.org/MDEventWorkspace>`__ containing events in reciprocal space. The calculations apply only to elastic diffraction experiments. The @@ -20,7 +20,7 @@ to HKL of the crystal. If the OutputWorkspace does NOT already exist, a default one is created. In order to define more precisely the parameters of the -`MDEventWorkspace <MDEventWorkspace>`__, use the +`MDEventWorkspace <http://mantidproject.org/MDEventWorkspace>`__, use the :ref:`algm-CreateMDWorkspace` algorithm first. Types of Conversion @@ -61,7 +61,7 @@ of the workspace, **including zeros**. This can be useful in cases where the experimental coverage needs to be tracked. With one MDEvent for each bin, you can count which regions in -Q-space have been measured. The `SliceViewer <SliceViewer>`__ has an +Q-space have been measured. The `SliceViewer <http://mantidproject.org/SliceViewer>`__ has an option to view normalized by number of events. This means that, for example, areas with overlap from two runs will appear scaled down. @@ -75,9 +75,9 @@ Also, the :ref:`algm-FindPeaksMD` algorithm may not work optimally because it depends partly on higher density of events causing more finely split boxes. -If your input is a `Workspace2D <Workspace2D>`__ and you do NOT check +If your input is a `Workspace2D <http://mantidproject.org/Workspace2D>`__ and you do NOT check *OneEventPerBin*, then the workspace is converted to an -`EventWorkspace <EventWorkspace>`__ but with no events for empty bins. +`EventWorkspace <http://mantidproject.org/EventWorkspace>`__ but with no events for empty bins. Performance Notes ################# diff --git a/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v2.rst b/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v2.rst index 1461cffa477e9246c992087561dd009c32fed8c5..2929ce54e432f4c3d0708b635a0865b1b7ae7ea1 100644 --- a/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v2.rst +++ b/Code/Mantid/docs/source/algorithms/ConvertToDiffractionMDWorkspace-v2.rst @@ -9,9 +9,9 @@ Description ----------- -This algorithm converts from a `MatrixWorkspace <MatrixWorkspace>`__ (in +This algorithm converts from a `MatrixWorkspace <http://mantidproject.org/MatrixWorkspace>`__ (in detector/time-of-flight space) to a -`MDEventWorkspace <MDEventWorkspace>`__ containing events in reciprocal +`MDEventWorkspace <http://mantidproject.org/MDEventWorkspace>`__ containing events in reciprocal space. The calculations apply only to elastic diffraction experiments. The @@ -20,7 +20,7 @@ to HKL of the crystal. If the OutputWorkspace does NOT already exist, a default one is created. In order to define more precisely the parameters of the -`MDEventWorkspace <MDEventWorkspace>`__, use the +`MDEventWorkspace <http://mantidproject.org/MDEventWorkspace>`__, use the :ref:`algm-CreateMDWorkspace` algorithm first. Types of Conversion @@ -61,7 +61,7 @@ of the workspace, **including zeros**. This can be useful in cases where the experimental coverage needs to be tracked. With one MDEvent for each bin, you can count which regions in -Q-space have been measured. The `SliceViewer <SliceViewer>`__ has an +Q-space have been measured. The `SliceViewer <http://mantidproject.org/SliceViewer>`__ has an option to view normalized by number of events. This means that, for example, areas with overlap from two runs will appear scaled down. @@ -75,9 +75,9 @@ Also, the :ref:`algm-FindPeaksMD` algorithm may not work optimally because it depends partly on higher density of events causing more finely split boxes. -If your input is a `Workspace2D <Workspace2D>`__ and you do NOT check +If your input is a `Workspace2D <http://mantidproject.org/Workspace2D>`__ and you do NOT check *OneEventPerBin*, then the workspace is converted to an -`EventWorkspace <EventWorkspace>`__ but with no events for empty bins. +`EventWorkspace <http://mantidproject.org/EventWorkspace>`__ but with no events for empty bins. Performance Notes ################# diff --git a/Code/Mantid/docs/source/algorithms/ConvertUnits-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertUnits-v1.rst index 24f1ddcb3b819e808dfb7aebb2e8616e77a99b8f..3786e0389bcdf164c8cf58fbcd1dcb11da352676 100644 --- a/Code/Mantid/docs/source/algorithms/ConvertUnits-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ConvertUnits-v1.rst @@ -9,18 +9,18 @@ Description ----------- -Changes the units in which the X values of a `workspace <workspace>`__ +Changes the units in which the X values of a `workspace <http://www.mantidproject.org/Workspace>`__ are represented. The available units are those registered with the `Unit -Factory <Unit Factory>`__. If the Y data is 'dimensioned' (i.e. has been +Factory <http://www.mantidproject.org/Units>`__. If the Y data is 'dimensioned' (i.e. has been divided by the bin width), then this will be correctly handled, but at present nothing else is done to the Y data. If the sample-detector distance cannot be calculated then the affected spectrum will be zeroed, -and a warning message will be output on the `logging <logging>`__ +and a warning message will be output on the `logging <http://www.mantidproject.org/logging>`__ service. If AlignBins is false or left at the default the output workspace may be -a `Ragged Workspace <Ragged Workspace>`__. If it is set to true then the -data is automatically `rebinned <Rebin>`__ to a regular grid so that the +a `Ragged Workspace <http://www.mantidproject.org/Ragged_Workspace>`__. If it is set to true then the +data is automatically `rebinned <http://www.mantidproject.org/Rebin>`__ to a regular grid so that the maximum and minimum X values will be maintained. It uses the same number of bins as the input data, and divides them linearly equally between the minimum and maximum values. @@ -35,17 +35,38 @@ Restrictions on the input workspace ################################### - Naturally, the X values must have a unit set, and that unit must be - known to the `Unit Factory <Unit Factory>`__. + known to the `Unit Factory <http://www.mantidproject.org/Units>`__. - Only histograms, not point data, can be handled at present. - The algorithm will also fail if the source-sample distance cannot be - calculated (i.e. the `instrument <instrument>`__ has not been + calculated (i.e. the `instrument <http://www.mantidproject.org/instrument>`__ has not been properly defined). Available units --------------- The units currently available to this algorithm are listed -`here <Unit Factory>`__, along with equations specifying exactly how the +`here <http://www.mantidproject.org/Units>`__, along with equations specifying exactly how the conversions are done. +Usage +----- + +**Example: Convert to wavelength** + +.. testcode:: ExConvertUnits + + ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1) + wsOut = ConvertUnits(ws,Target="Wavelength") + + print "Input", ws.readX(0)[ws.blocksize()-1] + print "Output", wsOut.readX(0)[wsOut.blocksize()-1] + +Output: + +.. testoutput:: ExConvertUnits + + Input 19800.0 + Output 5.22196485301 + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/ConvolveWorkspaces-v1.rst b/Code/Mantid/docs/source/algorithms/ConvolveWorkspaces-v1.rst index 0bb8db23e78892dae8b838120b77ee562ff3d302..7ca85dd8e855d1dda3505fc89a33a8952cc7c666 100644 --- a/Code/Mantid/docs/source/algorithms/ConvolveWorkspaces-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ConvolveWorkspaces-v1.rst @@ -9,7 +9,31 @@ Description ----------- -Convolution of two workspaces using `Convolution <Convolution>`__ from +Convolution of two workspaces using `Convolution <http://www.mantidproject.org/Convolution>`__ from CurveFitting. Workspaces must have the same number of spectra. +Usage +----- + +**Example: Convolve sample workspaces** + +.. testcode:: ExConvolveWorkspaces + + + ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1) + ws = ConvertUnits(ws,"Wavelength") + ws = Rebin(ws,Params=[1]) + + #restrict the number of wavelength points to speed up the example + wsOut = ConvolveWorkspaces(ws,ws) + + print "Output: ", wsOut.readY(0) + +Output: + +.. testoutput:: ExConvolveWorkspaces + + Output: [ 60.78539112 0. 32.3478194 121.57078223 175.00835395 + 146.57078223] + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/CropWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/CropWorkspace-v1.rst index 97f6e52a66c9b0c034604b4fc9609bf053eb2dc1..aedf5cb4f1ad1fa24a2d447236992405c501c538 100644 --- a/Code/Mantid/docs/source/algorithms/CropWorkspace-v1.rst +++ b/Code/Mantid/docs/source/algorithms/CropWorkspace-v1.rst @@ -13,7 +13,7 @@ Extracts a 'block' from a workspace and places it in a new workspace (or, to look at it another way, lops bins or spectra off a workspace). CropWorkspace works on workspaces with common X arrays/bin boundaries or -on so-called `ragged workspaces <Ragged Workspace>`__. If the input +on so-called `ragged workspaces <http://www.mantidproject.org/Ragged_Workspace>`__. If the input workspace has common bin boundaries/X values then cropping in X will lead to an output workspace with fewer bins than the input one. If the boundaries are not common then the output workspace will have the same diff --git a/Code/Mantid/docs/source/algorithms/FindUBUsingFFT-v1.rst b/Code/Mantid/docs/source/algorithms/FindUBUsingFFT-v1.rst index d1e9ef4608447654ebed7fd191bbc786ebaac87c..a42a25652ab907b425f89003e364888706346f6f 100644 --- a/Code/Mantid/docs/source/algorithms/FindUBUsingFFT-v1.rst +++ b/Code/Mantid/docs/source/algorithms/FindUBUsingFFT-v1.rst @@ -38,4 +38,31 @@ conventional cell. While this algorithm will occasionally work for as few as four peaks, it works quite consistently with at least ten peaks, and in general works best with a larger number of peaks. +Usage +----- + +**Example:** + +.. testcode:: ExFindUBUsingFFT + + ws=LoadIsawPeaks("TOPAZ_3007.peaks") + print "After LoadIsawPeaks does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + FindUBUsingFFT(ws,MinD=8.0,MaxD=13.0) + print "After FindUBUsingFFT does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + print ws.sample().getOrientedLattice().getUB() + + +Output: + +.. testoutput:: ExFindUBUsingFFT + + After LoadIsawPeaks does the workspace have an orientedLattice: False + After FindUBUsingFFT does the workspace have an orientedLattice: True + [[ 0.01223576 0.00480107 0.08604016] + [-0.11654506 0.00178069 -0.00458823] + [-0.02737294 -0.08973552 -0.02525994]] + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/FindUBUsingIndexedPeaks-v1.rst b/Code/Mantid/docs/source/algorithms/FindUBUsingIndexedPeaks-v1.rst index ae6522a2909ab0baeec4a01026d9418a0a7c4de3..4e8ee793dce41b55f1e401981d3ab0bfa045dd40 100644 --- a/Code/Mantid/docs/source/algorithms/FindUBUsingIndexedPeaks-v1.rst +++ b/Code/Mantid/docs/source/algorithms/FindUBUsingIndexedPeaks-v1.rst @@ -19,4 +19,31 @@ system of equations representing the mapping from (h,k,l) to Q for each indexed peak. The system of linear equations is then solved in the least squares sense, using QR factorization. +Usage +----- + +**Example:** + +.. testcode:: ExFindUBUsingIndexedPeaks + + ws=LoadIsawPeaks("TOPAZ_3007.peaks") + print "After LoadIsawPeaks does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + FindUBUsingIndexedPeaks(ws) + print "After FindUBUsingIndexedPeaks does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + print ws.sample().getOrientedLattice().getUB() + + +Output: + +.. testoutput:: ExFindUBUsingIndexedPeaks + + After LoadIsawPeaks does the workspace have an orientedLattice: False + After FindUBUsingIndexedPeaks does the workspace have an orientedLattice: True + [[-0.04542062 0.04061954 -0.01223576] + [ 0.00140377 -0.00318446 0.11654506] + [ 0.05749773 0.03223779 0.02737294]] + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/FindUBUsingLatticeParameters-v1.rst b/Code/Mantid/docs/source/algorithms/FindUBUsingLatticeParameters-v1.rst index 8ed28debc7e0e8f32c2447e81b2021132cb1ad0d..6d01d2d6f8412d3f391bffc12da8311d0b9e6f9d 100644 --- a/Code/Mantid/docs/source/algorithms/FindUBUsingLatticeParameters-v1.rst +++ b/Code/Mantid/docs/source/algorithms/FindUBUsingLatticeParameters-v1.rst @@ -41,4 +41,30 @@ that are indexed, continues until all peaks have been added to the list. Finally, one last optimization of the UB matrix is carried out using the full list of peaks. +Usage +----- + +**Example:** + +.. testcode:: ExFindUBUsingLatticeParameters + + ws=LoadIsawPeaks("TOPAZ_3007.peaks") + print "After LoadIsawPeaks does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + FindUBUsingLatticeParameters(ws,a=14.131,b=19.247,c=8.606,alpha=90.0,beta=105.071,gamma=90.0,NumInitial=15) + print "After FindUBUsingLatticeParameters does the workspace have an orientedLattice: %s" % ws.sample().hasOrientedLattice() + + print ws.sample().getOrientedLattice().getUB() + + +Output: + +.. testoutput:: ExFindUBUsingLatticeParameters + + After LoadIsawPeaks does the workspace have an orientedLattice: False + After FindUBUsingLatticeParameters does the workspace have an orientedLattice: True + [[ 0.04542062 0.04061954 0.01223576] + [-0.00140377 -0.00318446 -0.11654506] + [-0.05749773 0.03223779 -0.02737294]] + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/GatherWorkspaces-v1.rst b/Code/Mantid/docs/source/algorithms/GatherWorkspaces-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..2e2aeefd5b0cd9fa7134146e9557e063e6656c1f --- /dev/null +++ b/Code/Mantid/docs/source/algorithms/GatherWorkspaces-v1.rst @@ -0,0 +1,18 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +GatherWorkspaces is only available for MPI builds. +It stitches together the input workspaces provided by each of the processes into a single workspace in the root process. +The spectra in the output workspace will be ordered by the rank of the input processes. +It is up to the caller to ensure this results in the required ordering. +Furthermore, there are all sorts of things that ought to be consistent for this algorithm to make sense (e.g. the instrument). The general philosophy, though, is to leave the responsibility for this to the user and only check the vital things (i.e. that the number of bins is consistent). + +.. categories:: diff --git a/Code/Mantid/docs/source/algorithms/MultipleScatteringCylinderAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/MultipleScatteringCylinderAbsorption-v1.rst index dfe49e98345bbb70378248d5f84f0694ef0a0d94..c4c166a21f41c583cef16c3022887da95f813961 100644 --- a/Code/Mantid/docs/source/algorithms/MultipleScatteringCylinderAbsorption-v1.rst +++ b/Code/Mantid/docs/source/algorithms/MultipleScatteringCylinderAbsorption-v1.rst @@ -12,8 +12,33 @@ Description This algorithm is a port to C++ of a multiple scattering absorption correction, used to correct the vanadium spectrum for the GPPD instrument at the IPNS. The correction calculation was originally worked -out by Jack Carpenter and Asfia Huq and implmented in Java by Alok +out by Jack Carpenter and Asfia Huq and implemented in Java by Alok Chatterjee. The java code was translated to C++ in Mantid by Dennis Mikkelson. +Usage +----- + +**Example: A simple cylindrical sample** + +.. testcode:: ExMultipleScatteringCylinderAbsorption + + ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1) + ws = ConvertUnits(ws,"Wavelength") + ws = Rebin(ws,Params=[1]) + SetSampleMaterial(ws,ChemicalFormula="V") + + #restrict the number of wavelength points to speed up the example + wsOut = MultipleScatteringCylinderAbsorption(ws,CylinderSampleRadius=0.2) + + print "Output: ", wsOut.readY(0) + +Output: + +.. testoutput:: ExMultipleScatteringCylinderAbsorption + + Output: [ 5.90548152 5.90559329 16.28933615 5.90581685 5.90592863 + 1.62244888] + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/PeakIntensityVsRadius-v1.rst b/Code/Mantid/docs/source/algorithms/PeakIntensityVsRadius-v1.rst index eee0658b77b14ac0c6b75672902e3cac0fbb0afc..c1fb0726f66eb2d577a51de75e12b76f406b1042 100644 --- a/Code/Mantid/docs/source/algorithms/PeakIntensityVsRadius-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PeakIntensityVsRadius-v1.rst @@ -17,14 +17,14 @@ correct integration radius for each peak. :alt: {Integrated peak intensity vs integration radius for 3 SCD peaks} {Integrated peak intensity vs integration radius for 3 SCD peaks} -The algorithm requires a `MDWorkspace <MDWorkspace>`__ of SCD data in +The algorithm requires a `MDWorkspace <http://www.mantidproject.org/MDWorkspace>`__ of SCD data in reciprocal space; generated by e.g. :ref:`algm-ConvertToDiffractionMDWorkspace`. -Also, you will need a `PeaksWorkspace <PeaksWorkspace>`__ as the list of +Also, you will need a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__ as the list of peaks to integrate. This can be generated using :ref:`algm-FindPeaksMD`, for example. -The output will be a `Workspace2D <Workspace2D>`__ with one spectrum per +The output will be a `Workspace2D <http://www.mantidproject.org/Workspace2D>`__ with one spectrum per peak, where: - X = peak radius @@ -44,7 +44,7 @@ with the following parameters filled in: BackgroundOuterRadius Sample Usage -############ +----- .. code-block:: python diff --git a/Code/Mantid/docs/source/algorithms/SaveToSNSHistogramNexus-v1.rst b/Code/Mantid/docs/source/algorithms/SaveToSNSHistogramNexus-v1.rst index 70465158ff4a442f38cff9163fd9e03b0d224c2d..2fe5224c1e11bb8ecc75ff9349df48e178520a0b 100644 --- a/Code/Mantid/docs/source/algorithms/SaveToSNSHistogramNexus-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SaveToSNSHistogramNexus-v1.rst @@ -15,7 +15,7 @@ workspace contains. The histograms do not need to be the same size (in number of bins), but the number of pixels needs to be the same. In addition, this only works for instruments that use -`RectangularDetectors <RectangularDetector>`__ (SNAP, TOPAZ, POWGEN, for +`RectangularDetectors <http://www.mantidproject.org/RectangularDetector>`__ (SNAP, TOPAZ, POWGEN, for example); in addition, the name in the instrument definition file must match the name in the NXS file. diff --git a/Code/Mantid/docs/source/algorithms/SaveZODS-v1.rst b/Code/Mantid/docs/source/algorithms/SaveZODS-v1.rst index 58c441b3c016674336dc46fbdb2de29ecc7e48cb..846bc38edd070200ecb88c8fbda028779e7989bb 100644 --- a/Code/Mantid/docs/source/algorithms/SaveZODS-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SaveZODS-v1.rst @@ -11,7 +11,7 @@ Description Saves a HDF5 file to the ZODS (Zurich Oak Ridge Disorder Simulation program) format. This format consists of a slice of a -`MDHistoWorkspace <MDHistoWorkspace>`__ and some information about its +`MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__ and some information about its location. **You must be in HKL space for the output of this algorithm to make @@ -39,7 +39,7 @@ and grid base vectors (a1,a2,a3) so a point at node (i,j,k) of grid has coordinates r = origin+i\*a1+j\*a2+k\*a3. Please contact Michal Chodkiewicz (michal.chodkiewicz@gmail.com); Vickie -Lynch (vel@ornl.gov) for more details. +Lynch (lynchve@ornl.gov) for more details. Description of data fields ########################## diff --git a/Code/Mantid/docs/source/algorithms/SelectCellOfType-v1.rst b/Code/Mantid/docs/source/algorithms/SelectCellOfType-v1.rst index c044712dda9bdb192925d085c24b12514d3d5cbe..399dc34705a2f3c716348aba86b51855a558ddaf 100644 --- a/Code/Mantid/docs/source/algorithms/SelectCellOfType-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SelectCellOfType-v1.rst @@ -25,7 +25,6 @@ This algorithm is based on the paper: "Lattice Symmetry and Identification -- The Fundamental Role of Reduced Cells in Materials Characterization", Alan D. Mighell, Vol. 106, Number 6, Nov-Dec 2001, Journal of Research of the National Institute of Standards and -Technology, available from: -nvlpubs.nist.gov/nistpubs/jres/106/6/j66mig.pdf. +Technology, available from: `nvlpubs <nvlpubs.nist.gov/nistpubs/jres/106/6/j66mig.pdf>`_. .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/SelectCellWithForm-v1.rst b/Code/Mantid/docs/source/algorithms/SelectCellWithForm-v1.rst index 7a72f99ac0f92fef0bcfac0578bafc7c341b6625..54c02b884098d083adcc74e7d012fddb556663bb 100644 --- a/Code/Mantid/docs/source/algorithms/SelectCellWithForm-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SelectCellWithForm-v1.rst @@ -25,7 +25,6 @@ This algorithm is based on the paper: "Lattice Symmetry and Identification -- The Fundamental Role of Reduced Cells in Materials Characterization", Alan D. Mighell, Vol. 106, Number 6, Nov-Dec 2001, Journal of Research of the National Institute of Standards and -Technology, available from: -nvlpubs.nist.gov/nistpubs/jres/106/6/j66mig.pdf. +Technology, available from: `nvlpubs <nvlpubs.nist.gov/nistpubs/jres/106/6/j66mig.pdf>`_. .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/SortByQVectors-v1.rst b/Code/Mantid/docs/source/algorithms/SortByQVectors-v1.rst index d64fa352346d4cf5f60bbc9e24160f6faf9ae4be..85a2b0d72d6c75d7c7f861378012bd5fe5d01e46 100644 --- a/Code/Mantid/docs/source/algorithms/SortByQVectors-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SortByQVectors-v1.rst @@ -11,6 +11,6 @@ Description This algorithm sorts a group workspace by the qvectors found in the qvectors file. Workspaces will be tranformed if the qvectors dimension -is in the bins. +is in the bins. Used for output from LoadSassena. .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/SphericalAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/SphericalAbsorption-v1.rst index 3ffb71cd141696831eeb3b71e2a6927e86a857a1..4b08181bfc4816ddd1d28af5dd2d7bca0dc7a882 100644 --- a/Code/Mantid/docs/source/algorithms/SphericalAbsorption-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SphericalAbsorption-v1.rst @@ -9,9 +9,32 @@ Description ----------- -Calculates bin-by-bin correction factors for attenuation due to -absorption and scattering in a **spherical** sample. Sample data must be +Calculates bin-by-bin or event correction factors for attenuation due to +absorption and scattering in a **spherical** sample. Sample data should be divided by these corrections. Algorithm calls :ref:`algm-AnvredCorrection`. +Usage +----- + +**Example: A simple spherical sample** + +.. testcode:: ExSphericalAbsorption + + ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1) + ws = ConvertUnits(ws,"Wavelength") + ws = Rebin(ws,Params=[1]) + SetSampleMaterial(ws,ChemicalFormula="V") + + #restrict the number of wavelength points to speed up the example + wsOut = SphericalAbsorption(ws,SphericalSampleRadius=0.2) + + print "The created workspace has spectra: ", wsOut.readY(0) + +Output: + +.. testoutput:: ExSphericalAbsorption + + The created workspace has spectra: [ 0.8451289 0.79101809 0.74254761 0.69867599 0.65861079 0.63477521] + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/UnwrapSNS-v1.rst b/Code/Mantid/docs/source/algorithms/UnwrapSNS-v1.rst index 0567ce053b4a8028f32008da7ed35473a2bf006b..813187b010a3688d70e9b4474d556b0b4d095ddf 100644 --- a/Code/Mantid/docs/source/algorithms/UnwrapSNS-v1.rst +++ b/Code/Mantid/docs/source/algorithms/UnwrapSNS-v1.rst @@ -9,13 +9,14 @@ Description ----------- -| Slow moving (low energy and long wavelength neutrons) maybe detected +Slow moving (low energy and long wavelength neutrons) may be detected after the end of the frame in which they entered the experimental apparatus. A schematic example of this is shown below where the neutrons are marked as circles. -| |Schematic diagram of neutrons entering an instrument and being -detected\|centre\|| -| The two neutons on the right of the diagram were actually produced in + +.. figure:: /images/UnwrapSNS_inst.png + +The two neutons on the right of the diagram were actually produced in frame 1 but will be recorded in frame 2 at low time of flight (TOF) and a straight :ref:`algm-ConvertUnits` will bin them at high energy and short wavelength! :ref:`algm-UnwrapSNS` moves those particles to @@ -42,6 +43,25 @@ the difference between Tmax and Tmin. DataFrameWidth overrides this and the width is the difference between the longest and shortest TOFs in the data. -.. |Schematic diagram of neutrons entering an instrument and being detected\|centre\|| image:: /images/UnwrapSNS_inst.png + +Usage +----- + +**Example: Unwrap sample data** + +.. testcode:: ExUnwrapSNS + + ws = CreateSampleWorkspace("Event",NumBanks=1,BankPixelWidth=1) + wsOut = UnwrapSNS(ws,LRef=10) + + print "Input", ws.readY(0)[ws.blocksize()-1] + print "Output", wsOut.readY(0)[wsOut.blocksize()-1] + +Output: + +.. testoutput:: ExUnwrapSNS + + Input 30.0 + Output 0.0 .. categories::