def find_header_size(filename):
    """Script to find the header size of a filterbank file

    Args:
        filename (str): Name of file

    Returns size of header in Bytes (int)
    """

    # open datafile
    filfile=open(filename,'rb')
    # go to the start of the file
    filfile.seek(0)
    #read some region larger than the header.
    round1 = filfile.read(1000)
    headersize = round1.find(b'HEADER_END')+len(b'HEADER_END')

    return headersize