PearlPowderDiffractionISIS-v1.rst 5.14 KB
Newer Older
1
2
.. _pearl-powder-diffraction-ref:

3
4
5
6
7
8
===============================
Pearl Powder Diffraction Script
===============================

Overview
--------
9

10
11
12
13
14
15
16
A wide variety of algorithms are available within Mantid for
processing of data, writing results files, etc.  These may be run
interactively, one at a time, but in general scripting (using the
Python scripting language) enables a series of algorithms to be called
in a specific order to carry out more complex tasks, such as data
normalisation and writing data files suitable for input to Rietveld
refinement programmes (GSAS, FullProf, etc).
17
18
The script used to process Pearl data have been integrated to Mantid
which can be found inside the following directory on a Windows machine:
19
`'C:\\\MantidInstall\\scripts\\PearlPowderISIS'`.
20

21
22
23
24
25
Further extensions can be expected for next releases as it is under
active development and feedback is very much welcome. The sections
below describes how the script can be ran and help user develop
understanding of the script. By utilising this script it is assumed
that the scientists/users at ISIS have permission to read and write
26
27
from the network. Where **`P:\\\ `** drive is linked to **`\\\\britannic\\Pearl\\`**
and **`X:\\\ `** drive is linked to **`\\\\isis\\inst$\\NDXPEARL\\Instrument`**.
28

Shahroz Ahmed's avatar
Shahroz Ahmed committed
29
30
31
32
33
34
35
36
Run Requirement
---------------

A simple script is required to be ran inside the `Scripting Window
<http://docs.mantidproject.org/nightly/interfaces/ScriptingWindow.html>`_
on mantid in order to carry out the data normalisation.

The script which is written inside `Scripting Window <http://docs.
37
38
39
mantidproject.org/nightly/interfaces/ScriptingWindow.html>`_ on Mantid
requires the following from the user (followed up with an example
usage):
Shahroz Ahmed's avatar
Shahroz Ahmed committed
40

41
42
43
44
45
- user name e.g: (`'Bull'`)
- cycle number e.g: (`'15_4'`)
- run number/s e.g: (`'92476_92479'`)
- fmode e.g: (`'trans'`)
- ttmode e.g: (`'TT70'`)
46

47
If the following parameters are not passed, the default values are
48
used instead.
49

50
51
- ext e.g: (`'raw'`, `'s01'`) - file extension, default is set as `raw`
- atten e.g: (`True` or `False`) - whether use attentuation file, default
52
  is set as `True`
53
- debug e.g: (`True`or `False`) - whether to use debug mode, default
54
55
  is set as `False`

56
57
- optional: Attentuation file directory - if you would wish to use
  a different Attentuation file e.g:
58
  (`'P:\\Mantid\\Attentuation\\PRL112_DC25_10MM_FF.OUT'`)
59
- optional: Output directory - only if you wish to write out the
60
  files to preferred directory/location instead of the Pearl network.
61
  e.g: (`'C:\\Mantid\\MantidOut\\'`)
62

63
*Usage examples can be found under the* :ref:`pearl-powder-diffraction-usage-ref` *section.*
64

65
66
67
File & Folders
--------------

68
69
70
71
72
73
The routines/script has been differentiated from the list of
directories of `calibration` and `raw` files. The calibration
directories can be found within `'pearl_calib_factory.py'`,
whereas the the raw directories can be found within
`'pearl_cycle_factory.py'`.

74
75
76
77
78
You are not require to set calibration and raw files directory,
unless you are utilising calibration files from your local machine.
The script will automatically find the correct calibration files
on the Pearl network according to the input run number, fmode and
ttmode. All the calibration files can be found in
79
`'P:\\Mantid\\Calibration'`, whereas all the Attenuation (`.OUT`)
80
files can be found within the following directory
81
`'P:\\Mantid\\Attentuation'`.
82

83
The output files by default will be written out to the following
84
85
location: `'P:\\users\\cycle number\\user name'` e.g:
`'P:\\users\\Cycle_15_4\\Bull\\'`, however a personalised output
86
87
88
directory can be provided instead like explained in Run
Requirement section.

89
90
.. _pearl-powder-diffraction-usage-ref:

91
92
93
94
95
96
97
Workflow
--------

PEARL Run Focus Workflow
^^^^^^^^^^^^^^^^^^^^^^^^^
.. diagram:: PEARL-Run_focus-wkflw.dot

98
99
100
Usage
-----

101
**Example 1 - General Script Utilised To Process Powder Diffraction With Pearl**
102
103
104
105
106
107

.. code-block:: python

   import pearl_routines

   # set up the user name and cycle number
108
   pearl_routines.PEARL_startup('Bull','15_4')
109
110

   # set up the directory to the attentuation file
111
   pearl_routines.PEARL_setattenfile(new_atten='P:\\Mantid\\Attentuation\\PRL112_DC25_10MM_FF.OUT')
112

113
   # set up the run number/s, ext, fmode, ttmode, use attentuation file (True), do vanadium normalisation (True)
114
   pearl_routines.PEARL_focus('92476_92479', ext='raw', fmode='trans', ttmode='TT70', atten=True, van_norm=True, debug=False)
115
116
117
118
119
120

**Example 2 - Simplified Script Utilised To Process Powder Diffraction With Pearl**

.. code-block:: python

   import pearl_routines
121

122
123
124
125
   pearl_routines.PEARL_startup('Mantid_Developer','15_4')
   # default values used here for ext ('raw'), atten (True), van_norm (True) and debug (False)
   # uses the default attentuation file within the script - 'PRL985_WC_HOYBIDE_NK_10MM_FF.OUT'
   pearl_routines.PEARL_focus(86329, fmode='trans', ttmode='TT70')
126

127
128
129
130
131
132
**Example 3 - Script Utilised To Process Powder Diffraction With Pearl In Debug Mode**

.. code-block:: python

   import pearl_routines

133
134
135
   pearl_routines.PEARL_startup('Bull','15_4')
   # 's01' is being passed as an extension instead of 'raw' or `nxs`
   pearl_routines.PEARL_focus(92475, 's01', fmode='trans', ttmode='TT70', atten=False, van_norm=True, debug=True)