TNO Intern

Commit 46c9e3af authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixes for colocated output.

parent e1549873
Loading
Loading
Loading
Loading
+85 −69

File changed.

Preview size limit exceeded, changes collapsed.

+12
Changes for src/cso/cso_file.py: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@
#   - added GetValue method
#   Removed usage of undefined filename in error messages.
#
# 2025-04, Arjo Segers
#   Enable zlib compression only for numerical data.
#

########################################################################
###
@@ -606,9 +609,18 @@ class CSO_File(object):
        if complevel > 0:
            # loop over variables:
            for vname in self.ds.keys():
                # only numerical values:
                if self.ds[vname].dtype in [
                    numpy.int16,
                    numpy.int32,
                    numpy.int64,
                    numpy.float32,
                    numpy.float64,
                ]:
                    # enable zlib compression and set level:
                    self.ds[vname].encoding["zlib"] = True
                    self.ds[vname].encoding["complevel"] = complevel
                # endif
            # endfor # variables
        # endif # comppress