API reference
Arrays
Zarr.zcreate
— Functionzcreate(T, dims...;kwargs)
Creates a new empty zarr array with element type T
and array dimensions dims
. The following keyword arguments are accepted:
path=""
directory name to store a persistent array. If left empty, an in-memory array will be createdname=""
name of the zarr array, defaults to the directory namestoragetype
determines the storage to use, current options areDirectoryStore
orDictStore
chunks=dims
size of the individual array chunks, must be a tuple of lengthlength(dims)
fill_value=nothing
value to represent missing valuesfill_as_missing=false
set totrue
shall fillvalue s be converted tomissing
sfilters
=filters to be appliedcompressor=BloscCompressor()
compressor type and propertiesattrs=Dict()
a dict containing key-value pairs with metadata attributes associated to the arraywriteable=true
determines if the array is opened in read-only or write mode
Create a new subarray of the group g
Zarr.zzeros
— Functionzzeros(T, dims...; kwargs... )
Creates a zarr array and initializes all values with zero. Accepts the same keyword arguments as zcreate
Group hierarchy
Zarr.zcreate
— MethodCreate a new subarray of the group g
Zarr.zgroup
— Functionzgroup(s::AbstractStore; attrs=Dict())
Create a new zgroup in the store s
Zarr.zgroup
— MethodCreate a subgroup of the group g
Zarr.zopen
— Functionzopen(s::AbstractStore, mode="r"; consolidated = false, path = "", lru = 0)
Opens a zarr Array or Group at Store s
. If consolidated
is set to "true", Zarr will search for a consolidated metadata field as created by the python zarr consolidate_metadata
function. This can substantially speed up metadata parsing of large zarr groups. Setting lru
to a value > 0 means that chunks that have been accessed before will be cached and consecutive reads will happen from the cache. Here, lru
denotes the number of chunks that remain in memory.
Zarr.zopen
— Functionzopen(p::String, mode="r")
Open a zarr Array or group at disc path p.
Zarr.zopen_noerr
— Functionzopen_noerr(AbstractStore, mode = "r"; consolidated = false)
Works like zopen
with the single difference that no error is thrown when the path or store does not point to a valid zarr array or group, but nothing is returned instead.
Compressors
Zarr.BloscCompressor
— MethodBloscCompressor(;blocksize=0, clevel=5, cname="lz4", shuffle=1)
Returns a BloscCompressor
struct that can serve as a Zarr array compressor. Keyword arguments are:
clevel=5
the compression level, number between 0 (no compression) and 9 (max compression)cname="lz4"
compressor name, can be one of"blosclz"
,"lz4"
, and"lz4hc"
shuffle=1
Either NOSHUFFLE (0), SHUFFLE (1), BITSHUFFLE (2) or AUTOSHUFFLE (-1). If AUTOSHUFFLE, bit-shuffle will be used for buffers with itemsize 1, and byte-shuffle will be used otherwise. The default is SHUFFLE.
Zarr.NoCompressor
— TypeNoCompressor()
Creates an object that can be passed to ZArray constructors without compression.
Zarr.ZlibCompressor
— TypeZlibCompressor(clevel=-1)
Returns a ZlibCompressor
struct that can serve as a Zarr array compressor. Keyword arguments are:
clevel=-1
the compression level, number between -1 (Default), 0 (no compression) and 9 (max compression)- default is -1 compromise between speed and compression (currently equivalent to level 6).