From b9681648aa376b37ef630f813fda3c5f4c8d8bc6 Mon Sep 17 00:00:00 2001 From: Nick Draper Date: Fri, 13 Jun 2014 14:34:04 +0100 Subject: [PATCH 1/2] re #9638 Usage example for AbsorptionCorrection --- .../algorithms/AbsorptionCorrection-v1.rst | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst index fc1ba8e28f89..8a3a0c8f6842 100644 --- a/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst +++ b/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst @@ -69,4 +69,33 @@ defined because detector, source & sample position are needed. .. |AbsorptionFlow.png| image:: /images/AbsorptionFlow.png +Usage +----- + +**Example: A simple spherical sample** + +.. testcode:: ExSimpleSpere + + #setup the sample shape + sphere = ''' + + + ''' + + ws = CreateSampleWorkspace("Histogram",NumBanks=1) + ws = ConvertUnits(ws,"Wavelength") + CreateSampleShape(ws,sphere) + SetSampleMaterial(ws,ChemicalFormula="V") + + #restrict the number of wavelength points to speed up the example + wsOut = AbsorptionCorrection(ws,NumberOfWavelengthPoints=5) + + print "The created workspace has one entry for each spectra: %i" % wsOut.getNumberHistograms() + +Output: + +.. testoutput:: ExSimpleSpere + + The created workspace has one entry for each spectra: 100 + .. categories:: From 40f5f6b65841b6b3a3691e45305e1eeb4bb736b4 Mon Sep 17 00:00:00 2001 From: Nick Draper Date: Fri, 13 Jun 2014 15:07:46 +0100 Subject: [PATCH 2/2] re #9638 Usage example for AbsorptionCorrection --- .../docs/source/algorithms/AbsorptionCorrection-v1.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst index 8a3a0c8f6842..ed3879d662de 100644 --- a/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst +++ b/Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst @@ -82,11 +82,12 @@ Usage ''' - ws = CreateSampleWorkspace("Histogram",NumBanks=1) + ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1) ws = ConvertUnits(ws,"Wavelength") + ws = Rebin(ws,Param=[1]) CreateSampleShape(ws,sphere) SetSampleMaterial(ws,ChemicalFormula="V") - + #restrict the number of wavelength points to speed up the example wsOut = AbsorptionCorrection(ws,NumberOfWavelengthPoints=5)