Compressing variable length data when writing a dataset to netcdf can cause a "Filter Error".
To avoid this, I modified the encoding in infterpymc_postprocessouts to not apply zlib to data variables whose data type is variable length.
These data types are: "Object" and "Unicode". These are numpy datatypes with codes "O" and "U". I used a regex to parse the datatype string for each data variables, since these strings can start with a symbol to specify the byte-order.
This elimiates the FilterError from the inversion run on Iss18, and the netCDF output seems to be about 1/3 the size of the output if encoding = None (i.e. no additional compression from zlib=True) is used.
Compressing variable length data when writing a dataset to netcdf can cause a "Filter Error".
To avoid this, I modified the encoding in
infterpymc_postprocessouts
to not applyzlib
to data variables whose data type is variable length.These data types are: "Object" and "Unicode". These are numpy datatypes with codes "O" and "U". I used a regex to parse the datatype string for each data variables, since these strings can start with a symbol to specify the byte-order.
This elimiates the FilterError from the inversion run on Iss18, and the netCDF output seems to be about 1/3 the size of the output if
encoding = None
(i.e. no additional compression fromzlib=True
) is used.This closes Issue #18.