Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
H5FileIOHighLevel.c
Go to the documentation of this file.
1#include <lal/LALStdlib.h>
2#include <lal/LALString.h>
3#include <lal/Units.h>
4#include <lal/H5FileIO.h>
5
6#define TYPECODE CHAR
7#define TYPE CHAR
9#undef TYPECODE
10#undef TYPE
11
12#define TYPECODE I2
13#define TYPE INT2
17#undef TYPECODE
18#undef TYPE
19
20#define TYPECODE I4
21#define TYPE INT4
25#undef TYPECODE
26#undef TYPE
27
28#define TYPECODE I8
29#define TYPE INT8
33#undef TYPECODE
34#undef TYPE
35
36#define TYPECODE U2
37#define TYPE UINT2
41#undef TYPECODE
42#undef TYPE
43
44#define TYPECODE U4
45#define TYPE UINT4
49#undef TYPECODE
50#undef TYPE
51
52#define TYPECODE U8
53#define TYPE UINT8
57#undef TYPECODE
58#undef TYPE
59
60#define TYPECODE S
61#define TYPE REAL4
66#undef TYPECODE
67#undef TYPE
68
69#define TYPECODE D
70#define TYPE REAL8
75#undef TYPECODE
76#undef TYPE
77
78#define TYPECODE C
79#define TYPE COMPLEX8
84#undef TYPECODE
85#undef TYPE
86
87#define TYPECODE Z
88#define TYPE COMPLEX16
93#undef TYPECODE
94#undef TYPE
95
96#define TYPE String
97#define VTYPE LALStringVector
99#undef StringVector
100#undef TYPE
101
102/**
103 * @addtogroup H5FileIOHighLevel_c
104 * @brief High-level routines for reading/writing HDF5 files.
105 * @details
106 * These routines are high-level routines for accessing HDF files.
107 * @{
108 */
109
110/**
111 * @name Routines to Write Vectors to HDF5 files
112 * @{
113 */
114
115/**
116 * @fn int XLALH5FileWriteCHARVector(LALH5File *file, const char *name, CHARVector *vector)
117 * @brief Writes a vector to a #LALH5File
118 * @details
119 * Creates a new HDF5 dataset with name @p name within a HDF5 file
120 * associated with the #LALH5File @p file structure and allocates a
121 * The data in the dataset is set to the data in the vector @p vector.
122 *
123 * The #LALH5File @p file passed to this routine must be a file
124 * opened for writing.
125 *
126 * @param file Pointer to a #LALH5File structure in which to create the dataset.
127 * @param name Pointer to a string with the name of the dataset to create.
128 * @param vector Pointer to a vector structure containing the data.
129 * @retval 0 Success.
130 * @retval -1 Failure.
131 */
132
133/**
134 * @fn int XLALH5FileWriteINT2Vector(LALH5File *file, const char *name, INT2Vector *vector)
135 * @copydoc XLALH5FileWriteCHARVector()
136 */
137
138/**
139 * @fn int XLALH5FileWriteINT4Vector(LALH5File *file, const char *name, INT4Vector *vector)
140 * @copydoc XLALH5FileWriteCHARVector()
141 */
142
143/**
144 * @fn int XLALH5FileWriteINT8Vector(LALH5File *file, const char *name, INT8Vector *vector)
145 * @copydoc XLALH5FileWriteCHARVector()
146 */
147
148/**
149 * @fn int XLALH5FileWriteUINT2Vector(LALH5File *file, const char *name, UINT2Vector *vector)
150 * @copydoc XLALH5FileWriteCHARVector()
151 */
152
153/**
154 * @fn int XLALH5FileWriteUINT4Vector(LALH5File *file, const char *name, UINT4Vector *vector)
155 * @copydoc XLALH5FileWriteCHARVector()
156 */
157
158/**
159 * @fn int XLALH5FileWriteUINT8Vector(LALH5File *file, const char *name, UINT8Vector *vector)
160 * @copydoc XLALH5FileWriteCHARVector()
161 */
162
163/**
164 * @fn int XLALH5FileWriteREAL4Vector(LALH5File *file, const char *name, REAL4Vector *vector)
165 * @copydoc XLALH5FileWriteCHARVector()
166 */
167
168/**
169 * @fn int XLALH5FileWriteREAL8Vector(LALH5File *file, const char *name, REAL8Vector *vector)
170 * @copydoc XLALH5FileWriteCHARVector()
171 */
172
173/**
174 * @fn int XLALH5FileWriteCOMPLEX8Vector(LALH5File *file, const char *name, COMPLEX8Vector *vector)
175 * @copydoc XLALH5FileWriteCHARVector()
176 */
177
178/**
179 * @fn int XLALH5FileWriteCOMPLEX16Vector(LALH5File *file, const char *name, COMPLEX16Vector *vector)
180 * @copydoc XLALH5FileWriteCHARVector()
181 */
182
183/**
184 * @fn int XLALH5FileWriteStringVector(LALH5File *file, const char *name, LALStringVector *vector)
185 * @copydoc XLALH5FileWriteCHARVector()
186 */
187
188/** @} */
189
190/**
191 * @name Routines to Write Arrays to HDF5 Files
192 * @{
193 */
194
195/**
196 * @fn int XLALH5FileWriteINT2Array(LALH5File *file, const char *name, INT2Array *array)
197 * @brief Writes an array to a #LALH5File
198 * @details
199 * Creates a new HDF5 dataset with name @p name within a HDF5 file
200 * associated with the #LALH5File @p file structure and allocates a
201 * The data in the dataset is set to the data in the array @p array.
202 *
203 * The #LALH5File @p file passed to this routine must be a file
204 * opened for writing.
205 *
206 * @param file Pointer to a #LALH5File structure in which to create the dataset.
207 * @param name Pointer to a string with the name of the dataset to create.
208 * @param array Pointer to an array structure containing the data.
209 * @retval 0 Success.
210 * @retval -1 Failure.
211 */
212
213/**
214 * @fn int XLALH5FileWriteINT4Array(LALH5File *file, const char *name, INT4Array *array)
215 * @copydoc XLALH5FileWriteINT2Array()
216 */
217
218/**
219 * @fn int XLALH5FileWriteINT8Array(LALH5File *file, const char *name, INT8Array *array)
220 * @copydoc XLALH5FileWriteINT2Array()
221 */
222
223/**
224 * @fn int XLALH5FileWriteUINT2Array(LALH5File *file, const char *name, UINT2Array *array)
225 * @copydoc XLALH5FileWriteINT2Array()
226 */
227
228/**
229 * @fn int XLALH5FileWriteUINT4Array(LALH5File *file, const char *name, UINT4Array *array)
230 * @copydoc XLALH5FileWriteINT2Array()
231 */
232
233/**
234 * @fn int XLALH5FileWriteUINT8Array(LALH5File *file, const char *name, UINT8Array *array)
235 * @copydoc XLALH5FileWriteINT2Array()
236 */
237
238/**
239 * @fn int XLALH5FileWriteREAL4Array(LALH5File *file, const char *name, REAL4Array *array)
240 * @copydoc XLALH5FileWriteINT2Array()
241 */
242
243/**
244 * @fn int XLALH5FileWriteREAL8Array(LALH5File *file, const char *name, REAL8Array *array)
245 * @copydoc XLALH5FileWriteINT2Array()
246 */
247
248/**
249 * @fn int XLALH5FileWriteCOMPLEX8Array(LALH5File *file, const char *name, COMPLEX8Array *array)
250 * @copydoc XLALH5FileWriteINT2Array()
251 */
252
253/**
254 * @fn int XLALH5FileWriteCOMPLEX16Array(LALH5File *file, const char *name, COMPLEX16Array *array)
255 * @copydoc XLALH5FileWriteINT2Array()
256 */
257
258/** @} */
259
260/**
261 * @name Routines to Write Time Series to HDF5 Files
262 * @{
263 */
264
265/**
266 * @fn int XLALH5FileWriteINT2TimeSeries(LALH5File *file, const char *name, INT2TimeSeries *series)
267 * @brief Writes a time series to a #LALH5File
268 * @details
269 * Creates a new HDF5 dataset with name @p name within a HDF5 file
270 * associated with the #LALH5File @p file structure and allocates a
271 * The data in the dataset is set to the data in the time series @p series.
272 * Other metadata (name, epoch, deltaT, f0, and sampleUnits) are set as
273 * attributes.
274 *
275 * The #LALH5File @p file passed to this routine must be a file
276 * opened for writing.
277 *
278 * @param file Pointer to a #LALH5File structure in which to create the dataset.
279 * @param name Pointer to a string with the name of the dataset to create.
280 * @param series Pointer to time series structure containing the data.
281 * @retval 0 Success.
282 * @retval -1 Failure.
283 */
284
285/**
286 * @fn int XLALH5FileWriteINT4TimeSeries(LALH5File *file, const char *name, INT4TimeSeries *series)
287 * @copydoc XLALH5FileWriteINT2TimeSeries()
288 */
289
290/**
291 * @fn int XLALH5FileWriteINT8TimeSeries(LALH5File *file, const char *name, INT8TimeSeries *series)
292 * @copydoc XLALH5FileWriteINT2TimeSeries()
293 */
294
295/**
296 * @fn int XLALH5FileWriteUINT2TimeSeries(LALH5File *file, const char *name, UINT2TimeSeries *series)
297 * @copydoc XLALH5FileWriteINT2TimeSeries()
298 */
299
300/**
301 * @fn int XLALH5FileWriteUINT4TimeSeries(LALH5File *file, const char *name, UINT4TimeSeries *series)
302 * @copydoc XLALH5FileWriteINT2TimeSeries()
303 */
304
305/**
306 * @fn int XLALH5FileWriteUINT8TimeSeries(LALH5File *file, const char *name, UINT8TimeSeries *series)
307 * @copydoc XLALH5FileWriteINT2TimeSeries()
308 */
309
310/**
311 * @fn int XLALH5FileWriteREAL4TimeSeries(LALH5File *file, const char *name, REAL4TimeSeries *series)
312 * @copydoc XLALH5FileWriteINT2TimeSeries()
313 */
314
315/**
316 * @fn int XLALH5FileWriteREAL8TimeSeries(LALH5File *file, const char *name, REAL8TimeSeries *series)
317 * @copydoc XLALH5FileWriteINT2TimeSeries()
318 */
319
320/**
321 * @fn int XLALH5FileWriteCOMPLEX8TimeSeries(LALH5File *file, const char *name, COMPLEX8TimeSeries *series)
322 * @copydoc XLALH5FileWriteINT2TimeSeries()
323 */
324
325/**
326 * @fn int XLALH5FileWriteCOMPLEX16TimeSeries(LALH5File *file, const char *name, COMPLEX16TimeSeries *series)
327 * @copydoc XLALH5FileWriteINT2TimeSeries()
328 */
329
330/** @} */
331
332/**
333 * @name Routines to Write Frequency Series to HDF5 Files
334 * @{
335 */
336
337/**
338 * @fn int XLALH5FileWriteREAL4FrequencySeries(LALH5File *file, const char *name, REAL4FrequencySeries *series)
339 * @brief Writes a frequency series to a #LALH5File
340 * @details
341 * Creates a new HDF5 dataset with name @p name within a HDF5 file
342 * associated with the #LALH5File @p file structure and allocates a
343 * The data in the dataset is set to the data in the frequency series @p series.
344 * Other metadata (name, epoch, deltaF, f0, and sampleUnits) are set as
345 * attributes.
346 *
347 * The #LALH5File @p file passed to this routine must be a file
348 * opened for writing.
349 *
350 * @param file Pointer to a #LALH5File structure in which to create the dataset.
351 * @param name Pointer to a string with the name of the dataset to create.
352 * @param series Pointer to frequency series structure containing the data.
353 * @retval 0 Success.
354 * @retval -1 Failure.
355 */
356
357/**
358 * @fn int XLALH5FileWriteREAL8FrequencySeries(LALH5File *file, const char *name, REAL8FrequencySeries *series)
359 * @copydoc XLALH5FileWriteREAL4FrequencySeries()
360 */
361
362/**
363 * @fn int XLALH5FileWriteCOMPLEX8FrequencySeries(LALH5File *file, const char *name, COMPLEX8FrequencySeries *series)
364 * @copydoc XLALH5FileWriteREAL4FrequencySeries()
365 */
366
367/**
368 * @fn int XLALH5FileWriteCOMPLEX16FrequencySeries(LALH5File *file, const char *name, COMPLEX16FrequencySeries *series)
369 * @copydoc XLALH5FileWriteREAL4FrequencySeries()
370 */
371
372/** @} */
373
374/**
375 * @name Routines to Read Vectors from HDF5 Files
376 * @{
377 */
378
379/**
380 * @fn CHARVector *XLALH5FileReadCHARVector(LALH5File *file, const char *name)
381 * @brief Reads a vector from a #LALH5File
382 * @details
383 * Reads a vector of data from a dataset named @p name in an HDF5 file
384 * associated with the #LALH5File @p file.
385 *
386 * The #LALH5File @p file passed to this routine must be a file
387 * opened for reading.
388 * @param file Pointer to a #LALH5File to be read.
389 * @param name Pointer to a string with the name of the dataset to read.
390 * @returns Pointer to a vector containing the data in the dataset.
391 * @retval NULL Failure.
392 */
393
394/**
395 * @fn INT2Vector *XLALH5FileReadINT2Vector(LALH5File *file, const char *name)
396 * @copydoc XLALH5FileReadCHARVector()
397 */
398
399/**
400 * @fn INT4Vector *XLALH5FileReadINT4Vector(LALH5File *file, const char *name)
401 * @copydoc XLALH5FileReadCHARVector()
402 */
403
404/**
405 * @fn INT8Vector *XLALH5FileReadINT8Vector(LALH5File *file, const char *name)
406 * @copydoc XLALH5FileReadCHARVector()
407 */
408
409/**
410 * @fn UINT2Vector *XLALH5FileReadUINT2Vector(LALH5File *file, const char *name)
411 * @copydoc XLALH5FileReadCHARVector()
412 */
413
414/**
415 * @fn UINT4Vector *XLALH5FileReadUINT4Vector(LALH5File *file, const char *name)
416 * @copydoc XLALH5FileReadCHARVector()
417 */
418
419/**
420 * @fn UINT8Vector *XLALH5FileReadUINT8Vector(LALH5File *file, const char *name)
421 * @copydoc XLALH5FileReadCHARVector()
422 */
423
424/**
425 * @fn REAL4Vector *XLALH5FileReadREAL4Vector(LALH5File *file, const char *name)
426 * @copydoc XLALH5FileReadCHARVector()
427 */
428
429/**
430 * @fn REAL8Vector *XLALH5FileReadREAL8Vector(LALH5File *file, const char *name)
431 * @copydoc XLALH5FileReadCHARVector()
432 */
433
434/**
435 * @fn COMPLEX8Vector *XLALH5FileReadCOMPLEX8Vector(LALH5File *file, const char *name)
436 * @copydoc XLALH5FileReadCHARVector()
437 */
438
439/**
440 * @fn COMPLEX16Vector *XLALH5FileReadCOMPLEX16Vector(LALH5File *file, const char *name)
441 * @copydoc XLALH5FileReadCHARVector()
442 */
443
444/**
445 * @fn LALStringVector *XLALH5FileReadStringVector(LALH5File *file, const char *name)
446 * @copydoc XLALH5FileReadCHARVector()
447 */
448
449/** @} */
450
451/**
452 * @name Routines to Read Arrays from HDF5 Files
453 * @{
454 */
455
456/**
457 * @fn INT2Array *XLALH5FileReadINT2Array(LALH5File *file, const char *name)
458 * @brief Reads an array from a #LALH5File
459 * @details
460 * Reads an array of data from a dataset named @p name in an HDF5 file
461 * associated with the #LALH5File @p file.
462 *
463 * The #LALH5File @p file passed to this routine must be a file
464 * opened for reading.
465 * @param file Pointer to a #LALH5File to be read.
466 * @param name Pointer to a string with the name of the dataset to read.
467 * @returns Pointer to an array containing the data in the dataset.
468 * @retval NULL Failure.
469 */
470
471/**
472 * @fn INT4Array *XLALH5FileReadINT4Array(LALH5File *file, const char *name)
473 * @copydoc XLALH5FileReadINT2Array()
474 */
475
476/**
477 * @fn INT8Array *XLALH5FileReadINT8Array(LALH5File *file, const char *name)
478 * @copydoc XLALH5FileReadINT2Array()
479 */
480
481/**
482 * @fn UINT2Array *XLALH5FileReadUINT2Array(LALH5File *file, const char *name)
483 * @copydoc XLALH5FileReadINT2Array()
484 */
485
486/**
487 * @fn UINT4Array *XLALH5FileReadUINT4Array(LALH5File *file, const char *name)
488 * @copydoc XLALH5FileReadINT2Array()
489 */
490
491/**
492 * @fn UINT8Array *XLALH5FileReadUINT8Array(LALH5File *file, const char *name)
493 * @copydoc XLALH5FileReadINT2Array()
494 */
495
496/**
497 * @fn REAL4Array *XLALH5FileReadREAL4Array(LALH5File *file, const char *name)
498 * @copydoc XLALH5FileReadINT2Array()
499 */
500
501/**
502 * @fn REAL8Array *XLALH5FileReadREAL8Array(LALH5File *file, const char *name)
503 * @copydoc XLALH5FileReadINT2Array()
504 */
505
506/**
507 * @fn COMPLEX8Array *XLALH5FileReadCOMPLEX8Array(LALH5File *file, const char *name)
508 * @copydoc XLALH5FileReadINT2Array()
509 */
510
511/**
512 * @fn COMPLEX16Array *XLALH5FileReadCOMPLEX16Array(LALH5File *file, const char *name)
513 * @copydoc XLALH5FileReadINT2Array()
514 */
515
516/** @} */
517
518/**
519 * @name Routines to Read Time Series from HDF5 Files
520 * @{
521 */
522
523/**
524 * @fn INT2TimeSeries *XLALH5FileReadINT2TimeSeries(LALH5File *file, const char *name)
525 * @brief Reads a time series from a #LALH5File
526 * @details
527 * Reads a time series of data from a dataset named @p name in an HDF5 file
528 * associated with the #LALH5File @p file.
529 *
530 * The #LALH5File @p file passed to this routine must be a file
531 * opened for reading.
532 * @param file Pointer to a #LALH5File to be read.
533 * @param name Pointer to a string with the name of the dataset to read.
534 * @returns Pointer to a time series containing the data in the dataset.
535 * @retval NULL Failure.
536 */
537
538/**
539 * @fn INT4TimeSeries *XLALH5FileReadINT4TimeSeries(LALH5File *file, const char *name)
540 * @copydoc XLALH5FileReadINT2TimeSeries()
541 */
542
543/**
544 * @fn INT8TimeSeries *XLALH5FileReadINT8TimeSeries(LALH5File *file, const char *name)
545 * @copydoc XLALH5FileReadINT2TimeSeries()
546 */
547
548/**
549 * @fn UINT2TimeSeries *XLALH5FileReadUINT2TimeSeries(LALH5File *file, const char *name)
550 * @copydoc XLALH5FileReadINT2TimeSeries()
551 */
552
553/**
554 * @fn UINT4TimeSeries *XLALH5FileReadUINT4TimeSeries(LALH5File *file, const char *name)
555 * @copydoc XLALH5FileReadINT2TimeSeries()
556 */
557
558/**
559 * @fn UINT8TimeSeries *XLALH5FileReadUINT8TimeSeries(LALH5File *file, const char *name)
560 * @copydoc XLALH5FileReadINT2TimeSeries()
561 */
562
563/**
564 * @fn REAL4TimeSeries *XLALH5FileReadREAL4TimeSeries(LALH5File *file, const char *name)
565 * @copydoc XLALH5FileReadINT2TimeSeries()
566 */
567
568/**
569 * @fn REAL8TimeSeries *XLALH5FileReadREAL8TimeSeries(LALH5File *file, const char *name)
570 * @copydoc XLALH5FileReadINT2TimeSeries()
571 */
572
573/**
574 * @fn COMPLEX8TimeSeries *XLALH5FileReadCOMPLEX8TimeSeries(LALH5File *file, const char *name)
575 * @copydoc XLALH5FileReadINT2TimeSeries()
576 */
577
578/**
579 * @fn COMPLEX16TimeSeries *XLALH5FileReadCOMPLEX16TimeSeries(LALH5File *file, const char *name)
580 * @copydoc XLALH5FileReadINT2TimeSeries()
581 */
582
583/** @} */
584
585/**
586 * @name Routines to Read Frequency Series from HDF5 Files
587 * @{
588 */
589
590/**
591 * @fn REAL4FrequencySeries *XLALH5FileReadREAL4FrequencySeries(LALH5File *file, const char *name)
592 * @brief Reads a frequency series from a #LALH5File
593 * @details
594 * Reads a frequency series of data from a dataset named @p name in an HDF5 file
595 * associated with the #LALH5File @p file.
596 *
597 * The #LALH5File @p file passed to this routine must be a file
598 * opened for reading.
599 * @param file Pointer to a #LALH5File to be read.
600 * @param name Pointer to a string with the name of the dataset to read.
601 * @returns Pointer to a frequency series containing the data in the dataset.
602 * @retval NULL Failure.
603 */
604
605/**
606 * @fn REAL8FrequencySeries *XLALH5FileReadREAL8FrequencySeries(LALH5File *file, const char *name)
607 * @copydoc XLALH5FileReadREAL4FrequencySeries()
608 */
609
610/**
611 * @fn COMPLEX8FrequencySeries *XLALH5FileReadCOMPLEX8FrequencySeries(LALH5File *file, const char *name)
612 * @copydoc XLALH5FileReadREAL4FrequencySeries()
613 */
614
615/**
616 * @fn COMPLEX16FrequencySeries *XLALH5FileReadCOMPLEX16FrequencySeries(LALH5File *file, const char *name)
617 * @copydoc XLALH5FileReadREAL4FrequencySeries()
618 */
619
620/** @} */
621
622/** @} */