How to use the eccodes.codes_release function in eccodes

To help you get started, we’ve selected a few eccodes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jdkloe / pybufr-ecmwf / pybufr_ecmwf / bufr.py View on Github external
def close(self):
        #  #[
        """
        close the file object
        """
        if self._bufr != -1:
            eccodes.codes_release(self._bufr)

        self.fd.close()
        #  #]
github pytroll / satpy / satpy / readers / seviri_l2_bufr.py View on Github external
if bufr is None:
                    break

                ec.codes_set(bufr, 'unpack', 1)

                # if is the first message initialise our final array
                if (msgCount == 0):
                    arr = da.from_array(ec.codes_get_array(
                        bufr, key, float), chunks=CHUNK_SIZE)
                else:
                    tmpArr = da.from_array(ec.codes_get_array(
                        bufr, key, float), chunks=CHUNK_SIZE)
                    arr = da.concatenate((arr, tmpArr))

                msgCount = msgCount+1
                ec.codes_release(bufr)

        if arr.size == 1:
            arr = arr[0]

        return arr