def load_bin(shape, file_in, dtype, bintype=None): nrow, ncol = shape if bintype is not None: if dtype not in [np.int]: header_dtype = BinaryHeader.set_dtype(bintype=bintype) header_data = np.fromfile(file_in, dtype=header_dtype, count=1) else: header_data = None data = np.fromfile(file_in, dtype=dtype, count=nrow * ncol) data.resize(nrow, ncol) return [header_data, data]