Open labarababa opened 5 years ago
@labarababa I see the point for reading a GRIB from a string or from an opened file, however it is not a trivial update and I don't see it as high priority. Anyway I'll keep the issue open as a feature request.
This is something that would be useful to me as well - the loading from memory part rather than the zip part. Currently we download GRIB2 files to memory with python, then write them out to disk solely in order to be able to open them with cfgrib. Perhaps this bug should be renamed as I'm not sure the gzip part is relevant. If you give me some pointers I will take a look at getting this implemented.
Note that this is really a limitation in either ecCodes or in the internal eccodes bindings. In the near feature I'll switch to use the new ecmwf/eccodes-python
package to bind to ecCodes and this feature request will belong there.
I'm also looking forward for this feature. In the best case scenario, cfgrib.read_datasets
would accept a file-like object. In addition to in-memory objects, this could enable stuff like reading files directly from S3 object storage using boto3
.
I think https://github.com/ecmwf/eccodes-python/issues/25 is the relevant issue in eccodes-python. https://confluence.ecmwf.int/display/UDOC/How+do+I+decode+messages+from+a+byte+stream+-+ecCodes+FAQ is maybe relevant.
Is it possible to read a Dataset from a Zipfile without writing to disc?
This works like a charm:
I want something like that:
But i am getting the following error:
Any ideas?
Kind Regards.