def dump_raw_data(filename, data):
if data.ndim == <NUM_LIT:3>:<EOL><INDENT>data = data.reshape([data.shape[<NUM_LIT:0>], data.shape[<NUM_LIT:1>]*data.shape[<NUM_LIT:2>]])<EOL><DEDENT>a = array.array('<STR_LIT:f>')<EOL>for o in data:<EOL><INDENT>a.fromlist(list(o.flatten()))<EOL><DEDENT>with open(filename, '<STR_LIT:wb>') as rawf:<EOL><INDENT>a.tofile(rawf)<EOL><DEDENT>
Write the data into a raw format file. Big endian is always used.

    Parameters
    ----------
    filename: str
        Path to the output file

    data: numpy.ndarray
        n-dimensional image data array.