cog3pio icon indicating copy to clipboard operation
cog3pio copied to clipboard

Using cog3pio to determine byte ranges in COG files?

Open TomNicholas opened this issue 2 months ago • 2 comments

Basically same question as https://github.com/gauteh/hidefix/issues/38#issue-2236324824 but for this library 😁

I'm building VirtualiZarr, an evolution of kerchunk, that allows you to determine byte ranges of chunks in netCDF files, but then concatenate the virtual representation of those chunks using xarray's API.

This works by creating a ChunkManifest object in-memory (one per netCDF Variable per file initially), then defining ways to merge those manifests.

What I'm wondering is if cog3pio's code could be useful to me as a way to generate the ChunkManifest for a netCDF file without using kerchunk/fsspec (see this issue). In other words I use cog3pio only to determine the byte ranges, not for actually reading the data. (I plan to actually read the bytes later as if it were zarr using the rust object-store crate, see https://github.com/zarr-developers/zarr-python/pull/1661).

Q's:

  • Is this idea dumb?
  • Does cog3pio expose the byte range information currently?
  • Can cog3pio read over S3?

cc @norlandrhagen

TomNicholas avatar Apr 10 '24 20:04 TomNicholas