import struct


def get_fileheader(f):
    """ 
    Get fileheader from file and return a list

    Reads the 180 byte file header of a sparky file

    """
    # file header as descriped in ucsffile.cc of sparky source
    # header is packed as follows: 
    # ident(10s),naxis(c),ncomponents(c),encoding(c),version(c)
    # owner(9s),date(26s),comment(80s),pad(3x),seek_pos(l),scratch(40s),
    # pad(4x)

    # note that between comment and seek_pos is a 3 byte pad
    # so that the long is @ a multiple of 4
    # also sparky always packs big-endian, hence > 

    return struct.unpack('>10s 4c 9s 26s 80s 3x l 40s 4x',f.read(180) )