-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleLogsDev.html
351 lines (307 loc) · 14.6 KB
/
SampleLogsDev.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sample Logs</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css?v=fadd4351" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=77160d70" />
<script src="_static/documentation_options.js?v=a8da1a53"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Script Repository" href="ScriptRepository.html" />
<link rel="prev" title="Python vs C++ Algorithms" href="PythonVSCppAlgorithms.html" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59110517-1', 'auto');
ga('send', 'pageview');
</script>
</head><body>
<div id="navbar" class="navbar navbar-default ">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.mantidproject.org">
</a>
<span class="navbar-text navbar-version pull-left"><b>main</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="divider-vertical"></li>
<li><a href="index.html">Home</a></li>
<li><a href="https://download.mantidproject.org">Download</a></li>
<li><a href="https://docs.mantidproject.org">User Documentation</a></li>
<li><a href="http://www.mantidproject.org/contact">Contact Us</a></li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<p>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="index.html">Documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Sample Logs</a></li>
</ul>
</div> </p>
</div>
<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<section id="sample-logs">
<span id="samplelogs-dev"></span><h1>Sample Logs<a class="headerlink" href="#sample-logs" title="Link to this heading">¶</a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#id1" id="id2">Sample logs</a></p></li>
<li><p><a class="reference internal" href="#multiperiod-workspace-sample-logs" id="id3">Multiperiod workspace sample logs</a></p>
<ul>
<li><p><a class="reference internal" href="#period-n" id="id4">period n</a></p></li>
<li><p><a class="reference internal" href="#running" id="id5">running</a></p></li>
<li><p><a class="reference internal" href="#periods" id="id6">periods</a></p></li>
<li><p><a class="reference internal" href="#filtering" id="id7">Filtering</a></p></li>
<li><p><a class="reference internal" href="#event-data" id="id8">Event data</a></p></li>
</ul>
</li>
</ul>
</nav>
<p>The following information will be useful to you if you want to write an
<a class="reference external" href="https://docs.mantidproject.org/nightly/concepts/Algorithm.html#algorithm" title="(in MantidProject v6.11)"><span>Algorithm</span></a> that manipulates sample log data.</p>
<section id="id1">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Sample logs</a><a class="headerlink" href="#id1" title="Link to this heading">¶</a></h2>
<p>When you load a nexus file using Mantid, a set of sample logs relevant to the experimental run are loaded into the
workspace’s run object, which can be accessed through:</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">"MantidAPI/Run.h"</span>
<span class="c1">// Declare property with default settings</span>
<span class="c1">// IndexType::WorkspaceIndex is default</span>
<span class="n">MatrixWorkspace_sptr</span><span class="w"> </span><span class="n">workspace</span><span class="p">;</span>
<span class="p">....</span>
<span class="n">Run</span><span class="w"> </span><span class="o">&</span><span class="n">run</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">workspace</span><span class="o">-></span><span class="n">mutableRun</span><span class="p">()</span>
<span class="c1">// get all log data</span>
<span class="k">auto</span><span class="w"> </span><span class="n">logData</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">run</span><span class="p">.</span><span class="n">getLogData</span><span class="p">()</span>
<span class="c1">// access individual log</span>
<span class="k">auto</span><span class="w"> </span><span class="n">protonCharge</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">run</span><span class="p">.</span><span class="n">getLogData</span><span class="p">(</span><span class="s">"proton_charge"</span><span class="p">)</span>
</pre></div>
</div>
<p>Log data can be added and removed from the run object using the <cite>addLogData</cite> and <cite>removeLogData</cite> methods.</p>
</section>
<section id="multiperiod-workspace-sample-logs">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Multiperiod workspace sample logs</a><a class="headerlink" href="#multiperiod-workspace-sample-logs" title="Link to this heading">¶</a></h2>
<p>When you load multiperiod data using <a class="reference external" href="https://docs.mantidproject.org/nightly/algorithms/LoadISISNexus-v2.html#algm-loadisisnexus-v2" title="(in MantidProject v6.11)"><span>LoadISISNexus v2</span></a> or <a class="reference external" href="https://docs.mantidproject.org/nightly/algorithms/LoadEventNexus-v1.html#algm-loadeventnexus" title="(in MantidProject v6.11)"><span>LoadEventNexus v1</span></a> a set of
periods logs, describing the period information for each workspace are created using the <cite>ISISRunLogs</cite> class.
This class adds three logs, which are summarised as:</p>
<section id="period-n">
<h3><a class="toc-backref" href="#id4" role="doc-backlink">period n</a><a class="headerlink" href="#period-n" title="Link to this heading">¶</a></h3>
<p>This log contains times and boolean flags describing when a period started, but not necessarily when data collection
for that period occurred. For example, a typical sample log entry for this log would read:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Time</p></th>
<th class="head"><p>Boolean flag value</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2020-Oct-20 12:19:40</p></td>
<td><p>0</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:41</p></td>
<td><p>1</p></td>
<td><p>nth period started</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:48</p></td>
<td><p>0</p></td>
<td><p>nth period ended</p></td>
</tr>
</tbody>
</table>
</section>
<section id="running">
<h3><a class="toc-backref" href="#id5" role="doc-backlink">running</a><a class="headerlink" href="#running" title="Link to this heading">¶</a></h3>
<p>This log contains a series of times and boolean describing when a data collection was occurring, for example:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Time</p></th>
<th class="head"><p>Boolean flag value</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2020-Oct-20 12:19:40</p></td>
<td><p>0</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:41</p></td>
<td><p>1</p></td>
<td><p>Data collection started</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:46</p></td>
<td><p>0</p></td>
<td><p>Data collection ended</p></td>
</tr>
</tbody>
</table>
</section>
<section id="periods">
<h3><a class="toc-backref" href="#id6" role="doc-backlink">periods</a><a class="headerlink" href="#periods" title="Link to this heading">¶</a></h3>
<p>This log contains times and period numbers describing when each period started, e.g.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Time</p></th>
<th class="head"><p>Period number</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2020-Oct-20 12:19:40</p></td>
<td><p>1</p></td>
<td><p>Period 1 started</p></td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:49</p></td>
<td><p>2</p></td>
<td><p>Period 2 started</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:56</p></td>
<td><p>3</p></td>
<td><p>Period 3 started</p></td>
</tr>
</tbody>
</table>
<p>These three logs are constructed from the ICP_EVENT which tells you when various “events” of significance to the
software happen, such as beginning or end of a run or a change of period number.</p>
</section>
<section id="filtering">
<h3><a class="toc-backref" href="#id7" role="doc-backlink">Filtering</a><a class="headerlink" href="#filtering" title="Link to this heading">¶</a></h3>
<p>For multiperiod workspaces, time-series data, such as Theta will be filtered by combining the <cite>period n</cite> and <cite>running</cite>
logs, to create a filter describing when data collection for each period occurred. For example, a filter for the nth
period would be described as follows, where we note that each period is described entirely be two boolean values, the
first describing when the data collection started for that period and the second stating when data collection ended.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Time</p></th>
<th class="head"><p>Boolean flag</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2020-Oct-20 12:19:40</p></td>
<td><p>0</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:41</p></td>
<td><p>1</p></td>
<td><p>Data collection for period n started</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:46</p></td>
<td><p>0</p></td>
<td><p>Data collection for period n finished</p></td>
</tr>
</tbody>
</table>
<p>This filtering is performed by the static method <cite>ISISRunLogs::applyLogFiltering</cite>.</p>
</section>
<section id="event-data">
<h3><a class="toc-backref" href="#id8" role="doc-backlink">Event data</a><a class="headerlink" href="#event-data" title="Link to this heading">¶</a></h3>
<p>For event data, an additional <cite>period_log</cite> is present in the workspace, which is created from the <cite>framelog/period_log</cite> entry.
This entry contains the value of various items on a frame by frame (pulse by pulse) basis.
So it is showing you what the neutron acquisition electronics believe the period number to be at the point that bit
of neutron data was recorded.</p>
<p>The <cite>framelog/period_log</cite> entry will therefore contain a list of <cite>m</cite> times and the corresponding period number
which was active during that frame:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Time</p></th>
<th class="head"><p>Period number</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2020-Oct-20 12:19:40</p></td>
<td><p>1</p></td>
<td><p>Period 1 data</p></td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:41</p></td>
<td><p>1</p></td>
<td><p>Period 1 data</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:44</p></td>
<td><p>1</p></td>
<td><p>Period 1 data</p></td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:50</p></td>
<td><p>2</p></td>
<td><p>Period 2 data</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:19:51</p></td>
<td><p>2</p></td>
<td><p>Period 2 data</p></td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:19:52</p></td>
<td><p>3</p></td>
<td><p>Period 3 data</p></td>
</tr>
<tr class="row-even"><td><p>2020-Oct-20 12:20:01</p></td>
<td><p>3</p></td>
<td><p>Period 3 data</p></td>
</tr>
<tr class="row-odd"><td><p>2020-Oct-20 12:20:02</p></td>
<td><p>3</p></td>
<td><p>Period 3 data</p></td>
</tr>
</tbody>
</table>
<p>This log is therefore a combination of the <cite>period n</cite> and <cite>running logs</cite> defined above, whereby it records the times and
periods during data collection. However, rather than recording a single value describing when
the data collection for that period started, the <cite>framelog</cite> data contains a discrete number of time recordings
corresponding to the period that each “bit” of neutron data was collected in.</p>
</section>
</section>
</section>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<ul class="nav navbar-nav" style=" float: right;">
<li>
<a href="PythonVSCppAlgorithms.html" title="Previous Chapter: Python vs C++ Algorithms"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« Python vs C++...</span>
</a>
</li>
<li>
<a href="ScriptRepository.html" title="Next Chapter: Script Repository"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Script Repository »</span>
</a>
</li>
<li><a href="#">Back to top</a></li>
</ul>
<p>
</p>
</div>
</footer>
</body>
</html>