blimpy/waterfall.py
def __write_to_fil_heavy(self, filename_out, *args, **kwargs):
        """ Write data to .fil file.

        Args:
            filename_out (str): Name of output file
        """

        #Note that a chunk is not a blob!!
        chunk_dim = self.__get_chunk_dimensions()
        blob_dim = self.__get_blob_dimensions(chunk_dim)
        n_blobs = self.container.calc_n_blobs(blob_dim)

        #Write header of .fil file
        n_bytes  = self.header[b'nbits'] / 8
        with open(filename_out, "wb") as fileh:
            fileh.write(generate_sigproc_header(self)) #generate_sigproc_header comes from sigproc.py

        logger.info('Using %i n_blobs to write the data.'% n_blobs)
        for ii in range(0, n_blobs):
            logger.info('Reading %i of %i' % (ii + 1, n_blobs))

            bob = self.container.read_blob(blob_dim,n_blob=ii)

            #Write data of .fil file.
            with open(filename_out, "a") as fileh:
                j = bob
                if n_bytes == 4:
                    np.float32(j.ravel()).tofile(fileh)
                elif n_bytes == 2:
                    np.int16(j.ravel()).tofile(fileh)
                elif n_bytes == 1:
                    np.int8(j.ravel()).tofile(fileh)
def __write_to_fil_heavy(self, filename_out, *args, **kwargs):
        """ Write data to .fil file.

        Args:
            filename_out (str): Name of output file
        """

        #Note that a chunk is not a blob!!
        chunk_dim = self.__get_chunk_dimensions()
        blob_dim = self.__get_blob_dimensions(chunk_dim)
        n_blobs = self.container.calc_n_blobs(blob_dim)

        #Write header of .fil file
        n_bytes  = self.header[b'nbits'] / 8
        with open(filename_out, "wb") as fileh:
            fileh.write(generate_sigproc_header(self)) #generate_sigproc_header comes from sigproc.py

        logger.info('Using %i n_blobs to write the data.'% n_blobs)
        for ii in range(0, n_blobs):
            logger.info('Reading %i of %i' % (ii + 1, n_blobs))

            bob = self.container.read_blob(blob_dim,n_blob=ii)

            #Write data of .fil file.
            with open(filename_out, "a") as fileh:
                j = bob
                if n_bytes == 4:
                    np.float32(j.ravel()).tofile(fileh)
                elif n_bytes == 2:
                    np.int16(j.ravel()).tofile(fileh)
                elif n_bytes == 1:
                    np.int8(j.ravel()).tofile(fileh)
Write data to .fil file.

        Args:
            filename_out (str): Name of output file