Mantid Examples: Simple1D and contour plotting

From MantidProject

Jump to: navigation, search

Contents

Setup

  1. Copy the GEM data file to the c:\MantidInstall\Data directory.

Loading a workspace

  1. Start MantidPlot
  2. On the Mantid workspaces toolbox click the Load button and select Load Raw File
  3. In the Load Raw File window click the browse button next to the filename entry
  4. Find an load the GEM file you just copied. It should be in c:\MantidInstall\Data
  5. Click OK on the Load Raw File Window.
  6. When that completes the Mantid Workspaces toolbox should contain a workspace called GEM38370

Displaying the data in a grid

  1. Right click on the workspace GEM38370 and then select "Show Data".
  2. In the Set Histogram Range window you should set the from field to 200 (this will exclude the monitors).
  3. A workspace window (blue) will appear this includes tabs for the data values, counts and bin boundary values for the workspace.

Creating a contour plot

  1. Click on the workspace window to select it and then click the 3D plot menu
  2. Select Contour and colour fill.
  3. A contour plot of the data should appear.
  4. The magnifiying glass icons in the toolbars allow you to zoom in and out of the plot.

Running a rebin algorithm

  1. Click in the box next to the execute button in the Mantid Algorithms toolbox.
  2. Type "rebin" (without the quotes) and hit enter
  3. A properties box for the rebin algorithm should appear.
  4. Enter the following:
    1. InputWorkspace - GEM38370
    2. OutputWorkspace - MyWorkspace
    3. param - 0,200,20000
  5. Click OK
  6. When that completes you will have another workspace in the Workspaces toolbox called MyWorkspace

Creating a 1D plot

  1. Create a workspace window for your new workspace as before (in the section "Displaying the data in a grid"), you can also just double click the workspace if you want to save time.
  2. In you MyWorkspace window left click on one of the grey row labels to select the row
  3. Right click on the same row to bring up the context menu.
  4. Choose Plot spectra (values only)
  5. A 1D plot of the data from that spectra should appear

It is also possible to script all of the above actions using Python. Help with this can be found at Learning_Python along with this example as a pre-written script.

Personal tools
Create a book