def write_block(self, block):
        fi = open(self.filename, 'wb')
        self._write_header(block, fi)

        # Write each segment in order
        for seg in block.segments:
            # Create a 2d numpy array of analogsignals converted to bytes
            all_signals = np.array([
                np.rint(sig * 2**16 / self.full_range)
                for sig in seg.analogsignals],
                dtype=np.int)

            # Write to file. We transpose because channel changes faster
            # than time in this format.
            for vals in all_signals.transpose():
                fi.write(struct.pack('<%dh' % len(vals), *vals))

        fi.close()
Writes block to `self.filename`.
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/io/blackrockio_deprecated.py/BlackrockIO.write_block