def getpeaks_fromfit2d(filename):
    """
    read peaks list created by fit2d peak search

    #TODO: to remove function to read old data format, not used any longer
    """
    frou = open(filename, 'r')
    alllines = frou.readlines()
    frou.close()
    peaklist = alllines[1:]
    print(' %d peaks in %s' % (len(peaklist), filename))
    outputfilename = filename[:-6] + '.pik'
    fric = open(outputfilename, 'w')
    for line in peaklist:
        fric.write(line)
    fric.close()
    print('X,Y, int list in %s' % outputfilename)
    return len(peaklist)
