pyds9 を使用して、フィット画像を自動的に読み込みます (天文学関連の目的で)。
スケール、色、ズームレベルなど、他のすべての設定を構成できます。画像ごとに、特定の場所にその領域を強調する小さな円を描きたいと思います。デフォルトでは、この色は緑です。この色を変更するにはどうすればよいですか?
また、この円の太さを変更する方法はありますか? 視認性に問題があります。緑色は、すべての cmap とスケールの組み合わせではっきりと見えるわけではありません。赤などのものがよいでしょう。
XPAset コマンドを確認しました。それを行う方法があります。しかし、pyds9でそれを行う方法がわかりません。すべての XPAset コマンドのリンクは次のとおりです: http://ds9.si.edu/ref/xpa.html#regions
xpaset コマンドは次のとおりです。
*$xpaset -p ds9 regions command '{circle 100 100 20 # color=red}'*
この xpaset コマンドを pyds9 のメソッドに変換するにはどうすればよいですd.set()
か??
私は次のようなことを意味します:d.set('regions','fk5; circle(100,100,20") # color=red')
以下は私が使用しているコードです:
import ds9
# x is the RA and y is the DEC
# for describing the location of astronomical objects
x = 200.1324
y = 20.3441
# the four FITS images to be loaded
image_list = ['img1.fits.gz','img2.fits.gz','img3.fits.gz','img4.fits.gz']
#initializing a ds9 window
d = ds9.ds9(target='DS9:*', start=True, verify=True)
for i in range(len(image_list)):
d.set('frame ' + str(i+1))
d.set('file ' + image_list[i])
d.set('cmap bb')
d.set('cmap invert')
d.set('scale zscale')
d.set('scale linear')
d.set('regions','fk5; circle('+str(x)+','+str(y)+',20")')
# This previous line draws a green circle with center at (x,y)
# and radius of 20 arc-sec. But the color is by default green.
# I want to change this to lets say red. How do I do it ???
# arranging the 4 images in tile format
d.set('tile')
for i in range(len(image_list)):
d.set('frame ' + str(i+1))
d.set('zoom to fit')
d.set('saveimage png myimagename.png')
# time to remove all the images from the frames
# so that the some new set of images could be loaded
for i in range(len(image_list)):
d.set('frame delete')