Guess the dimension of a chunk

guess_chunks(space_maxdims, dtype_size,
  chunk_size = getOption("hdf5r.chunk_size"))

Arguments

space_maxdims

Maximal dimensions of the dataset

dtype_size

Size of the datatype that is stored

chunk_size

Size of each chunk in bytes

Value

An integer vector giving the dimension of the chunk

Details

The size of the chunk in bytes is first divided by the size of the datatype, giving the number of elements to be stored in each chunk. This is taken as a rough guideline. Then, the number of dimensions of the dataset is used. By default, the chunk is assumed to have the same size in each dimension, yielding an initial guess.

If the resulting chunk is larger than the entire dataset for a maximal dimension, this dimension of the chunk is reduced and redistributed to the other dimensions.

As a chunk is never allowed to be larger than the maximum dimension of the dataset itself,

Author

Holger Hoefling