File: libharp_collocation.html

package info (click to toggle)
harp 1.5%2Bdata-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,032 kB
  • sloc: xml: 286,510; ansic: 143,710; yacc: 1,910; python: 913; makefile: 600; lex: 574; sh: 69
file content (529 lines) | stat: -rw-r--r-- 33,592 bytes parent folder | download
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529


<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Collocation &mdash; HARP 1.5 documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="next" title="Dataset" href="libharp_dataset.html" />
    <link rel="prev" title="C library" href="libharp.html" /> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> HARP
          

          
          </a>

          
            
            
              <div class="version">
                1.5
              </div>
            
          

          

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="conventions/index.html">Conventions</a></li>
<li class="toctree-l1"><a class="reference internal" href="algorithms/index.html">Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="operations.html">Operations</a></li>
<li class="toctree-l1"><a class="reference internal" href="ingestions/index.html">Ingestion definitions</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="libharp.html">C library</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="libharp.html#introduction">Introduction</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="libharp.html#modules">Modules</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Collocation</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_dataset.html">Dataset</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_documentation.html">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_error.html">Error</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_general.html">General</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_product.html">Product</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_product_metadata.html">Product Metadata</a></li>
<li class="toctree-l3"><a class="reference internal" href="libharp_variable.html">Variable</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="idl.html">IDL interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="matlab.html">MATLAB interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="tools.html">Command line tools</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">HARP</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
          <li><a href="libharp.html">C library</a> &raquo;</li>
        
      <li>Collocation</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="collocation">
