File: libharp_dataset.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 (385 lines) | stat: -rw-r--r-- 18,985 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


<!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>Dataset &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="Documentation" href="libharp_documentation.html" />
    <link rel="prev" title="Collocation" href="libharp_collocation.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"><a class="reference internal" href="libharp_collocation.html">Collocation</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">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>Dataset</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="dataset">
<h1>Dataset</h1>
<dl class="group">
<dt>
<span class="target" id="group__harp__dataset"></span><em>group</em> <code class="descname">harp_dataset</code></dt>
<dd><p>The HARP harp_dataset module contains everything regarding HARP datasets.</p>
<p>A Dataset contains a list of references to HARP products together with optional metadata on each product. The primary reference to a product is the value of the ‘source_product’ global attribute of a HARP product. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv312harp_dataset">
<span id="_CPPv212harp_dataset"></span><span id="harp_dataset"></span><span class="target" id="group__harp__dataset_1gad68088d6c638ed1a84703b99773caa52"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="#_CPPv319harp_dataset_struct" title="harp_dataset_struct">harp_dataset_struct</a> <code class="descname">harp_dataset</code><br /></dt>
<dd><p>HARP Dataset typedef </p>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv316harp_dataset_newPP12harp_dataset">
<span id="_CPPv216harp_dataset_newPP12harp_dataset"></span><span id="harp_dataset_new__harp_datasetPP"></span><span class="target" id="group__harp__dataset_1ga35ac46cdc9370a916fd14ef144051f3e"></span>int <code class="descname">harp_dataset_new</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> **<em>new_dataset</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Create new HARP dataset. The metadata will be intialized with zero product metadata elements. <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_dataset</span></code>: Pointer to the C variable where the new HARP product metadata will be stored. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv319harp_dataset_deleteP12harp_dataset">
<span id="_CPPv219harp_dataset_deleteP12harp_dataset"></span><span id="harp_dataset_delete__harp_datasetP"></span><span class="target" id="group__harp__dataset_1gabee5947f6968607661a761a5ac4c4ca7"></span>void <code class="descname">harp_dataset_delete</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Delete HARP dataset. <dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">dataset</span></code>: Pointer to the dataset to free. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv318harp_dataset_printP12harp_datasetPFiPKczE">
<span id="_CPPv218harp_dataset_printP12harp_datasetPFiPKczE"></span><span class="target" id="group__harp__dataset_1ga9b2f2eb09902c7416baeff016491cbd6"></span>void <code class="descname">harp_dataset_print</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em>, int (*<em>print</em>)<span class="sig-paren">(</span><em class="property">const</em> char *, ...<span class="sig-paren">)</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Print HARP dataset. <dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">dataset</span></code>: Pointer to the dataset to print. </li>
<li><code class="docutils literal notranslate"><span class="pre">print</span></code>: Pointer to the function that should be used for printing. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv319harp_dataset_importP12harp_datasetPKcPKc">
<span id="_CPPv219harp_dataset_importP12harp_datasetPKcPKc"></span><span id="harp_dataset_import__harp_datasetP.cCP.cCP"></span><span class="target" id="group__harp__dataset_1gaf09a7b6ceec6c24ff158aae030c128fa"></span>int <code class="descname">harp_dataset_import</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em>, <em class="property">const</em> char *<em>path</em>, <em class="property">const</em> char *<em>options</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Import metadata for products into the dataset. If path is a directory then all files (recursively) from that directory are added to the dataset. If path references a .pth file then the file paths from that text file (one per line) are imported. These file paths can be absolute or relative and can point to files, directories, or other .pth files. If path references a product file then that file is added to the dataset. Trying to add a file that is not supported by HARP will result in an error.</p>
<p>Note that datasets cannot have multiple entries with the same ‘source_product’ value. Therefore, for each product where the dataset already contained an entry with the same ‘source_product’ value, the metadata of that entry is replaced with the new metadata (instead of adding a new entry to the dataset or raising an error).</p>
<p><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">dataset</span></code>: Dataset into which to import the metadata. </li>
<li><code class="docutils literal notranslate"><span class="pre">path</span></code>: Path to either a directory containing product files, a .pth file, or a single product file. </li>
<li><code class="docutils literal notranslate"><span class="pre">options</span></code>: Ingestion module specific options (optional); should be specified as a semi-colon separated string of key=value pair; only used for product files that are not already in HARP format. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv342harp_dataset_get_index_from_source_productP12harp_datasetPKcPl">
<span id="_CPPv242harp_dataset_get_index_from_source_productP12harp_datasetPKcPl"></span><span id="harp_dataset_get_index_from_source_product__harp_datasetP.cCP.lP"></span><span class="target" id="group__harp__dataset_1gab92a6e6a9952685cd7cf1aa0036c5ce7"></span>int <code class="descname">harp_dataset_get_index_from_source_product</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em>, <em class="property">const</em> char *<em>source_product</em>, long *<em>index</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Lookup the index of source_product in the given dataset. <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">dataset</span></code>: Dataset to get index in. </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product</span></code>: Source product reference. </li>
<li><code class="docutils literal notranslate"><span class="pre">index</span></code>: Pointer to the C variable where the index in the dataset for the product is returned. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv324harp_dataset_has_productP12harp_datasetPKc">
<span id="_CPPv224harp_dataset_has_productP12harp_datasetPKc"></span><span id="harp_dataset_has_product__harp_datasetP.cCP"></span><span class="target" id="group__harp__dataset_1ga58e6344eb1d20b96e5ec51063c5a2b95"></span>int <code class="descname">harp_dataset_has_product</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em>, <em class="property">const</em> char *<em>source_product</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Test if dataset contains an entry with the specified source product reference. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">0</span></code>, Dataset does not contain a product with the specific source reference. </li>
<li><code class="docutils literal notranslate"><span class="pre">1</span></code>, Dataset contains a product with the specific source reference. </li>
</ul>
</dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal notranslate"><span class="pre">dataset</span></code>: Dataset in which to find the product. </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product</span></code>: Source product reference. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv324harp_dataset_add_productP12harp_datasetPKcP21harp_product_metadata">
<span id="_CPPv224harp_dataset_add_productP12harp_datasetPKcP21harp_product_metadata"></span><span id="harp_dataset_add_product__harp_datasetP.cCP.harp_product_metadataP"></span><span class="target" id="group__harp__dataset_1gaeb9189ed0ccc571893ecf40d06566044"></span>int <code class="descname">harp_dataset_add_product</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv312harp_dataset" title="harp_dataset">harp_dataset</a> *<em>dataset</em>, <em class="property">const</em> char *<em>source_product</em>, <a class="reference internal" href="libharp_product_metadata.html#_CPPv321harp_product_metadata" title="harp_product_metadata">harp_product_metadata</a> *<em>metadata</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Add a product reference to a dataset. <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">dataset</span></code>: Dataset in which to add a new entry. </li>
<li><code class="docutils literal notranslate"><span class="pre">source_product</span></code>: The source product reference of the new entry. </li>
<li><code class="docutils literal notranslate"><span class="pre">metadata</span></code>: The product metadata of the new entry (can be NULL); the dataset is the new owner of metadata. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<dl class="class">
<dt id="_CPPv319harp_dataset_struct">
<span id="_CPPv219harp_dataset_struct"></span><span id="harp_dataset_struct"></span><span class="target" id="structharp__dataset__struct"></span><em class="property">struct </em><code class="descname">harp_dataset_struct</code><br /></dt>
<dd><em>#include &lt;harp.h&gt;</em><p>HARP Dataset struct </p>
</dd></dl>

</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="libharp_documentation.html" class="btn btn-neutral float-right" title="Documentation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="libharp_collocation.html" class="btn btn-neutral" title="Collocation" 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>