LibASICamera API

LibASICamera.allocate_bufferMethod
allocate_buffer(width::Integer, height::Integer, img_type::ASI_IMG_TYPE)

Allocates an image buffer for the camera to write to.

Args:

width: Image width
height: Image height
img_type: One of
    -ASI_IMG_RAW8
    -ASI_IMG_Y8
    -ASI_IMG_RAW16
    -ASI_IMG_RAW24

Returns:

A zero-initialized array of the appropriate shape.

Throws:

ASIWrapperError if an unsupported image type is given.
source
LibASICamera.capture_stillMethod
capture_still(id::Integer)

Captures a still image. You have to set gain, exposure etc. beforehand using setcontrolvalue(...).

Returns:

An array containing the image.

Throws:

ASIWrapperError if the image format is not supported by the wrapper, or
ASIError in other unfortunate cases
source
LibASICamera.get_camera_modeMethod
get_camera_mode(id::Integer)

Get the current camera mode, only needed to call when the IsTriggerCam in the CameraInfo is true.

source
LibASICamera.get_camera_propertyMethod
get_camera_property(id::Integer)

Fetches the camera properties for a given ID.

Args:

id: Camera id

Returns:

ASI_CAMERA_INFO object

Throws:

ASIError in case of failure
source
LibASICamera.get_control_capsMethod
get_control_caps(id::Integer)

Returns the control properties available for this camera.

The camera needs to be open.

Args:

id: Camera id

Returns:

Vector of ASI_CONTROL_CAPS structs.

Throws:

ASIError
source
LibASICamera.get_control_valueMethod
get_control_value(id::Integer, control_type::ASI_CONTROL_TYPE)

Fetches the current setting of the control value, e.g. exposure or gain.

Args:

id: Camera id
control_type: The control type to fetch, e.g. exposure or gain.

Returns:

A tuple (value, is_auto)

Throws:

ASIError
source
LibASICamera.get_dropped_framesMethod
get_dropped_frames(id::Integer)

Returns the number of dropped frames.

Frames are dropped when the USB is bandwidth is low or the harddisk write speed is slow. The count is reset to 0 after capturing stops.

source
LibASICamera.get_gain_offsetMethod
get_gain_offset(id::Integer)

Get the presets for offset and gain values at different "sweet spots".

Args:

id: Camera id

Returns:

A dictionary containing:
    1. The offset at highest dynamic range
    2. The offset at unity gain
    3. The gain with lowest readout noise
    4. The offset with lowest readout noise

Throws:

ASIError
source
LibASICamera.get_idMethod
get_id(id::Integer)

Returns the camera id stored in flash, only available for USB3 cameras.

source
LibASICamera.get_supported_modesMethod
get_supported_modes(id::Integer)

Returns the supported camera modes, only need to call when the IsTriggerCam in the CameraInfo is true.

Throws:

ASIError
source
LibASICamera.get_video_data!Function
get_video_data!(id::Integer, buffer, timeout_ms)

Writes a video frame to the given buffer. Make sure the buffer is large enough to fit the frame. Call this as fast as possible in a loop and check whether the return value equals ASI_SUCCESS.

Args:

id: Camera id
buffer: A buffer to write the video frame to.
timeout_ms: Time to wait for a frame. Recommendation: 2 * exposure_μs + 500 ms <- inconsistent units?!

Returns:

An ASI_ERROR_CODE, which should be ASI_SUCCESS.
source
LibASICamera.init_cameraMethod
init_camera(id::Integer)

Initialize the camera. Needs to be called before capturing any data.

Args:

id: Camera id

Throws:

ASIError
source
LibASICamera.open_cameraMethod
open_camera(id::Integer)

Opens the ASI camera connection.

Open the camera before any interaction with the camera, this will not affect the camera which is capturing. Then you must call init_camera() to perform any actions.

Args:

id: Camera ID

Throws:

ASIError
source
LibASICamera.pulse_guide_offMethod
pulse_guide_off(id::Integer, direction::ASI_GUIDE_DIRECTION)

Deactivates the pulse guide in the given direction.

Args:

id: Camera id
direction: Guiding direction; call 'instances(ASI_GUIDE_DIRECTION)' for options.

Throws:

ASIError
source
LibASICamera.pulse_guide_onMethod
pulse_guide_on(id::Integer, direction::ASI_GUIDE_DIRECTION)

Activates the pulse guide in the given direction.

Args:

id: Camera id
direction: Guiding direction; call 'instances(ASI_GUIDE_DIRECTION)'

Throws:

ASIError
source
LibASICamera.send_soft_triggerMethod
send_soft_trigger(id::Integer, start::ASI_BOOL)

From original docs: Send a softTrigger. For edge trigger, it only need to set true which means send a rising trigger to start exposure. For level trigger, it need to set true first means start exposure, and set false means stop exposure. Only needed to call when the IsTriggerCam in the CameraInfo is true.

source
LibASICamera.set_camera_modeMethod
set_camera_mode(id::Integer, mode::ASI_CAMERA_MODE)

Set the camera mode, only needed to call when the IsTriggerCam in the CameraInfo is true.

source
LibASICamera.set_control_valueFunction
set_control_value(id::Integer, control_type::ASI_CONTROL_TYPE, value, auto::Bool=false)

Sets a control (e.g. exposure) to the given value. Automatically sets the minimum or maximum if the given value is out of bounds.

Args:

id: Camera id
control_type: The control type to set, e.g. exposure or gain.
value: The value to which the control is set.
auto: Whether or not the control should be automatically set.
    Check if this is supported for the given control beforehand.

Throws:

ASIError
source
LibASICamera.set_roi_formatMethod
set_roi_format(id::Integer, width, height, binning, img_type::ASI_IMG_TYPE)

Sets the region of interest (roi). Do so before capturing.

The width and height are the values after binning, i.e. you need to set the width to 640 and the height to 480 if you want to run at 640x480 @ BIN2.

ASI120's data size must be a multiple of 1024 which means width*height%1024==0.

Args:

id: Camera id
width: ROI width
height: ROI height
binning: The binning mode; 2 means to read out 2x2 pixels together. Check
    which binning values are supported in the ASI_CAMERA_INFO struct of the
    camera struct or by calling get_camera_property(id).

Throws:

ASIError
source
LibASICamera.set_roi_startMethod
set_roi_start(id::Integer, startx, starty)

Sets the position of the top-left corner of the region of interest.

You can call this while the camera is streaming to move the ROI. By default, the ROI will be centered. In binned mode, the start values are relative to the binned sensor size.

Throws:

ASIError
source
LibASICamera.set_trigger_output_configMethod
set_trigger_output_config(id::Integer, pin::ASI_TRIG_OUTPUT_PIN, high::ASI_BOOL, delay, duration)

Configure the output pin (A or B) of Trigger port. If duration <= 0, this output pin will be closed. Only need to call when the IsTriggerCam in the CameraInfo is true.

Args:

id: Camera id
pin: Select the pin for output
high: If true, the selected pin will output a high level as a signal
				when it is effective.
delay: The delay between the camera receiving a trigger signal and the
        output of the valid level. From 0 μs - 2,000,000,000 μs.
duration: The duration of the valid level output. Same range as delay.
source
LibASICamera.start_exposureFunction
start_exposure(id::Integer, is_dark=false)

Starts an exposure. All relevant parameters (exposure time, gain) have to be set beforehand by calling setcontrolvalue(...) or e.g. set_gain(...).

source