Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.. algorithm::
.. summary::
.. alias::
.. properties::
Description
-----------
Applies algorithm :ref:`algm-Cropworkspace` to an input workspace or a group of workspaces to crop the empty time channels. Boundaries are calculated as follows:
:math:`X_{min} = 0`
:math:`X_{max} = N_{fc}\times\Delta t`
where :math:`N_{fc}` is the number of full time channels defined in the *full_channels* sample log and :math:`\Delta t` is the channel width defined in the *channel_width* sample log.
Restrictions on the input workspace
###################################
- The unit of the X-axis must be **Time-of-flight**.
- Workspace must contain *channel_width* and *full_channels* sample logs.
Usage
-----
**Example**
.. testcode:: ExTOFTOFCropWorkspace
# Load data
ws=Load(Filename='TOFTOFTestdata.nxs')
print "Input workspace"
print "Total number of time channels: ", len(ws.readX(0))
print "Number of filled time channels: ", ws.getRun().getLogData('full_channels').value
wscropped = TOFTOFCropWorkspace(ws)
print "Output workspace"
print "Total number of time channels: ", len(wscropped.readX(0))
Output:
.. testoutput:: ExTOFTOFCropWorkspace
Input workspace
Total number of time channels: 1025
Number of filled time channels: 1020.0
Output workspace
Total number of time channels: 1020
.. categories::
.. sourcelink::