From 113dc921b7c3e73486b3c942ce2d086b67f09a7d Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Wed, 27 Jan 2021 14:39:48 +0000 Subject: [PATCH] Remove eccodes bug workaround added in #208. --- iris_grib/_save_rules.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/iris_grib/_save_rules.py b/iris_grib/_save_rules.py index cb331cf29..0f0e4df35 100644 --- a/iris_grib/_save_rules.py +++ b/iris_grib/_save_rules.py @@ -1490,12 +1490,6 @@ def data_section(cube, grib): gribapi.grib_set(grib, "bitmapPresent", 1) gribapi.grib_set_double(grib, "missingValue", fill_value) - # A segmentation fault is raised by `gribapi.grib_set_double_array` if it - # tries to cast large data to float64. As a temporary fix we cast the data - # upfront - # TODO: remove the `astype` command once eccodes (gribapi) has been fixed. - if data.dtype != np.float64: - data = data.astype(np.float64) gribapi.grib_set_double_array(grib, "values", data.flatten()) # todo: check packing accuracy?