def read_n_spec_pts(fn):
    """Read number of spectral points from WF / BAMF output"""
    with open(fn, 'r') as fd:
        while True:
            ln = fd.readline()
            tmp = ln.split('The number of spectral points:')
            if len(tmp) > 1:
                return int(tmp[-1])
    raise ValueError('Number of spectral points not found in {}'.format(fn))
