xbitinfo.xbitinfo.get_bitinformation
xbitinfo.xbitinfo.get_bitinformation#
- xbitinfo.xbitinfo.get_bitinformation(ds, dim=None, axis=None, label=None, overwrite=False, **kwargs)[source]#
Wrap BitInformation.jl.bitinformation().
- Parameters
ds (
xarray.Dataset
) – Input dataset to analysedim (str) – Dimension over which to apply mean. Only one of the
dim
andaxis
arguments can be supplied. If nodim
oraxis
is given (default), the bitinformation is retrieved along all dimensions.axis (int) – Axis over which to apply mean. Only one of the
dim
andaxis
arguments can be supplied. If nodim
oraxis
is given (default), the bitinformation is retrieved along all dimensions.label (str) – Label of the json to serialize bitinfo. When string, serialize results to disk into file
{{label}}.json
to be reused later. Defaults toNone
.overwrite (bool) – If
False
, try using serialized bitinfo based on label; if true or label does not exist, run bitinformationkwargs –
to be passed to bitinformation:
masked_value: defaults to
NaN
(different tobitinformation.jl
defaulting to"nothing"
), setNone
disable maskingmask: use
masked_value
insteadset_zero_insignificant (
bool
): defaults toTrue
confidence (
float
): defaults to0.99
- Returns
info_per_bit (
xarray.Dataset
) – Information content perbit
andvariable
(anddim
)
Example
>>> ds = xr.tutorial.load_dataset("air_temperature") >>> xb.get_bitinformation(ds, dim="lon") <xarray.Dataset> Dimensions: (bit32: 32) Coordinates: * bit32 (bit32) <U3 '±' 'e1' 'e2' 'e3' 'e4' ... 'm20' 'm21' 'm22' 'm23' dim <U3 'lon' Data variables: air (bit32) float64 0.0 0.0 0.0 0.0 ... 0.0 3.953e-05 0.0006889 Attributes: xbitinfo_description: bitinformation calculated by xbitinfo.get_bit... python_repository: https://github.com/observingClouds/xbitinfo julia_repository: https://github.com/milankl/BitInformation.jl reference_paper: http://www.nature.com/articles/s43588-021-001... xbitinfo_version: ... BitInformation.jl_version: ... >>> xb.get_bitinformation(ds) <xarray.Dataset> Dimensions: (bit32: 32, dim: 3) Coordinates: * bit32 (bit32) <U3 '±' 'e1' 'e2' 'e3' 'e4' ... 'm20' 'm21' 'm22' 'm23' * dim (dim) <U4 'lat' 'lon' 'time' Data variables: air (dim, bit32) float64 0.0 0.0 0.0 0.0 ... 0.0 6.327e-06 0.0004285 Attributes: xbitinfo_description: bitinformation calculated by xbitinfo.get_bit... python_repository: https://github.com/observingClouds/xbitinfo julia_repository: https://github.com/milankl/BitInformation.jl reference_paper: http://www.nature.com/articles/s43588-021-001... xbitinfo_version: ... BitInformation.jl_version: ...