def get_header(fname):
    """
    helper function to extract header in spec file.
    .. warning :: This function works fine for spec file format
    from Canadian light source. Others may need to be tested.

    Parameters
    ----------
    fname : spec file name
    """
    mydata = []
    with open(fname, 'r') as f:
        for v in f:
            mydata.append(v)
            _sign = '#'
            _sign = _sign.encode('utf-8')
            if _sign not in v:
                break
    header_line = mydata[-2]
    n = [v.strip() for v in header_line[1:].split('\t') if v.strip() != '']
    return n
