用于控制ASCOM CCD相机的Python脚本?

时间:2017-09-11 19:21:05

标签: python ascom

我想使用ASCOM驱动程序在Python中控制CCD天文相机,但还没有找到一个示例脚本来说明它是如何完成的。

我想看看如何完成相机的基本控制 - 设置曝光长度,开始曝光,下载图像数据。

有人可以发布我可以用作起点的示例Python脚本吗?

1 个答案:

答案 0 :(得分:1)

import win32com.client
from astropy.io import fits

# if you don't know what your driver is called, use the ASCOM Chooser
#x = win32com.client.Dispatch("ASCOM.Utilities.Chooser")
#x.DeviceType = 'Camera'
#driver = x.Choose(None)

# otherwise, just use it
driver = "ASCOM.AtikCameras.Camera"

camera = win32com.client.Dispatch(driver)
camera.connected = True
camera.CoolerOn = True

openshutter = True # False will take a dark frame
exptime = 1
camera.StartExposure(exptime,openshutter)
image = camera.ImageArray

hdu = fits.PrimaryHDU(image)
hdu.writeto('test.fits')

# see more camera methods/properties here:
# https://ascom-standards.org/Help/Developer/html/T_ASCOM_DriverAccess_Camera.htm