Process the data of an individual chunk on a regular grid. This class will read the chunk from the store and decode it (as necessary), then merge the new data with it, encode the updated chunk and write back to the store.
new()Create a new instance of this class.
chunk_grid_regular_IO$new(key, chunk_shape, dtype, store, codecs)keyThe key of the chunk in the store.
chunk_shapeInteger vector with the shape of the chunk.
dtypeThe zarr_data_type of the array.
storeThe zarr_store instance that is the store of this array.
codecsList of zarr_codec instances to use. The list will be copied such that this chunk reader/writer can be run asynchronously.
read()Read some data from the chunk.
chunk_grid_regular_IO$read(offset, length)offset, lengthThe integer offsets and length that determine where from the chunk to read the data.
The requested data, as an R object with dimensions set when it is a matrix or array.
write()Write some data to the chunk.
chunk_grid_regular_IO$write(data, offset, flush = FALSE)dataThe data to write to the chunk.
offsetThe integer offsets that determine where in the chunk to
write the data. Ignored if argument data has a full chunk of data.
flushIf TRUE, the chunk will be written to file iimediately
after writing the new data to it. If FALSE, data will be written to
the chunk but not persisted to the store - this is more efficient when
writing multiple slabs of data to a chunk.
Self, invisibly.
flush()If the chunk has changed applied to it, persist the chunk to the store.
chunk_grid_regular_IO$flush()Self, invisibly.