Interface to ZWO ASI range of USB cameras.
Calls to the zwoasi module may raise
ValueError exceptions if an input argument
is incorrect. Failure conditions from within the module may raise exceptions of type
ZWO_Error. Errors from
conditions specifically from the SDK C library are indicated by errors of type
Camera.capture() errors are signalled by
Representation of ZWO ASI camera.
The constructor for a camera object requires the camera ID number or model. The camera destructor automatically closes the camera.
capture(initial_sleep=0.01, poll=0.01, buffer_=None, filename=None)¶
Capture a still image. Type
capture_video_frame(buffer_=None, filename=None, timeout=None)¶
Capture a single frame from video. Type
Video mode must have been started previously otherwise a
ZWO_Errorwill be raised. A new buffer will be used to store the image unless one has been supplied with the buffer keyword argument. If filename is not
Nonethe image is saved using
capture_video_frame()will wait indefinitely unless a timeout has been given. The SDK suggests that the timeout value, in milliseconds, should be twice the exposure plus 500 ms.
Close the camera in the ASI library.
The destructor will automatically close the camera if it has not already been closed.
Retrieves the pixel binning. Type
A pixel binning of one means no binning is active, a value of 2 indicates two pixels horizontally and two pixels vertically are binned.
Retrieves the region of interest (ROI).
(start_x, start_y, width, height).
Retrieve a single video frame. Type
Low-level function to retrieve data. See
capture_video_frame()for a more convenient method to acquire an image (and optionally save it).
set_roi(start_x=None, start_y=None, width=None, height=None, bins=None, image_type=None)¶
Set the region of interest (ROI).
binsis not given then the current pixel binning value will be used. The ROI coordinates are considered after binning has been taken into account, ie if
bins=2then the maximum possible height is reduced by a factor of two.
height=Nonethen the maximum respective value will be used. The ASI SDK library requires that width is a multiple of 8 and height is a multiple of 2; a ValueError will be raised if this is not the case.
start_x=Nonethen the ROI will be horizontally centred. If
start_y=Nonethen the ROI will be vertically centred.
Leave video capture mode.
Exception class for when
Exception class for all errors returned from the ASI SDK library.