You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/filters.md
+41-24Lines changed: 41 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,9 @@ The most common kind of filter is a compression-decompression
33
33
filter, and that is the focus of this document.
34
34
But non-compression filters – fletcher32, for example – also exist.
35
35
36
+
This document describes the support for HDF5 filters and also
37
+
the newly added support for NCZarr filters.
38
+
36
39
The netCDF enhanced (aka netCDF-4) library inherits this
37
40
capability since it depends on the HDF5 library. The HDF5
38
41
library (1.8.11 and later) supports filters, and netCDF is based
@@ -45,30 +48,22 @@ multiple filters are defined on a variable, they are applied in
45
48
first-defined order on writing and on the reverse order when
46
49
reading.
47
50
48
-
This document describes the support for HDF5 filters and also
49
-
the newly added support for NCZarr filters.
50
-
51
-
## A Warning on Backward Compatibility {#filters_compatibility}
52
-
53
-
The API defined in this document should accurately reflect the
54
-
current state of filters in the netCDF-c library. Be aware that
55
-
there was a short period in which the filter code was undergoing
56
-
some revision and extension. Those extensions have largely been
57
-
reverted. Unfortunately, some users may experience some
58
-
compilation problems for previously working code because of
59
-
these reversions. In that case, please revise your code to
60
-
adhere to this document. Apologies are extended for any
61
-
inconvenience.
62
-
63
-
A user may encounter an incompatibility if any of the following appears in user code.
64
-
65
-
* The function *\_nc\_inq\_var\_filter* was returning the error value NC\_ENOFILTER if a variable had no associated filters.
66
-
It has been reverted to the previous case where it returns NC\_NOERR and the returned filter id was set to zero if the variable had no filters.
67
-
* The function *nc\_inq\_var\_filterids* was renamed to *nc\_inq\_var\_filter\_ids*.
68
-
* Some auxilliary functions for parsing textual filter specifications have been moved to the file *netcdf\_aux.h*. See [Appendix A](#filters_appendixa).
69
-
* All of the "filterx" functions have been removed. This is unlikely to cause problems because they had limited visibility.
70
-
71
-
For additional information, see [Appendix B](#filters_appendixb).
51
+
There is an important "caveat" with respect to filters
52
+
and their application to variables.
53
+
If the type of the variable is variable-sized, then attempts
54
+
to define a filter on such a variable will not be allowed.
55
+
In this case, the call to *nc\_def\_var\_filter* will succeed
56
+
but the filter will be suppressed and a warning will be logged.
57
+
Similarly, if an existing file is opened, and there is a
58
+
variable-sized variable with a filter, then that variable will be
59
+
suppressed and will be inaccessible through the netcdf-c API.
60
+
61
+
The concept of a variable-sized type is defined as follows:
62
+
1. The type NC_STRING is variable-sized.
63
+
2. Any user defined type of the class NC_VLEN is variable sized.
64
+
3. If a compound type has any field that is (transitively) variable-sized,
65
+
then that compound type is variable-sized.
66
+
4. All other types are fixed-size.
72
67
73
68
## Enabling A HDF5 Compression Filter {#filters_enable}
74
69
@@ -1150,6 +1145,28 @@ The important thing to note is that at run-time, there are several cases to cons
1150
1145
3. HDF5_PLUGIN_DIR is not defined at either run-time or build-time -- no action needed
1151
1146
4. HDF5_PLUGIN_DIR is not defined at run-time but was defined at build-time -- this will probably fail
1152
1147
1148
+
## Appendix I. A Warning on Backward Compatibility {#filters_appendixi}
1149
+
1150
+
The API defined in this document should accurately reflect the
1151
+
current state of filters in the netCDF-c library. Be aware that
1152
+
there was a short period in which the filter code was undergoing
1153
+
some revision and extension. Those extensions have largely been
1154
+
reverted. Unfortunately, some users may experience some
1155
+
compilation problems for previously working code because of
1156
+
these reversions. In that case, please revise your code to
1157
+
adhere to this document. Apologies are extended for any
1158
+
inconvenience.
1159
+
1160
+
A user may encounter an incompatibility if any of the following appears in user code.
1161
+
1162
+
* The function *\_nc\_inq\_var\_filter* was returning the error value NC\_ENOFILTER if a variable had no associated filters.
1163
+
It has been reverted to the previous case where it returns NC\_NOERR and the returned filter id was set to zero if the variable had no filters.
1164
+
* The function *nc\_inq\_var\_filterids* was renamed to *nc\_inq\_var\_filter\_ids*.
1165
+
* Some auxilliary functions for parsing textual filter specifications have been moved to the file *netcdf\_aux.h*. See [Appendix A](#filters_appendixa).
1166
+
* All of the "filterx" functions have been removed. This is unlikely to cause problems because they had limited visibility.
1167
+
1168
+
For additional information, see [Appendix B](#filters_appendixb).
0 commit comments