to_file#

caput.mpiarray.MPIArray.to_file(f: str | h5py.File | h5py.Group | zarr.Group, dataset: str, create: bool = False, chunks: tuple[int, Ellipsis] | None = None, compression: str | int | None = None, compression_opts: tuple | None = None, file_format: caput.memdata.fileformats.FileFormat = fileformats.HDF5) None[source]#

Parallel write into a contiguous HDF5/Zarr dataset.

Parameters:
fstr | h5py.File | h5py.Group | zarr.Group

File to write dataset into.

datasetstr

Name of dataset to write into. Should not exist.

createbool

True if a new file should be created (if needed)

chunkstuple[int, …] | None, optional

Chunk shape

compressionstr | int | None, optional

Name or identifier of HDF5 compression filter.

compression_optstuple | None, optional

See HDF5 documentation for compression filters. Compression options for the dataset.

file_formatfileformats.FileFormat

Instance of FileFormat specifying the file format to use. Default HDF5.