split the result in three kinds, add a X, Y, mag average result file.
the three kinds is:
stars have one records.
stars have two records.
stars more then three records.