<h1>Collocation</h1>
<dl class="group">
<dt>
<span class="target" id="group__harp__collocation"></span><em>group</em> <code class="descname">harp_collocation</code></dt>
<dd><p>The HARP Collocation module contains the functionality that deals with collocation two datasets of products. The two datasets are referred to as dataset A (primary) and dataset B (secondary). The result of a collocation is a list of pairs. Each pair references a measurement from dataset A (using the source product name and measurement index within that product) and a measurement from dataset B. Each collocation pair also gets a unique collocation_index sequence number. For each collocation criteria used in the matchup the actual difference is stored as part of the pair as well. Collocation results can be written to and read from a csv file. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv321harp_collocation_pair">
<span id="_CPPv221harp_collocation_pair"></span><span id="harp_collocation_pair"></span><span class="target" id="group__harp__collocation_1ga0d5cd2a5de254da66941cc813a16d81e"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="#_CPPv328harp_collocation_pair_struct" title="harp_collocation_pair_struct">harp_collocation_pair_struct</a> <code class="descname">harp_collocation_pair</code><br /></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv323harp_collocation_result">
<span id="_CPPv223harp_collocation_result"></span><span id="harp_collocation_result"></span><span class="target" id="group__harp__collocation_1gadce42cfa00c3c02cfdb339c3e825147e"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="#_CPPv330harp_collocation_result_struct" title="harp_collocation_result_struct">harp_collocation_result_struct</a> <code class="descname">harp_collocation_result</code><br /></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv327harp_collocation_result_newPP23harp_collocation_resultiPPKcPPKc">
<span id="_CPPv227harp_collocation_result_newPP23harp_collocation_resultiPPKcPPKc"></span><span id="harp_collocation_result_new__harp_collocation_resultPP.i.cCPP.cCPP"></span><span class="target" id="group__harp__collocation_1ga6031ad343e7d81272882937baa3c6053"></span>int <code class="descname">harp_collocation_result_new</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> **<em>new_collocation_result</em>, int <em>num_differences</em>, <em class="property">const</em> char **<em>difference_variable_name</em>, <em class="property">const</em> char **<em>difference_unit</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Create a new collocation result set <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">new_collocation_result</span></code>: Pointer to the C variable where the new result set will be stored. </li>
<li><code class="docutils literal notranslate"><span class="pre">num_differences</span></code>: The number of differences that have been calculated per pair for the collocation result </li>
<li><code class="docutils literal notranslate"><span class="pre">difference_variable_name</span></code>: An array of variable names describing the type of difference for each calculated difference </li>
<li><code class="docutils literal notranslate"><span class="pre">difference_unit</span></code>: An array of units for each calculated difference </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv330harp_collocation_result_deleteP23harp_collocation_result">
<span id="_CPPv230harp_collocation_result_deleteP23harp_collocation_result"></span><span id="harp_collocation_result_delete__harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1ga47424f40bc53ed860f2134390239a984"></span>void <code class="descname">harp_collocation_result_delete</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Remove a collocation result set <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be removed. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv333harp_collocation_result_sort_by_aP23harp_collocation_result">
<span id="_CPPv233harp_collocation_result_sort_by_aP23harp_collocation_result"></span><span id="harp_collocation_result_sort_by_a__harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1gaf908294e4c686bb1a24670e29b500a2b"></span>int <code class="descname">harp_collocation_result_sort_by_a</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sort the collocation result pairs by dataset A Results will be sorted first by product index of A and then by sample index of A <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be sorted in place. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv333harp_collocation_result_sort_by_bP23harp_collocation_result">
<span id="_CPPv233harp_collocation_result_sort_by_bP23harp_collocation_result"></span><span id="harp_collocation_result_sort_by_b__harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1ga7349b1f733e1b0d1042608a832af30dd"></span>int <code class="descname">harp_collocation_result_sort_by_b</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sort the collocation result pairs by dataset B Results will be sorted first by product index of B and then by sample index of B <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be sorted in place. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv349harp_collocation_result_sort_by_collocation_indexP23harp_collocation_result">
<span id="_CPPv249harp_collocation_result_sort_by_collocation_indexP23harp_collocation_result"></span><span id="harp_collocation_result_sort_by_collocation_index__harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1ga5dbfa18bb076beb44e27ffbe2be8a1c3"></span>int <code class="descname">harp_collocation_result_sort_by_collocation_index</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sort the collocation result pairs by collocation index <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be sorted in place. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv351harp_collocation_result_filter_for_source_product_aP23harp_collocation_resultPKc">
<span id="_CPPv251harp_collocation_result_filter_for_source_product_aP23harp_collocation_resultPKc"></span><span id="harp_collocation_result_filter_for_source_product_a__harp_collocation_resultP.cCP"></span><span class="target" id="group__harp__collocation_1gacbab6bf6d38980dec0a07f27d47dd874"></span>int <code class="descname">harp_collocation_result_filter_for_source_product_a</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, <em class="property">const</em> char *<em>source_product</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Filter collocation result set for a specific product from dataset A Only results that contain the referenced source product will be retained. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be filtered in place. </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product</span></code>: source product reference from dataset A that should be filtered on. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv351harp_collocation_result_filter_for_source_product_bP23harp_collocation_resultPKc">
<span id="_CPPv251harp_collocation_result_filter_for_source_product_bP23harp_collocation_resultPKc"></span><span id="harp_collocation_result_filter_for_source_product_b__harp_collocation_resultP.cCP"></span><span class="target" id="group__harp__collocation_1gacc8a807955504326fb20f8d31b5fcf6f"></span>int <code class="descname">harp_collocation_result_filter_for_source_product_b</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, <em class="property">const</em> char *<em>source_product</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Filter collocation result set for a specific product from dataset B Only results that contain the referenced source product will be retained. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be filtered in place. </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product</span></code>: source product reference from dataset B that should be filtered on. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv343find_collocation_pair_for_collocation_indexP23harp_collocation_resultlPl">
<span id="_CPPv243find_collocation_pair_for_collocation_indexP23harp_collocation_resultlPl"></span><span id="find_collocation_pair_for_collocation_index__harp_collocation_resultP.l.lP"></span><span class="target" id="group__harp__collocation_1gafe041cef46bfe13cc4d6060ada2d38f0"></span><em class="property">static</em> int <code class="descname">find_collocation_pair_for_collocation_index</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, long <em>collocation_index</em>, long *<em>index</em><span class="sig-paren">)</span><br /></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv354harp_collocation_result_filter_for_collocation_indicesP23harp_collocation_resultlP7int32_t">
<span id="_CPPv254harp_collocation_result_filter_for_collocation_indicesP23harp_collocation_resultlP7int32_t"></span><span id="harp_collocation_result_filter_for_collocation_indices__harp_collocation_resultP.l.int32_tP"></span><span class="target" id="group__harp__collocation_1ga7008e5754fbf0124d36b5e78a769e884"></span>int <code class="descname">harp_collocation_result_filter_for_collocation_indices</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, long <em>num_indices</em>, int32_t *<em>collocation_index</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Filter collocation result set for the specified list of collocation indices. The collocation result pairs will be sorted according to the order in the provided <em>collocation_index</em> parameter. If a collocation index cannot be found in the collocation_result set then an error will be thrown. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be filtered in place. </li>
<li><code class="docutils literal notranslate"><span class="pre">num_indices</span></code>: Number of items in the collocation_index parameter. </li>
<li><code class="docutils literal notranslate"><span class="pre">collocation_index</span></code>: Array of collocation index values to match against the collocation_result set. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv332harp_collocation_result_add_pairP23harp_collocation_resultlPKclPKcliPKd">
<span id="_CPPv232harp_collocation_result_add_pairP23harp_collocation_resultlPKclPKcliPKd"></span><span id="harp_collocation_result_add_pair__harp_collocation_resultP.l.cCP.l.cCP.l.i.doubleCP"></span><span class="target" id="group__harp__collocation_1ga44134180c3a56546a89c8c28eecee0c7"></span>int <code class="descname">harp_collocation_result_add_pair</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, long <em>collocation_index</em>, <em class="property">const</em> char *<em>source_product_a</em>, long <em>index_a</em>, <em class="property">const</em> char *<em>source_product_b</em>, long <em>index_b</em>, int <em>num_differences</em>, <em class="property">const</em> double *<em>difference</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Add collocation result entry to a result set <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>this function will not check for uniqueness of the collocation_index values in the resulting set </dd>
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set that will be extended </li>
<li><code class="docutils literal notranslate"><span class="pre">collocation_index</span></code>: Unique index of the pair in the overall collocation result </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product_a</span></code>: Name of the source_product attribute of the product from dataset A </li>
<li><code class="docutils literal notranslate"><span class="pre">index_a</span></code>: Value of the index variable for the matching sample in the product from dataset A </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product_b</span></code>: Name of the source_product attribute of the product from dataset B </li>
<li><code class="docutils literal notranslate"><span class="pre">index_b</span></code>: Value of the index variable for the matching sample in the product from dataset B </li>
<li><code class="docutils literal notranslate"><span class="pre">num_differences</span></code>: Number of calculated differences (should equal the number of differences with which the collocation result was initialized) </li>
<li><code class="docutils literal notranslate"><span class="pre">difference</span></code>: Array of difference values </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv344harp_collocation_result_remove_pair_at_indexP23harp_collocation_resultl">
<span id="_CPPv244harp_collocation_result_remove_pair_at_indexP23harp_collocation_resultl"></span><span id="harp_collocation_result_remove_pair_at_index__harp_collocation_resultP.l"></span><span class="target" id="group__harp__collocation_1ga0ff0f268cbe8d1eda814a31bcc148a68"></span>int <code class="descname">harp_collocation_result_remove_pair_at_index</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em>, long <em>index</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Remove collocation result entry from a result set <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Result set from which to remove the entry </li>
<li><code class="docutils literal notranslate"><span class="pre">index</span></code>: Zero-based index in the collocation result set of the entry that should be removed </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv328harp_collocation_result_readPKcPP23harp_collocation_result">
<span id="_CPPv228harp_collocation_result_readPKcPP23harp_collocation_result"></span><span id="harp_collocation_result_read__cCP.harp_collocation_resultPP"></span><span class="target" id="group__harp__collocation_1gafd767a5195c3337b83229443f74f7837"></span>int <code class="descname">harp_collocation_result_read</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>collocation_result_filename</em>, <a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> **<em>new_collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Read collocation result set from a csv file The csv file should follow the HARP format for collocation result files. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result_filename</span></code>: Full file path to the csv file. </li>
<li><code class="docutils literal notranslate"><span class="pre">new_collocation_result</span></code>: Pointer to the C variable where the new result set will be stored. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv329harp_collocation_result_writePKcP23harp_collocation_result">
<span id="_CPPv229harp_collocation_result_writePKcP23harp_collocation_result"></span><span id="harp_collocation_result_write__cCP.harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1ga11c71ee15582b868a80ce5f997d1f70a"></span>int <code class="descname">harp_collocation_result_write</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>collocation_result_filename</em>, <a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Read collocation result set to a csv file The csv file will follow the HARP format for collocation result files. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Success. </li>
<li><code class="docutils literal notranslate"><span class="pre">-1</span></code>, Error occurred (check <a class="reference internal" href="libharp_error.html#group__harp__error_1gab2eeb46528306c6799632d1e800c4c36"><span class="std std-ref">harp_errno</span></a>). </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result_filename</span></code>: Full file path to the csv file. </li>
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Collocation result set that will be written to file. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv337harp_collocation_result_swap_datasetsP23harp_collocation_result">
<span id="_CPPv237harp_collocation_result_swap_datasetsP23harp_collocation_result"></span><span id="harp_collocation_result_swap_datasets__harp_collocation_resultP"></span><span class="target" id="group__harp__collocation_1ga1ee6e2e544c4db6668948108351d1ef2"></span>void <code class="descname">harp_collocation_result_swap_datasets</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv323harp_collocation_result" title="harp_collocation_result">harp_collocation_result</a> *<em>collocation_result</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Swap the columns of this collocation result inplace.</p>
<p>This swaps datasets A and B (such that A becomes B and B becomes A). <dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">collocation_result</span></code>: Collocation result whose datasets should be swapped. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<dl class="class">
<dt id="_CPPv328harp_collocation_pair_struct">
<span id="_CPPv228harp_collocation_pair_struct"></span><span id="harp_collocation_pair_struct"></span><span class="target" id="structharp__collocation__pair__struct"></span><em class="property">struct </em><code class="descname">harp_collocation_pair_struct</code><br /></dt>
<dd><em>#include &lt;harp.h&gt;</em><p>Entry for a single matched pair for a collocation between a dataset A and dataset B </p>
</dd></dl>

<dl class="class">
<dt id="_CPPv330harp_collocation_result_struct">
<span id="_CPPv230harp_collocation_result_struct"></span><span id="harp_collocation_result_struct"></span><span class="target" id="structharp__collocation__result__struct"></span><em class="property">struct </em><code class="descname">harp_collocation_result_struct</code><br /></dt>
<dd><em>#include &lt;harp.h&gt;</em><p>HARP Collocation result </p>
</dd></dl>

</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="libharp_dataset.html" class="btn btn-neutral float-right" title="Dataset" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="libharp.html" class="btn btn-neutral" title="C library" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2015-2018 S&amp;T, The Netherlands

    </p>
  </div> 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    
    
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script type="text/javascript" src="_static/jquery.js"></script>
        <script type="text/javascript" src="_static/underscore.js"></script>
        <script type="text/javascript" src="_static/doctools.js"></script>
        <script async="async" type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    

  

  <script type="text/javascript" src="_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>