blimpy/waterfall.py
def __write_to_hdf5_light(self, filename_out, *args, **kwargs):
        """ Write data to HDF5 file in one go.

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

        block_size = 0

        with h5py.File(filename_out, 'w') as h5:

            h5.attrs[b'CLASS']   = b'FILTERBANK'
            h5.attrs[b'VERSION'] = b'1.0'

            if HAS_BITSHUFFLE:
                bs_compression = bitshuffle.h5.H5FILTER
                bs_compression_opts = (block_size, bitshuffle.h5.H5_COMPRESS_LZ4)
            else:
                bs_compression = None
                bs_compression_opts = None
                logger.warning("Warning: bitshuffle not found. No compression applied.")


            dset = h5.create_dataset('data',
                        data=self.data,
#                          compression='lzf')
                        compression=bs_compression,
                        compression_opts=bs_compression_opts)

            dset_mask = h5.create_dataset('mask',
                        shape=self.file_shape,
#                                 compression='lzf',
                        compression=bs_compression,
                        compression_opts=bs_compression_opts,
                        dtype='uint8')

            dset.dims[0].label = b"frequency"
            dset.dims[1].label = b"feed_id"
            dset.dims[2].label = b"time"

            dset_mask.dims[0].label = b"frequency"
            dset_mask.dims[1].label = b"feed_id"
            dset_mask.dims[2].label = b"time"

            # Copy over header information as attributes
            for key, value in self.header.items():
                dset.attrs[key] = value
def __write_to_hdf5_light(self, filename_out, *args, **kwargs):
        block_size = 0

        with h5py.File(filename_out, 'w') as h5:

            h5.attrs[b'CLASS']   = b'FILTERBANK'
            h5.attrs[b'VERSION'] = b'1.0'

            if HAS_BITSHUFFLE:
                bs_compression = bitshuffle.h5.H5FILTER
                bs_compression_opts = (block_size, bitshuffle.h5.H5_COMPRESS_LZ4)
            else:
                bs_compression = None
                bs_compression_opts = None
                logger.warning("Warning: bitshuffle not found. No compression applied.")


            dset = h5.create_dataset('data',
                        data=self.data,
#                          compression='lzf')
                        compression=bs_compression,
                        compression_opts=bs_compression_opts)

            dset_mask = h5.create_dataset('mask',
                        shape=self.file_shape,
#                                 compression='lzf',
                        compression=bs_compression,
                        compression_opts=bs_compression_opts,
                        dtype='uint8')

            dset.dims[0].label = b"frequency"
            dset.dims[1].label = b"feed_id"
            dset.dims[2].label = b"time"

            dset_mask.dims[0].label = b"frequency"
            dset_mask.dims[1].label = b"feed_id"
            dset_mask.dims[2].label = b"time"

            # Copy over header information as attributes
            for key, value in self.header.items():
                dset.attrs[key] = value
def __write_to_hdf5_light ( self , filename_out , * args , * * kwargs ) : block_size = 0 with h5py . File ( filename_out , 'w' ) as h5 : h5 . attrs [ b'CLASS' ] = b'FILTERBANK' h5 . attrs [ b'VERSION' ] = b'1.0' if HAS_BITSHUFFLE : bs_compression = bitshuffle . h5 . H5FILTER bs_compression_opts = ( block_size , bitshuffle . h5 . H5_COMPRESS_LZ4 ) else : bs_compression = None bs_compression_opts = None logger . warning ( "Warning: bitshuffle not found. No compression applied." ) dset = h5 . create_dataset ( 'data' , data = self . data , #                          compression='lzf') compression = bs_compression , compression_opts = bs_compression_opts ) dset_mask = h5 . create_dataset ( 'mask' , shape = self . file_shape , #                                 compression='lzf', compression = bs_compression , compression_opts = bs_compression_opts , dtype = 'uint8' ) dset . dims [ 0 ] . label = b"frequency" dset . dims [ 1 ] . label = b"feed_id" dset . dims [ 2 ] . label = b"time" dset_mask . dims [ 0 ] . label = b"frequency" dset_mask . dims [ 1 ] . label = b"feed_id" dset_mask . dims [ 2 ] . label = b"time" # Copy over header information as attributes for key , value in self . header . items ( ) : dset . attrs [ key ] = value
Write data to HDF5 file in one go.

        Args:
            filename_out (str): Name of output file
Write data to HDF5 file in one go .