<jupyter_start><jupyter_text>Quick start<jupyter_code>import xbitinfo as xb

import xarray as xr

xr.set_options(display_style="text")
ds = xr.tutorial.load_dataset("eraint_uvz")

# xb.plot_distribution(ds)
ds<jupyter_output><empty_output><jupyter_text>Get information content per bitusing {py:func}`xbitinfo.xbitinfo.get_bitinformation`<jupyter_code>info_per_bit = xb.get_bitinformation(ds, dim="longitude")

info_per_bit<jupyter_output><empty_output><jupyter_text>Visualize information contentusing {py:func}`xbitinfo.graphics.plot_bitinformation`<jupyter_code>fig = xb.plot_bitinformation(info_per_bit)<jupyter_output><empty_output><jupyter_text>Get keepbitsusing {py:func}`xbitinfo.xbitinfo.get_keepbits`<jupyter_code>keepbits = xb.get_keepbits(info_per_bit, 0.99)
keepbits<jupyter_output><empty_output><jupyter_text>Apply bitroundingusing {py:func}`xbitinfo.bitround.xr_bitround` or {py:func}`xbitinfo.bitround.jl_bitround` (does not work for chunked data)<jupyter_code>ds_bitrounded = xb.xr_bitround(ds, keepbits)<jupyter_output><empty_output><jupyter_text>Save compressedusing {py:class}`xbitinfo.save_compressed.ToCompressed_Netcdf` or  {py:class}`xbitinfo.save_compressed.ToCompressed_Zarr`  NetCDF<jupyter_code>ds_bitrounded.to_compressed_netcdf("bitrounded_compressed.nc")
ds.to_compressed_netcdf("compressed.nc")
ds.to_netcdf("original.nc")
!du -hs *.nc
!rm *.nc<jupyter_output><empty_output><jupyter_text>Zarr<jupyter_code>ds_bitrounded.to_compressed_zarr("bitrounded_compressed.zarr", mode="w")
ds.to_compressed_zarr("compressed.zarr", mode="w")
ds.to_zarr("original.zarr", mode="w");
!du -hs *.zarr
!rm -r *.zarr<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12854556427278213, 'fraction_numerical': 0.0018105009052504525, 'mean_word_length': 12.816666666666666, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '598473', 'license': 'MIT', 'n_tokens_mistral': 680, 'n_tokens_neox': 668, 'n_words': 66, 'path': 'docs/quick-start.ipynb', 'repo_name': 'observingClouds/bitinformation_pipeline', 'size': '1657'}