ecmwf / cfgrib

A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes
Apache License 2.0
407 stars 77 forks source link

Keep float64 when converting to xarray #308

Open dmey opened 2 years ago

dmey commented 2 years ago

Currently, irrespective of the original data precision, a cast to float32 is made when converting to xarray.(see https://github.com/ecmwf/cfgrib/blob/master/cfgrib/dataset.py#L332) This can however downgrade the type of grib fields stored at 64-bits. Can you please allow to specify this at conversion or to automatically match the type specified in grib fields?

Marston commented 10 months ago

@dmey Was this issue ever addressed? Did you find a work-around?