I figured out the answer, the following command produces the maximum for a set a given files,
for arg in sys.argv[1:]:
a=pyfits.getdata(arg).MAG_AUTO
arr=numpy.array(a)
indices = heapq.nlargest(10,xrange(len(arr)),key=arr.__getitem__)
print indices