caterva2.get_chunk#
- caterva2.get_chunk(path, nchunk, urlbase=None, auth_cookie=None)#
Get the unidimensional compressed chunk of a dataset.
- Parameters:
- Returns:
The compressed chunk.
- Return type:
bytes obj
Examples
>>> import caterva2 as cat2 >>> urlbase = 'https://demo.caterva2.net' >>> cat2.subscribe('example', urlbase) 'Ok' >>> info_schunk = cat2.get_info('example/ds-2d-fields.b2nd', urlbase)['schunk'] >>> info_schunk['nchunks'] 1 >>> info_schunk['cratio'] 6.453000645300064 >>> chunk = cat2.get_chunk('example/ds-2d-fields.b2nd', 0, urlbase) >>> info_schunk['chunksize'] / len(chunk) 6.453000645300064