pyUSID.io.anc_build_utils.calc_chunks

pyUSID.io.anc_build_utils.calc_chunks(dimensions, dtype_byte_size, unit_chunks=None, max_chunk_mem=10240)[source]

Calculate the chunk size for the HDF5 dataset based on the dimensions and the maximum chunk size in memory

Parameters:
  • dimensions (array_like of int) – Shape of the data to be chunked

  • dtype_byte_size (unsigned int) – Size of an entry in the data in bytes

  • unit_chunks (array_like of int, optional) – Unit size of the chunking in each dimension. Must be the same size as the shape of ds_main. Default None, unit_chunks is set to 1 in all dimensions

  • max_chunk_mem (int, optional) – Maximum size of the chunk in memory in bytes. Default 10240b or 10kb per h5py recommendations

Returns:

chunking – Calculated maximum size of a chunk in each dimension that is as close to the requested max_chunk_mem as posible while having steps based on the input unit_chunks.

Return type:

tuple of int