Zfp(
mode,
_version="0.2.0",
max_bits=None,
max_prec=None,
min_bits=None,
min_exp=None,
non_finite="deny",
precision=None,
rate=None,
tolerance=None,
)
Codec providing compression using ZFP
| Parameters: |
-
mode
(...)
–
-
"expert": The most general mode, which can describe all four other modes
-
"fixed-rate": In fixed-rate mode, each d-dimensional compressed block of \(4^d\)
values is stored using a fixed number of bits. This number of
compressed bits per block is amortized over the \(4^d\) values to give
a rate of \(rate = \frac{maxbits}{4^d}\) in bits per value.
-
"fixed-precision": In fixed-precision mode, the number of bits used to encode a block may
vary, but the number of bit planes (the precision) encoded for the
transform coefficients is fixed.
-
"fixed-accuracy": In fixed-accuracy mode, all transform coefficient bit planes up to a
minimum bit plane number are encoded. The smallest absolute bit plane
number is chosen such that
\(minexp = \text{floor}(\log_{2}(tolerance))\).
-
"reversible": Lossless per-block compression that preserves integer and floating point
bit patterns.
-
_version
(..., default:
= "0.2.0"
)
–
The codec's encoding format version. Do not provide this parameter explicitly.
-
max_bits
(..., default:
None
)
–
Maximum number of bits used to represent a block
-
max_prec
(..., default:
None
)
–
Maximum number of bit planes encoded
-
min_bits
(..., default:
None
)
–
Minimum number of compressed bits used to represent a block
-
min_exp
(..., default:
None
)
–
Smallest absolute bit plane number encoded.
This parameter applies to floating-point data only and is ignored
for integer data.
-
non_finite
(..., default:
= "deny"
)
–
ZFP non-finite values mode
-
precision
(..., default:
None
)
–
Number of bit planes encoded
-
rate
(..., default:
None
)
–
-
tolerance
(..., default:
None
)
–
|
Methods:
codec_id
class-attribute
instance-attribute
decode
Decode the data in buf.
| Parameters: |
-
buf
(Buffer)
–
Encoded data. May be any object supporting the new-style buffer
protocol.
-
out
(Buffer, default:
None
)
–
Writeable buffer to store decoded data. N.B. if provided, this buffer must
be exactly the right size to store the decoded data.
|
| Returns: |
-
dec( Buffer
) –
Decoded data. May be any object supporting the new-style
buffer protocol.
|
encode
Encode the data in buf.
| Parameters: |
-
buf
(Buffer)
–
Data to be encoded. May be any object supporting the new-style
buffer protocol.
|
| Returns: |
-
enc( Buffer
) –
Encoded data. May be any object supporting the new-style buffer
protocol.
|
from_config
classmethod
Instantiate the codec from a configuration dict.
| Parameters: |
-
config
(dict)
–
Configuration of the codec.
|
get_config
Returns the configuration of the codec.
numcodecs.registry.get_codec(config)
can be used to reconstruct this codec from the returned config.
| Returns: |
-
config( dict
) –
Configuration of the codec.
|