casacore
Loading...
Searching...
No Matches
casa
HDF5.h
Go to the documentation of this file.
1
// # HDF5.h: Classes binding casacore to the HDF5 C API
2
// # Copyright (C) 2008
3
// # Associated Universities, Inc. Washington DC, USA.
4
// #
5
// # This library is free software; you can redistribute it and/or modify it
6
// # under the terms of the GNU Library General Public License as published by
7
// # the Free Software Foundation; either version 2 of the License, or (at your
8
// # option) any later version.
9
// #
10
// # This library is distributed in the hope that it will be useful, but WITHOUT
11
// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13
// # License for more details.
14
// #
15
// # You should have received a copy of the GNU Library General Public License
16
// # along with this library; if not, write to the Free Software Foundation,
17
// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18
// #
19
// # Correspondence concerning AIPS++ should be addressed as follows:
20
// # Internet email: casa-feedback@nrao.edu.
21
// # Postal address: AIPS++ Project Office
22
// # National Radio Astronomy Observatory
23
// # 520 Edgemont Road
24
// # Charlottesville, VA 22903-2475 USA
25
26
#ifndef CASA_HDF5_H
27
#define CASA_HDF5_H
28
29
// # Includes
30
#include <casacore/casa/aips.h>
31
32
#include <casacore/casa/HDF5/HDF5File.h>
33
#include <casacore/casa/HDF5/HDF5Group.h>
34
#include <casacore/casa/HDF5/HDF5DataSet.h>
35
#include <casacore/casa/HDF5/HDF5Record.h>
36
#include <casacore/casa/HDF5/HDF5Error.h>
37
38
namespace
casacore
{
// # NAMESPACE CASACORE - BEGIN
39
40
// <module>
41
//
42
// <summary>
43
// Classes binding casacore to the HDF5 C API
44
// </summary>
45
46
// <prerequisite>
47
// <li> HDF5 (see http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot)
48
// </prerequisite>
49
50
// <reviewed reviewer="" date="" demos="">
51
// </reviewed>
52
53
// <etymology>
54
// 'HDF5' is version 5 of the Hierarchical Data Format.
55
// </etymology>
56
//
57
// <synopsis>
58
// This module's main purpose is to provide limited, but convenient
59
// access to the HDF5 C API.
60
// The classes offer the following services:
61
// <ul>
62
// <li> The burden of allocating and releasing the HDF5 resources
63
// (the so-called hid-s) is handled in an automatic and
64
// exception-safe way.
65
// <li> The overwhelming and rather hard to use HDF5 C API is hidden.
66
// <li> The standard casacore data types (scalars and arrays) are supported.
67
// Because HDF5 does not support empty strings, they are transparantly
68
// replaced by the value '__empty__'.
69
// Also HDF5 does not support empty arrays, thus they are stored
70
// in a special way using a special compound value.
71
// <li> A Record is stored as a group. Its values (scalars and arrays)
72
// are stored as attributes, while nested records are stored as
73
// nested groups.
74
// <li> Bool values are stored as chars.
75
// <li> Complex values are stored as compounds of two real values.
76
// <li> Large arrays can be stored in HDF5 DataSets with an optional tile size
77
// (chunk size in HDF5 terminology). The array axes are reversed (fully
78
// transparantly) because HDF5 uses C-order, while casacore Arrays use
79
// Fortran-order.
80
// <li> Automatic printing of HDF5 messages is disabled. All errors are
81
// thrown as exceptions (AipsError or derived from it).
82
// </ul>
83
//
84
// The following interface classes are available:
85
// <ul>
86
// <li> HDF5File opens or creates an HDF5 file and closes it automatically.
87
// Furthermore it has a function to test if a file is in HDF5 format.
88
// <li> HDF5DataType defines the HDF5 memory and file data type. It supports
89
// the basic data types, complex, string, arrays and compounds.
90
// <li> HDF5Record reads or writes a Record as a group in an HDF5 object.
91
// <li> HDF5DataSet opens or creates a possible tiled data set in an HDF5
92
// object. The array can be read or written in parts.
93
// It can be created of any HDF5DataType.
94
// <li> HDF5Group opens, creates, or removes a group in an HDF5 object.
95
// </ul>
96
// Note that HDF5Object forms the base class of HDF5File, HDF5Group, and
97
// HDF5DataSet. Most interfaces use HDF5Object, thus are applicable to
98
// all these object types.
99
// <br>An HDF5Object has a conversion operator to <src>hid_t</src>, thus
100
// can be used directly in any HDF5 function.
101
//
102
// Because of HDF5 resource management the objects (e.g. HDF5File) cannot be
103
// copied. However, they can be used in shared pointers such as std::shared_ptr.
104
// <br>
105
// Internally the classes use HDF5HidMeta.h which does the resource management
106
// for HDF5 meta data like attributes, property lists, etc..
107
//
108
// <note>
109
// All HDF5 classes and all their functions are compiled, but it depends on
110
// the setting of HAVE_HDF5 how. If not set, all these functions are merely
111
// stubs and the class constructors throw an exception when used.
112
// The function <src>HDF5Object::hasHDF5Support()</src> tells if HDF5 is used.
113
// See the casacore build instructions at github.com/casacore/casacore
114
// for more information.
115
// </note>
116
// </synopsis>
117
118
// <example>
119
// See the various test programs.
120
// </example>
121
//
122
// <motivation>
123
// HDF5 offers a C++ interface. However, this interface is still quite complex
124
// and is too much C-oriented.
125
// Furthermore there was the need to support the casacore data types,
126
// in particular complex. The reversal of array axes was also needed.
127
// </motivation>
128
129
// <todo asof="2008/03/13">
130
// <li> Set the optimal data set chunk cache size from a given access pattern.
131
// The current problem is that setting the cache size requires that
132
// the file is closed first.
133
// For the time being a fixed cache size of 16 MB is used instead of
134
// the default 1 MB.
135
// </todo>
136
137
// </module>
138
139
}
// namespace casacore
140
141
#endif
casacore
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition
mainpage.dox:28
Generated by
1.15.0