diff --git a/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst b/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst index 28b4f4b4a070fd49f98304874043011e3ee1893c..df37a8c814f1a7a5ef5e898ee9066a47267d0ee3 100644 --- a/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst +++ b/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst @@ -47,10 +47,6 @@ Usage print log_y.value print log_z.value -.. testcleanup:: AddSampleLogExample - DeleteWorkspace('demo_ws') - DeleteWorkspace('corrected_ws') - Output: .. testoutput:: AddSampleLogExample diff --git a/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst b/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst index 7e0034112e2f8fa3cb1231056b7900ee727784b1..b87ce6f3db24d477af7f1f76c3b10ec0c3558e49 100644 --- a/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst +++ b/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst @@ -52,6 +52,8 @@ Usage print _or.readY(0) print _xor.readY(0) +Output: + .. testoutput:: BinaryOperateMasksExample [ 2.] diff --git a/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst b/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst index 5f5a1a4ccaf75f9975a683fcd6ad3c18e4f814bf..93d75b150b96ca39ba9ad145f3495a30558bf976 100644 --- a/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst +++ b/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst @@ -38,6 +38,8 @@ Usage print "Number of Indexed Peaks: ", indexed +Output: + .. testoutput:: CalculatePeaksHKLExample Number of Indexed Peaks: 1 diff --git a/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst index 230fe47e33ac02feccc3293dc44123e70b0e5b9b..dce0b974bcbb1996f3b60912611a34fd0d1da040 100644 --- a/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst @@ -12,4 +12,43 @@ Description This can also be performed using the :ref:`algm-Rebin` algorithm and having the "PreserveEvents" parameter set to false. +Usage +----- + +**Example - Simple conversion of an EventWorkspace** + +.. testcode:: ConvertToMatrixWorkspaceSimpleExample + + event_ws = Load('CNCS_7860_event.nxs') + # Run the conversion algorithm + histo_ws = ConvertToMatrixWorkspace(event_ws) + # Check that the original workspace and the converted workspace have the same shape + print event_ws.getNumberHistograms(), event_ws.blocksize() + print histo_ws.getNumberHistograms(), histo_ws.blocksize() + +.. testoutput:: ConvertToMatrixWorkspaceSimpleExample + + 51200 1 + 51200 1 + +**Example - Conversion when blocksize > 1** + +.. testcode:: ConvertToMatrixWorkspaceComplexExample + + event_ws = Load('CNCS_7860_event.nxs') + # Rebin the loaded EventWorkspace to a new EventWorkspace that has > 1 bins + event_ws_rebinned = Rebin(InputWorkspace=event_ws, Params=1e3, PreserveEvents=True) + # Run the conversion algorithm + histo_ws_rebinned = ConvertToMatrixWorkspace(event_ws_rebinned) + # Check that the original workspace and the converted workspace have the same shape + print event_ws_rebinned.getNumberHistograms(), event_ws_rebinned.blocksize() + print histo_ws_rebinned.getNumberHistograms(), histo_ws_rebinned.blocksize() + +Output: + +.. testoutput:: ConvertToMatrixWorkspaceComplexExample + + 51200 17 + 51200 17 + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst b/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst index 1b921fb2f76889be70af9f2c90038d675655bcfe..7aaef432228f5b0732f9bee4095829c7b63a7ac7 100644 --- a/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst @@ -36,6 +36,8 @@ Usage just_intesecting_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=1.00, Extents=[1.0,2.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True) print just_intesecting_box_table.row(0) +Output: + .. testoutput:: PeaksInRegionExample {'Distance': 0.0, 'PeakIndex': 0, 'Intersecting': True} diff --git a/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst b/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst index 0075e4ae957c6c46c58bc3c3e0f1822a7f84fa23..7a7f7ababce5e8ea1182aa02929270e8b74b0ee5 100644 --- a/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst @@ -40,6 +40,8 @@ Usage tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=1.000, CoordinateFrame='HKL', Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset], Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset]) print tbl.row(0) +Output: + .. testoutput:: PeaksOnSurfaceExample {'Distance': 0.0, 'PeakIndex': 0, 'Intersecting': True} diff --git a/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst b/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst index cee85340ab53f58936ec012328cf9b0dd2535c4b..4f06bced816e2bc85cb1a6fa5f9603ce062da9ce 100644 --- a/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst @@ -41,10 +41,6 @@ Usage # Calculate the two theta. two_theta = SpecularReflectionCalculateTheta(InputWorkspace=ws, DetectorComponentName='point-detector', AnalysisMode='PointDetectorAnalysis') print two_theta - - -.. testcleanup:: SpecularReflectionCalculateThetaPointDetectorExample - DeleteWorkspace('ws') Output: diff --git a/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst b/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst index 9d13f81edb9521f621d9631f0b202c7bbe41ff60..86ac3b2acb43880e71fb5553c6a1e08b581568eb 100644 --- a/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst @@ -47,11 +47,6 @@ Usage inst = corrected_ws.getInstrument() det_pos = inst.getComponentByName('point-detector').getPos() print det_pos - - -.. testcleanup:: SpecularReflectionPositionCorrectExample - DeleteWorkspace('ws') - DeleteWorkspace('corrected_ws') Output: