-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for small files in _split_file
#448
Comments
I could maybe be Out of interest, what possible information is there in such a small GRIB? |
@martindurant: Ha! You would be surprised how much is in my tiny GRIB message. 😄 The actual file size is less than 200 bytes, which originally made me thing that my download had failed and the file was incomplete. However, it turns out it is a completely valid GRIB file. It's a testament to the fact that GRIB is not really a fully self-describing data format. You need other libraries (like I will put together a PR to make the changes I offered above for review. |
I just created #451 to address this. |
@martindurant: Thanks for your help and feedback on #446, #448, #450, and #451! |
Thanks for your efforts :) |
I've noticed that the
kerchunk.grib2._split_file()
function does not work if the file being scanned is smaller than 1024 bytes. Theif len(head) < 1024: break # eof
line/block is the culprit:kerchunk/kerchunk/grib2.py
Lines 49 to 64 in a0c4f3b
Is it safe to remove this early
break
so that files smaller than 1024 bytes can be dealt with? Essentially, the finalwhile
block would look like:It is unclear to me if this would cause problems with other GRIB files than the datasets I've handled myself.
The text was updated successfully, but these errors were encountered: