def writefilegnomon(gnomonx, gnomony, outputfilename, dataselected):
    """
    write file with gnomonic coordinates
    """
    linestowrite = []
    linestowrite.append(['gnomonx gnomony 2theta chi I #spot'])
    longueur = len(gnomonx)
    for i in list(range(longueur)):
        linestowrite.append([str(gnomonx[i]), str(gnomony[i]), str(2.0 *
            dataselected[0][i]), str(dataselected[1][i]), str(dataselected[
            2][i]), str(i)])
    naname = outputfilename + '.gno'
    outputfile = open(naname, 'w')
    for line in linestowrite:
        lineData = '\t'.join(line)
        outputfile.write(lineData)
        outputfile.write('\n')
    outputfile.close()
