Repository navigation
Replies: 5 comments 2 replies
|
BTW, this is built on top of kerchunk and may be useful too: |
|
I added a updated version of the above argopy/argopy/stores/kerchunker.py Line 41 in 0f01c3c >>> ncfile = "s3://argo-gdac-sandbox/pub/dac/coriolis/6903090/6903090_prof.nc"
>>> ak = ArgoKerchunker(store='memory') # default
>>> ak = ArgoKerchunker(store='local', root='.')
>>> ak = ArgoKerchunker(store='local', root='/kerchunk_data_folder') # Custom local storage folder
>>> ak = ArgoKerchunker(store=fsspec.filesystem('dir', path='s3://.../kerchunk_data_folder/', target_protocol='s3'))
>>> ak.supported(ncfile)
>>> ak.translate(ncfile) # takes 1 or a list of uris, requires the kerchunk library
>>> ak.to_kerchunk(ncfile) # Take 1 netcdf file uri, return kerchunk json data (translate or load from store)
>>> ak.pprint(ncfile)
>>> ak.open_dataset(ncfile) # Return xarray dataset of the netcdf file using zarr engine from kerchunk data |
|
The So I adopted an upstream positioning whereby to open a dataset lazily, users would necessarily do it through one of the argopy stores The remaining downstream use case, is when translating files without the need to up; in the scenario of producing/sharing references for less experience users. |
|
In fact, the performance overhead of translating a remote netcdf file to a zarr reference is not worth it for mono/multi profile files that are only a few MB. On the other hand, this could come in handy with larger netcdf files from the |
|
Implemented and release in v1.1.0 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
One more time I came across kerchunk during ADMT25 but I finally understood what it is about !
Thanks @DocOtak !
So I gave it a try and produced the following
ArgoKerchunkerclass, that could be used like this:I still need to figure how to properly integrate this into argopy and if it is worth it, compared to working on more Analysis-ready and cloud-optimized (ARCO) format.
For instance, the resulting dataset has variables not casted properly.
While argopy already provides the
argoengine to open properly (ie cast all variables correctly) a netcdf file, I wonder how to implement casting lazily with zarr.Don't hesitate to shoot your opinion below !
Argo kerchunk helper class
Details
All reactions