Skip to content

Attempt to kerchunk classic netcdf file not working. #55

Answered by mpiannucci
noaaroland asked this question in Q&A
Discussion options

You must be logged in to vote

Ah right, i remember now. NetCDF3ToZarr uses fsspec internally, so you only have to pass the filename and storage options are optional. I got stuck on this when first using the netcdf3 function too, its definitely inconsistent. I just downloaded your file and was successful using this code:

from kerchunk.netCDF3 import NetCDF3ToZarr
import ujson

fname = './B10K-K20_CORECFS_1970-1974_average_Jel.nc'

# NetCDF3ToZarr uses fsspec internally, so only pass the file name and storage options
chunks = NetCDF3ToZarr(fname)
with open(f'{fname}.zarr', 'w') as f:
    f.write(ujson.dumps(chunks.translate()))

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mpiannucci
Comment options

Answer selected by noaaroland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants