Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
画像に関する 12 の異なる情報配列を含む Fits ファイルがあります。行を使用して、見たい配列の最大値MAG_AUTOを見つけることができます。
a=pyfits.getdata(data1).MAG_AUTO
data1 は、fits ファイルからのデータ セットです。しかし、私は最大値が発生する配列内の位置の後です。どうすればこれを見つけることができますか?
私は答えを見つけました。次のコマンドは、特定のファイルのセットの最大値を生成します。
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