diff --git a/docs/source/algorithms/CompactMD-v1.rst b/docs/source/algorithms/CompactMD-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..388f9ca7a084c437305608994667507b9665158f --- /dev/null +++ b/docs/source/algorithms/CompactMD-v1.rst @@ -0,0 +1,62 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- +Used to crop an n-dimensional :ref:`MDHistoWorkspace <MDHistoWorkspace>` to the first non-zero signal values found in all dimensions. + +Cropping +-------- +The cropping is done by supplying `IntegrateMDHistoWorkspace <http://docs.mantidproject.org/nightly/algorithms/IntegrateMDHistoWorkspace-v1.html>`__ with the minimum and maximum extents associated with the first non-zero +signal values in the workspace. + + +Usage +----- + + +**Example - CompactMD on MDHistoWorkspace** + +.. testcode:: CompactMDOnMDHistoWorkspace + + import math + #create an MDEventWorkspace for Rebinning + mdws = CreateMDWorkspace(Dimensions=3, Extents='-10,10,-10,10,-10,10', Names='A,B,C', Units='U,U,U') + FakeMDEventData(InputWorkspace=mdws, PeakParams='100000,-5,-5,0,1') + FakeMDEventData(InputWorkspace=mdws, PeakParams='100000,0,0,0,1') + FakeMDEventData(InputWorkspace=mdws, PeakParams='100000,5,5,0,1') + #Rebin mdws to create an MDHistoWorkspace + binned_ws = BinMD(InputWorkspace=mdws, AxisAligned=False, BasisVector0='a,unit,1,1,0',BasisVector1='b,unit,-1,1,0',BasisVector2='c,unit,0,0,1',NormalizeBasisVectors=True,Translation=[-10,-10,0], OutputExtents=[0,math.sqrt(2*20*20),-2,2,-10,10], OutputBins=[100, 100, 1] ) + + #A visualisation of the rebinned_ws can be found in the 'Input' section below. + + #run CompactMD on the rebinned workspace + compact_output = CompactMD(binned_ws) + + #A visualisation of the compacted workspace can be found in the 'Output' section below. + +Input: + +.. figure:: /images/RebbinedWorkspaceNoCompactMDApplied.jpg + :alt: RebbinedWorkspaceNoCompactMDApplied.jpg + :width: 400px + :align: center + + +Output: + +.. figure:: /images/RebbinedWorkspaceWithCompactMDApplied.jpg + :alt: RebbinedWorkspaceWithCompactMDApplied.jpg + :width: 400px + :align: center + + + +.. categories:: + +.. sourcelink:: \ No newline at end of file diff --git a/docs/source/images/RebbinedWorkspaceNoCompactMDApplied.JPG b/docs/source/images/RebbinedWorkspaceNoCompactMDApplied.JPG new file mode 100644 index 0000000000000000000000000000000000000000..977b23d832c1c10900d09d518dd9e1745776aa92 Binary files /dev/null and b/docs/source/images/RebbinedWorkspaceNoCompactMDApplied.JPG differ diff --git a/docs/source/images/RebbinedWorkspaceWithCompactMDApplied.JPG b/docs/source/images/RebbinedWorkspaceWithCompactMDApplied.JPG new file mode 100644 index 0000000000000000000000000000000000000000..36a4fbc0a412fce0fbb71bd17b3e0c75414ebce4 Binary files /dev/null and b/docs/source/images/RebbinedWorkspaceWithCompactMDApplied.JPG differ