panoptes.pocs.camera package

Subpackages

Submodules

panoptes.pocs.camera.camera module

class panoptes.pocs.camera.camera.AbstractCamera(name='Generic Camera', model='simulator', port=None, primary=False, *args, **kwargs)[source]

Bases: PanBase

Base class for all cameras.

filter_type

Type of filter attached to camera. If a filterwheel is present this will return the filterwheel.current_filter property, otherwise it will return the value of the filter_type keyword argument, or if that argument was not given it it will query the camera driver, e.g. ‘M’ for unfiltered monochrome camera, ‘RGGB’ for Bayer matrix colour camera.

Type:

str

focuser

Focuser for the camera, default None.

Type:

`panoptes.pocs.focuser.AbstractFocuser`|None

filter_wheel

Filter wheel for the camera, default None.

Type:

`panoptes.pocs.filterwheel.AbstractFilterWheel`|None

uid

Unique identifier of the camera.

Type:

str

is_primary

If this camera is the primary camera for the system, default False.

Type:

bool

model

The model of camera, such as ‘gphoto2’, ‘sbig’, etc. Default ‘simulator’.

Type:

str

name

Name of the camera, default ‘Generic Camera’.

Type:

str

port

The port the camera is connected to, typically a usb device, default None.

Type:

str

temperature

Current temperature of the image sensor.

Type:

astropy.units.Quantity

target_temperature

image sensor cooling target temperature.

Type:

astropy.units.Quantity

temperature_tolerance

tolerance for image sensor temperature.

Type:

astropy.units.Quantity

cooling_enabled

True if image sensor cooling is active.

Type:

bool

cooling_power

Current image sensor cooling power level in percent.

Type:

astropy.unit.Quantity

egain

Image sensor gain in e-/ADU as reported by the camera.

Type:

astropy.units.Quantity

gain

The gain setting of the camera (ZWO cameras only).

Type:

int

bitdepth

ADC bit depth in bits.

Type:

astropy.units.Quantity

image_type

Image format of the camera, e.g. ‘RAW16’, ‘RGB24’ (ZWO cameras only).

Type:

str

timeout

max time to wait after exposure before TimeoutError.

Type:

astropy.units.Quantity

readout_time

approximate time to readout the camera after an exposure.

Type:

float

file_extension

file extension used by the camera’s image data, e.g. ‘fits’

Type:

str

library_path

path to camera library, e.g. ‘/usr/local/lib/libfli.so’ (SBIG, FLI, ZWO)

Type:

str

properties

A collection of camera properties as read from the camera.

Type:

dict

is_connected

True if camera is connected.

Type:

bool

is_cooled_camera

True if camera has image sensor cooling capability.

Type:

bool

is_temperature_stable

True if image sensor temperature is stable.

Type:

bool

is_exposing

True if an exposure is currently under way, otherwise False.

Type:

bool

is_ready

True if the camera is ready to take an exposure.

Type:

bool

can_take_internal_darks

True if the camera can take internal dark exposures.

Type:

bool

Notes

The port parameter is not used by SBIG or ZWO cameras, and is deprecated for FLI cameras. For these cameras serial_number should be passed to the constructor instead. For SBIG and FLI this should simply be the serial number engraved on the camera case, whereas for ZWO cameras this should be the 8 character ID string previously saved to the camera firmware. This can be done using ASICAP, or panoptes.pocs.camera.libasi.ASIDriver.set_ID().

autofocus(seconds=None, focus_range=None, focus_step=None, cutout_size=None, keep_files=None, take_dark=None, merit_function='vollath_F4', merit_function_kwargs=None, mask_dilations=None, coarse=False, make_plots=None, blocking=False, *args, **kwargs)[source]

Focuses the camera using the specified merit function. Optionally performs a coarse focus to find the approximate position of infinity focus, which should be followed by a fine focus before observing.

Parameters:
  • seconds (scalar, optional) – Exposure time for focus exposures, if not specified will use value from config.

  • focus_range (2-tuple, optional) – Coarse & fine focus sweep range, in encoder units. Specify to override values from config.

  • focus_step (2-tuple, optional) – Coarse & fine focus sweep steps, in encoder units. Specify to override values from config.

  • cutout_size (int, optional) – Size of square central region of image to use, default 500 x 500 pixels.

  • keep_files (bool, optional) – If True will keep all images taken during focusing. If False (default) will delete all except the first and last images from each focus run.

  • take_dark (bool, optional) – If True will attempt to take a dark frame before the focus run, and use it for dark subtraction and hot pixel masking, default True.

  • merit_function (str/callable, optional) – Merit function to use as a focus metric, default vollath_F4.

  • merit_function_kwargs (dict or None, optional) – Dictionary of additional keyword arguments for the merit function.

  • mask_dilations (int, optional) – Number of iterations of dilation to perform on the saturated pixel mask (determine size of masked regions), default 10

  • coarse (bool, optional) – Whether to perform a coarse focus, otherwise will perform a fine focus. Default False.

  • (bool (make_plots) – Whether to write focus plots to images folder, default behaviour is to check the focuser autofocus_make_plots attribute.

  • optional – Whether to write focus plots to images folder, default behaviour is to check the focuser autofocus_make_plots attribute.

  • blocking (bool, optional) – Whether to block until autofocus complete, default False.

Returns:

Event that will be set when autofocusing is complete

Return type:

threading.Event

Raises:

ValueError – If invalid values are passed for any of the focus parameters.

property bit_depth

ADC bit depth.

property can_take_internal_darks

True if the camera can take internal dark exposures. This will be true of cameras that have an internal mechanical shutter and can be commanded to keep that shutter closed during the exposure. For cameras that either lack a mechanical shutter or lack the option to keep it closed light must be kept out of the camera during dark exposures by other means, e.g. an opaque blank in a filterwheel, a lens cap, etc.

abstract connect()[source]
property cooling_enabled

Get current status of the camera’s image sensor cooling system (enabled/disabled).

Note: this only needs to be implemented for cameras which have cooled image sensors, not for those that don’t (e.g. DSLRs).

property cooling_power

Get current power level of the camera’s image sensor cooling system (typically as a percentage of the maximum).

Note: this only needs to be implemented for cameras which have cooled image sensors, not for those that don’t (e.g. DSLRs).

property egain

Image sensor gain in e-/ADU as reported by the camera.

property exposure_error

Error message from the most recent exposure or None, if there was no error.

property file_extension

File extension for images saved by camera

property filter_type

Image sensor filter type (e.g. ‘RGGB’) or name of the current filter (e.g. ‘g2_3’)

get_cutout(seconds, file_path, cutout_size, keep_file=False, *args, **kwargs)[source]

Takes an image and returns a thumbnail cutout.

Takes an image, grabs the data, deletes the FITS file and returns a cutout from the centre of the image.

Parameters:
  • seconds (astropy.units.Quantity) – exposure time, Quantity or numeric type in seconds.

  • file_path (str) – path to (temporarily) save the image file to.

  • cutout_size (int) – size of the square region of the centre of the image to return.

  • keep_file (bool, optional) – if True the image file will be deleted, if False it will be kept.

  • *args – passed to the take_exposure method

  • **kwargs

    passed to the take_exposure method

property has_filterwheel

Return True if the camera has a filterwheel, False if not.

property has_focuser

Return True if the camera has a focuser, False if not.

property is_connected

Is the camera available vai gphoto2

property is_cooled_camera

True if camera has image sensor cooling capability

property is_exposing

True if an exposure is currently under way, otherwise False.

property is_observing

True if an observation is currently under, otherwise False.

property is_ready

True if camera is ready to start another exposure, otherwise False.

property is_temperature_stable

True if image sensor temperature is stable, False if not.

See also: See temperature_tolerance for more information about the temperature stability. An uncooled camera, or cooled camera with cooling disabled, will always return False.

process_exposure(metadata, **kwargs)[source]

Processes the exposure.

Performs the following steps:

  1. First checks to make sure that the file exists on the file system.

  2. Calls _process_fits with the filename and info, which is specific to each camera.

  3. Makes pretty images if requested.

  4. Records observation metadata if requested.

  5. Compress FITS files if requested.

  6. Sets the observation_event.

If the camera is a primary camera, extract the jpeg image and save metadata to database current collection. Saves metadata to observations collection for all images.

Parameters:

metadata (dict) – Header metadata saved for the image.

Raises:

FileNotFoundError – If the FITS file isn’t at the specified location.

property readiness

Dictionary detailing the readiness of the camera system to take an exposure.

property readout_time

Readout time for the camera in seconds

take_exposure(seconds=<Quantity 1. s>, filename=None, metadata=None, dark=False, blocking=False, timeout=<Quantity 10. s>, *args, **kwargs) Thread[source]

Take an exposure for given number of seconds and saves to provided filename.

Parameters:
  • seconds (u.second, optional) – Length of exposure.

  • filename (str, optional) – Image is saved to this filename.

  • metadata (dict, optional) – Add key/value as FITS header. Does not support nested dicts.

  • dark (bool, optional) – Exposure is a dark frame, default False. On cameras that support taking dark frames internally (by not opening a mechanical shutter) this will be done, for other cameras the light must be blocked by some other means. In either case setting dark to True will cause the IMAGETYP FITS header keyword to have value ‘Dark Frame’ instead of ‘Light Frame’. Set dark to None to disable the IMAGETYP keyword entirely.

  • blocking (bool, optional) – If False (default) returns immediately after starting the exposure, if True will block until it completes and file exists.

  • timeout (astropy.Quantity) – The timeout to use for the exposure, default 10 seconds. The timeout gets added to the seconds and the self.readout_time to get the total timeout for the exposure. If the exposure takes longer than this then a panoptes.utils.error.Timeout exception will be raised.

Returns:

The readout thread, which joins when readout has finished.

Return type:

threading.Thread

Raises:
  • error.PanError – If camera is not connected.

  • error.Timeout – If the exposure takes longer than total timeout to complete.

take_observation(observation, headers=None, filename=None, blocking=False, **kwargs) dict[source]

Take an observation

Gathers various header information, sets the file path, and calls

take_exposure. Also creates a threading.Event object and a threading.Thread object. The Thread calls process_exposure after the exposure had completed and the Event is set once process_exposure finishes.

Parameters:
  • observation (Observation) – Object describing the observation

  • headers (dict or Header, optional) – Header data to be saved along with the file.

  • filename (str, optional) – pass a filename for the output FITS file to override the default file naming system.

  • blocking (bool) – If method should wait for observation event to be complete before returning, default False.

  • **kwargs (dict) – Optional keyword arguments (exptime, dark)

Returns:

The metadata from the event.

Return type:

dict

property target_temperature

Get current value of the target temperature for the camera’s image sensor cooling control.

Note: this only needs to be implemented for cameras which have cooled image sensors, not for those that don’t (e.g. DSLRs).

property temperature

Get current temperature of the camera’s image sensor.

Note: this only needs to be implemented for cameras which can provided this information, e.g. those with cooled image sensors.

property temperature_tolerance

Get current value of the image sensor temperature tolerance.

If the image sensor temperature differs from the target temperature by more than the temperature tolerance then the temperature is not considered stable (by is_temperature_stable) and, for cooled cameras, is_ready will report False.

property uid

Return unique identifier for camera.

property waiting_for_readout

True if the most recent readout has not finished. Should be set in write_fits

write_fits(data, header, filename)[source]

Write the FITS file.

This is a thin-wrapper around the fits_utils.write_fits method that marks the readout as complete.

panoptes.pocs.camera.fli module

class panoptes.pocs.camera.fli.Camera(name='FLI Camera', target_temperature=<Quantity 25. deg_C>, *args, **kwargs)[source]

Bases: AbstractSDKCamera

connect()[source]

Connect to FLI camera.

Gets a ‘handle’, serial number and specs/capabilities from the driver

property cooling_enabled

Current status of the camera’s image sensor cooling system (enabled/disabled).

Note: For FLI cameras this is always True, and cannot be set.

property cooling_power

Current power level of the camera’s image sensor cooling system (as a percentage of the maximum).

property is_exposing

True if an exposure is currently under way, otherwise False

property target_temperature

Current value of the target temperature for the camera’s image sensor cooling control.

Can be set by assigning an astropy.units.Quantity.

property temperature

Current temperature of the camera’s image sensor.

panoptes.pocs.camera.libasi module

class panoptes.pocs.camera.libasi.ASIDriver(library_path=None, **kwargs)[source]

Bases: AbstractSDKDriver

close_camera(camera_ID)[source]

Close camera with given integer ID

disable_dark_subtract(camera_ID)[source]

Disable dark subtraction.

May need to call this as dark current subtraction settings persist in the registry on Windows.

enable_dark_subtract(camera_ID, dark_file_path)[source]

Enable dark subtraction (not implemented).

You almost certainly wouldn’t want to use this as it only works with images taken in RGB8 format and only with dark frames saved as .BMP files. Far better to do dark subtraction in post-processing.

get_ID(camera_ID)[source]

Get string ID from firmaware for the camera with given integer ID

The saved ID is an array of 8 unsigned chars for some reason.

get_SDK_version()[source]

Get the version of the ZWO ASI SDK

get_camera_mode(camera_ID)[source]

Get current trigger mode for camera with given integer ID.

get_camera_property(camera_index)[source]

Get properties of the camera with given index

get_camera_property_by_id(camera_ID)[source]

Get properties of the camera with a given integer ID.

get_camera_supported_mode(camera_ID)[source]

Get supported trigger modes for camera with given integer ID.

get_control_caps(camera_ID)[source]

Gets the details of all the controls supported by the camera with given integer ID

get_control_value(camera_ID, control_type)[source]

Gets the value of the control control_type from camera with given integer ID

get_devices()[source]

Gets currently connected camera info.

Returns:

All currently connected camera serial numbers with corresponding integer

camera IDs.

Return type:

dict

Notes

If a camera does not have a serial number it will attempt to fall back to string ID. Cameras with neither serial number nor string ID will be left out of the dictionary as they have no unique indentifier.

get_dropped_frames(camera_ID)[source]

Get the number of dropped frames during video capture.

get_exposure_data(camera_ID, width, height, image_type)[source]

Get image data from exposure on camera with given integer ID

get_exposure_status(camera_ID)[source]

Get status of current exposure on camera with given integer ID

get_gain_offset(camera_ID)[source]

Get pre-setting parameters.

get_num_of_connected_cameras()[source]

Get the count of connected ASI cameras

get_num_of_controls(camera_ID)[source]

Gets the number of control types supported by the camera with given integer ID

get_product_ids()[source]

Get product IDs of cameras supported by the SDK.

get_roi_format(camera_ID)[source]

Get the ROI size and image format setting for camera with given integer ID

get_serial_number(camera_ID)[source]

Get serial number of the camera with given integer ID.

The serial number is an array of 8 unsigned chars, the same as string ID, but it is interpreted differently. It is displayed in ASICAP as a 16 digit hexadecimal number, so we will convert it the same 16 character string representation.

get_start_position(camera_ID)[source]

Get position of the upper left corner of the ROI for camera with given integer ID

Parameters:

camera_ID (int) – integer ID of the camera

Returns:

x, y coordinates of the upper left

corner of the ROI. Note, these are in binned pixels.

Return type:

(astropy.units.Quantity, astropy.units.Quantity)

get_trigger_output_io_conf(camera_ID)[source]

Get external trigger configuration of the camera with given integer ID.

get_video_data(camera_ID, width, height, image_type, timeout)[source]

Get the image data from the next available video frame

init_camera(camera_ID)[source]

Initialise camera with given integer ID

open_camera(camera_ID)[source]

Open camera with given integer ID

pulse_guide_off(camera_ID, direction)[source]

Turn off PulseGuide on ST4 port of given camera in given direction.

pulse_guide_on(camera_ID, direction)[source]

Turn on PulseGuide on ST4 port of given camera in given direction.

send_soft_trigger(camera_ID, start_stop_signal)[source]

Send out a soft trigger on camera with given integer ID.

set_ID(camera_ID, string_ID)[source]

Save string ID to firmware of camera with given integer ID

The saved ID is an array of 8 unsigned chars for some reason. To preserve some sanity this method takes an 8 byte UTF-8 string as input.

set_camera_mode(camera_ID, mode_name)[source]

Set trigger mode for camera with given integer ID.

set_control_value(camera_ID, control_type, value)[source]

Sets the value of the control control_type on camera with given integet ID

set_roi_format(camera_ID, width, height, binning, image_type)[source]

Set the ROI size and image format settings for the camera with given integer ID

set_start_position(camera_ID, start_x, start_y)[source]

Set position of the upper left corner of the ROI for camera with given integer ID

set_trigger_ouput_io_conf(camera_ID, pin, pin_high, delay, duration)[source]

Set external trigger configuration of the camera with given integer ID.

start_exposure(camera_ID)[source]

Start exposure on the camera with given integer ID

start_video_capture(camera_ID)[source]

Start video capture mode on camera with given integer ID

stop_exposure(camera_ID)[source]

Cancel current exposure on camera with given integer ID

stop_video_capture(camera_ID)[source]

Stop video capture mode on camera with given integer ID

class panoptes.pocs.camera.libasi.BayerPattern(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Bayer filter type

BG = 1
GB = 3
GR = 2
RG = 0
class panoptes.pocs.camera.libasi.CameraInfo[source]

Bases: Structure

Camera info structure

bayer_pattern

Structure/Union member

bit_depth

Structure/Union member

camera_ID

Structure/Union member

e_per_adu

Structure/Union member

has_ST4_port

Structure/Union member

has_cooler

Structure/Union member

has_mechanical_shutter

Structure/Union member

is_USB3_camera

Structure/Union member

is_USB3_host

Structure/Union member

is_color_camera

Structure/Union member

is_trigger_camera

Structure/Union member

max_height

Structure/Union member

max_width

Structure/Union member

name

Structure/Union member

pixel_size

Structure/Union member

supported_bins

Structure/Union member

supported_video_format

Structure/Union member

unused

Structure/Union member

class panoptes.pocs.camera.libasi.CameraMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Camera status

END = -1
NORMAL = 0
TRIG_FALL_EDGE = 3
TRIG_HIGH_LEVEL = 5
TRIG_LOW_LEVEL = 6
TRIG_RISE_EDGE = 2
TRIG_SOFT_EDGE = 1
TRIG_SOFT_LEVEL = 4
class panoptes.pocs.camera.libasi.ControlCaps[source]

Bases: Structure

Structure for caps (limits) on allowable parameter values for each camera control

control_type

Structure/Union member

default_value

Structure/Union member

description

Structure/Union member

is_auto_supported

Structure/Union member

is_writable

Structure/Union member

max_value

Structure/Union member

min_value

Structure/Union member

name

Structure/Union member

unused

Structure/Union member

class panoptes.pocs.camera.libasi.ControlType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Control types

ANTI_DEW_HEATER = 21
AUTO_MAX_BRIGHTNESS = 12
AUTO_MAX_EXP = 11
AUTO_MAX_GAIN = 10
AUTO_TARGET_BRIGHTNESS = 12
BANDWIDTHOVERLOAD = 6
BRIGHTNESS = 5
COOLER_ON = 17
COOLER_POWER_PERC = 15
EXPOSURE = 1
FAN_ON = 19
FLIP = 9
GAIN = 0
GAMMA = 2
HARDWARE_BIN = 13
HIGH_SPEED_MODE = 14
MONO_BIN = 18
OFFSET = 5
OVERCLOCK = 7
PATTERN_ADJUST = 20
TARGET_TEMP = 16
TEMPERATURE = 8
WB_B = 4
WB_R = 3
class panoptes.pocs.camera.libasi.ErrorCode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Error codes

BUFFER_TOO_SMALL = 13
CAMERA_CLOSED = 4
CAMERA_REMOVED = 5
END = 18
EXPOSURE_IN_PROGRESS = 15
GENERAL_ERROR = 16
INVALID_CONTROL_TYPE = 3
INVALID_FILEFORMAT = 7
INVALID_ID = 2
INVALID_IMGTYPE = 9
INVALID_INDEX = 1
INVALID_MODE = 17
INVALID_PATH = 6
INVALID_SEQUENCE = 12
INVALID_SIZE = 8
OUTOF_BOUNDARY = 10
SUCCESS = 0
TIMEOUT = 11
VIDEO_MODE_ACTIVE = 14
class panoptes.pocs.camera.libasi.ExposureStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Exposure status codes

FAILED = 3
IDLE = 0
SUCCESS = 2
WORKING = 1
class panoptes.pocs.camera.libasi.FlipStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Flip status

BOTH = 3
HORIZ = 1
NONE = 0
VERT = 2
class panoptes.pocs.camera.libasi.GuideDirection(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Guider direction

EAST = 2
NORTH = 0
SOUTH = 1
WEST = 3
class panoptes.pocs.camera.libasi.ID[source]

Bases: Structure

id

Structure/Union member

class panoptes.pocs.camera.libasi.ImgType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Supported video format

END = -1
RAW16 = 2
RAW8 = 0
RGB24 = 1
Y8 = 3
class panoptes.pocs.camera.libasi.SupportedMode[source]

Bases: Structure

Array of supported CameraModes, terminated with CameraMode.END

modes

Structure/Union member

class panoptes.pocs.camera.libasi.TrigOutput(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

External trigger output.

NONE = -1
PINA = 0
PINB = 1

panoptes.pocs.camera.libfli module

Low level interface to the FLI library

Reproduces in Python (using ctypes) the C interface provided by FLI’s library.

class panoptes.pocs.camera.libfli.FLIDriver(library_path=None, **kwargs)[source]

Bases: AbstractSDKDriver

FLIClose(handle)[source]

Close a handle to an FLI device.

Parameters:

handle (ctypes.c_long) – handle to close

FLIExposeFrame(handle)[source]

Expose a frame for a given camera.

This function exposes a frame according the settings (image area, exposure time, binning, etc.) of the camera. The settings must have been previously set to valid values using the appropriate FLISet* methods. This function is non-blocking and returns once the exposure has stated.

Parameters:

handle (ctypes.c_long) – handle of the camera to start the exposure on.

FLIGetArrayArea(handle)[source]

Get the array area of the give camera.

This function finds the total area of the CCD array for a given camera. This area is specified in terms of an upper left point and a lower right point.

Parameters:

handle (ctypes.c_long) – handle of the camera to get the array area of.

FLIGetCoolerPower(handle)[source]

Get the cooler power level for a given camera.

Parameters:

handle (ctypes.c_long) – handle of the camera to get the cooler power of.

Returns:

cooler power, in percent.

Return type:

float

FLIGetExposureStatus(handle)[source]

Get the remaining exposure time of a given camera.

Parameters:

handle (ctypes.c_long) – handle of the camera to get the remaining exposure time of.

Returns:

remaining exposure time

Return type:

astropy.units.Quantity

FLIGetFWRevision(handle)[source]

Get firmware revision of a given device

Parameters:

handle (ctypes.c_long) – handle of the camera device to get the firmware revision of.

Returns:

firmware revision of the camera

Return type:

int

FLIGetHWRevision(handle)[source]

Get hardware revision of a given device

Parameters:

handle (ctypes.c_long) – handle of the camera device to get the hardware revision of.

Returns:

hardware revision of the cameras

Return type:

int

FLIGetModel(handle)[source]

Get the model of a given device.

Parameters:

handle (ctypes.c_long) – handle of the device to get the model of.

Returns:

model of the device

Return type:

string

FLIGetPixelSize(handle)[source]

Get the dimensions of a pixel in the array of a given device.

Parameters:

handle (ctypes.c_long) – handle of the device to find the pixel size of.

Returns:

(x, y) dimensions of a pixel.

Return type:

astropy.units.Quantity

FLIGetSerialString(handle)[source]

Get the serial string of a given camera.

Parameters:

handle (ctypes.c_long) – handle of the camera device to get the serial strong of.

Returns:

serial string of the camera

Return type:

string

FLIGetTemperature(handle)[source]

Get the temperature of a given camera.

Parameters:

handle (ctypes.c_long) – handle of the camera device to get the temperature of.

Returns:

temperature of the camera cold finger in degrees Celsius

Return type:

astropy.units.Quantity

FLIGetVisibleArea(handle)[source]

Get the visible array area of the give camera.

This function finds the visible area of the CCD array for a given camera. This area is specified in terms of an upper left point and a lower right point.

Parameters:

handle (ctypes.c_long) – handle of the camera to get the array area of.

FLIGrabFrame(handle, width, height)[source]

Grabs an image frame from a given camera.

This function grabs the entire image frame from the specified camera and returns it as a numpy array. The width and height of the image must be specified. The width and height should be consistent with the call to FLISetImageArea() that preceded the call to FLIExposeFrame(). This function should not be called until the exposure is complete, which can be confirmed with FLIGetExposureStatus().

Parameters:
  • handle (ctypes.c_long) – handle of the camera to grab a frame from.

  • width (int) – width of the image frame in pixels

  • height (int) – height of the image frame in pixels

Returns:

image from the camera

Return type:

numpy.ndarray

FLIGrabRow(handle, width)[source]

Grabs a row of image data from a given camera.

This function grabs the next available row of imae data from the specificed camera and returns it as a nupt array. The widht of the row must be specified. The width should be consistent with the call to FLISetImageArea() that preceded the call to FLIExposeFrame(). This function should not be called until the exposure is complete, which can be confirmed with FLIGetExposureStatus.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to grab a row from.

  • width (int) – width of the image row in pixelStart

Returns:

row of image data

Return type:

numpy.ndarray

FLIList(interface_type=2, device_type=256)[source]

List available devices.

This function returns a list of available FLI devices, including the device port and model name.

Parameters:
  • interface_type (int, optional) – interface to search for connected devices. Valid values are libfli.FLIDOMAIN_USB (default), FLIDOMAIN_PARALLEL_PORT, FLIDOMAIN_SERIAL, FLIDOMAIN_SERIAL_1200, FLIDOMAIN_SERIAL_19200, FLIDOMAIN_INET.

  • device_types (int, optional) – device type to search for. Valid values are libfli.FLIDEVICE_CAMERA (default), FLIDEVICE_FILTERWHEEL, FLIDEVICE_HS_FILTERWHEEL, FLIDEVICE_FOCUSER, FLIDEVICE_ENUMERATE_BY_CONNECTION, FLIDEVICE_RAW.

Returns:

(port, model name) for each available device

Return type:

list of tuples

FLIOpen(port, interface_type=2, device_type=256)[source]

Get a handle to an FLI device.

This function requires the port, interface type and device type of the requested device. Valid ports can be obtained with the FLIList() method.

Parameters:
  • port (str) – port that the device is connected to, e.g. /dev/fliusb0

  • interface_type (int, optional) – interface type of the requested device. Valid values are libfli.FLIDOMAIN_USB (default), FLIDOMAIN_PARALLEL_PORT, FLIDOMAIN_SERIAL, FLIDOMAIN_SERIAL_1200, FLIDOMAIN_SERIAL_19200, FLIDOMAIN_INET.

  • device_type (int, optional) – device type of the requested device. Valid values are libfli.FLIDEVICE_CAMERA (default), FLIDEVICE_FILTERWHEEL, FLIDEVICE_HS_FILTERWHEEL, FLIDEVICE_FOCUSER, FLIDEVICE_ENUMERATE_BY_CONNECTION, FLIDEVICE_RAW.

Returns:

an opaque handle used by library functions to refer to FLI hardware

Return type:

ctypes.c_long

FLISetExposureTime(handle, exposure_time)[source]

Set the exposure time for a camera.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the exposure time of.

  • exposure_time (u.Quantity) – required exposure time. A simple numeric type can be given instead of a Quantity, in which case the units are assumed to be seconds.

FLISetFrameType(handle, frame_type)[source]

Set the frame type for a given camera.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the frame type of.

  • frame_type (int) – frame type. Valid values are libfli.FLI_FRAME_TYPE_NORMAL,

  • FLI_FRAME_TYPE_DARK

  • FLI_FRAME_TYPE_FLOOD

  • FLI_FRAME_TYPE_RBI_FLUSH.

FLISetHBin(handle, bin_factor)[source]

Set the horizontal bin factor for a given camera.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the horizontal bin factor for.

  • bin_factor (int) – horizontal bin factor. The valid range is from 1 to 16 inclusive.

FLISetImageArea(handle, upper_left, lower_right)[source]

Set the image area for a given camera.

This function sets the image area to an area specified in terms of an upperleft point and a lower right point. Note that the lower right point coordinate must take into account the horizontal and vertical bin factor setttings, but the upper left coordinate is absolute.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the image area of.

  • upper_left (int, int) – (x, y) coordinate of upper left point

  • lower_right (int, int) – (x, y) coordinate of lower right point

FLISetNFlushes(handle, n_flushes)[source]

Set the number of flushes for a given camera.

This function sets the number of the times the CCD array of the camera is flushed before exposing a frame. Some FLI cameras support background flishing. Background flushing continuously flushes the CCD eliminating the need for pre-exposure flushings.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the number of flushes for.

  • n_flushes (int) – number of times to flush the CCD array before an exposure. The valid range is from 0 to 16 inclusive.

FLISetTemperature(handle, temperature)[source]

Set the temperature of a given camera.

Parameters:
  • handle (ctypes.c_long) – handle of the camera device to set the temperature of.

  • temperature (astropy.units.Quantity) – temperature to set the cold finger of the camera to. A simple numeric type can be given instead of a Quantity, in which case the units are assumed to be degrees Celsius.

FLISetVBin(handle, bin_factor)[source]

Set the vertical bin factor for a given camera.

Parameters:
  • handle (ctypes.c_long) – handle of the camera to set the vertical bin factor for.

  • bin_factor (int) – vertical bin factor. The valid range is from 1 to 16 inclusive.

get_SDK_version()[source]

Get the version of the SDK

get_devices()[source]

Gets currently connected camera info.

Returns:

All currently connected camera serial numbers with corresponding device nodes.

Return type:

dict

panoptes.pocs.camera.libfliconstants module

panoptes.pocs.camera.sbig module

class panoptes.pocs.camera.sbig.Camera(name='SBIG Camera', *args, **kwargs)[source]

Bases: AbstractSDKCamera

connect()[source]

Connect to SBIG camera.

Gets a ‘handle’, serial number and specs/capabilities from the driver

property cooling_enabled

Current status of the camera’s image sensor cooling system (enabled/disabled).

Can be set by assigning a bool.

property cooling_power

Current power level of the camera’s image sensor cooling system (as a percentage of the maximum).

property egain

Image sensor gain in e-/ADU as reported by the camera.

property is_exposing

True if an exposure is currently under way, otherwise False

property target_temperature

Current value of the target temperature for the camera’s image sensor cooling control.

Can be set by assigning an astropy.units.Quantity.

property temperature

Current temperature of the camera’s image sensor.

panoptes.pocs.camera.sbigudrv module

Low level interface to the SBIG Unversal Driver/Library.

Reproduces in Python (using ctypes) the C interface provided by SBIG’s shared library, i.e. 1 function that does 72 different things selected by passing an integer as the first argument. This is basically a direct translation of the enums and structs defined in the library C-header to Python dicts and ctypes.Structures, plus a class (SBIGDriver) to load the library and call the single command function (SBIGDriver._send_command()).

class panoptes.pocs.camera.sbigudrv.CFWCommand(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Filter wheel command enum

CLOSE_DEVICE = 5
GET_INFO = 3
GOTO = 1
INIT = 2
OPEN_DEVICE = 4
QUERY = 0
class panoptes.pocs.camera.sbigudrv.CFWError(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Filter wheel errors enum

BAD_COMMAND = 2
BAD_MODEL = 5
BUSY = 1
CAL_ERROR = 3
DEVICE_NOT_CLOSED = 6
DEVICE_NOT_OPEN = 7
I2C_ERROR = 8
MOTOR_TIMEOUT = 4
NONE = 0
class panoptes.pocs.camera.sbigudrv.CFWGetInfoSelect(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Filter wheel get info select enum

CAL_DATA = 1
DATA_REGISTERS = 2
FIRMWARE_VERSION = 0
class panoptes.pocs.camera.sbigudrv.CFWModelSelect(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Filter wheel model selection enum

AUTO = 6
CFW10 = 8
CFW10_SERIAL = 9
CFW1603 = 13
CFW2 = 1
CFW402 = 5
CFW5 = 2
CFW6A = 7
CFW8 = 3
CFW9 = 10
CFWL = 4
CFWL8 = 11
CFWL8G = 12
FW5_8300 = 15
FW5_STF_DETENT = 19
FW5_STX = 14
FW7_STX = 17
FW8_8300 = 16
FW8_STT = 18
UNKNOWN = 0
class panoptes.pocs.camera.sbigudrv.CFWParams[source]

Bases: Structure

ctypes Structure used to hold the parameters for the CFW (colour filter wheel) command

cfwCommand

Structure/Union member

cfwModel

Structure/Union member

cfwParam1

Structure/Union member

cfwParam2

Structure/Union member

inLength

Structure/Union member

inPtr

Structure/Union member

outLength

Structure/Union member

outPtr

Structure/Union member

class panoptes.pocs.camera.sbigudrv.CFWResults[source]

Bases: Structure

ctypes Structure used to fold the results from the CFW (colour filer wheel) command

cfwError

Structure/Union member

cfwModel

Structure/Union member

cfwPosition

Structure/Union member

cfwResults1

Structure/Union member

cfwResults2

Structure/Union member

cfwStatus

Structure/Union member

class panoptes.pocs.camera.sbigudrv.CFWStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Filter wheel status enum

BUSY = 2
IDLE = 1
UNKNOWN = 0
class panoptes.pocs.camera.sbigudrv.EndExposureParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the End Exposure command.

ccd

Structure/Union member

class panoptes.pocs.camera.sbigudrv.EndReadoutParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the End Readout Params.

ccd

Structure/Union member

class panoptes.pocs.camera.sbigudrv.EstablishLinkParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Establish Link command.

sbigUseOnly

Structure/Union member

class panoptes.pocs.camera.sbigudrv.EstablishLinkResults[source]

Bases: Structure

ctypes Structure to hold the results from the Establish Link command.

cameraType

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetCCDInfoParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Get CCD Info command, used obtain the details & capabilities of the connected camera.

request

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetCCDInfoResults0[source]

Bases: Structure

ctypes Structure to hold the results from the Get CCD Info command when used with requests ‘CCD_INFO_IMAGING’ or ‘CCD_INFO_TRACKING’.

The firmwareVersion field is 4 digit binary coded decimal of the form XX.XX.

cameraType

Structure/Union member

firmwareVersion

Structure/Union member

name

Structure/Union member

readoutInfo

Structure/Union member

readoutModes

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetCCDInfoResults2[source]

Bases: Structure

ctypes Structure to hold the results from the Get CCD Info command when used with request ‘CCD_INFO_EXTENDED’.

badColumns

Structure/Union member

columns

Structure/Union member

imagingABG

Structure/Union member

serialNumber

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetCCDInfoResults4[source]

Bases: Structure

ctypes Structure to hold the results from the Get CCD Info command when used with requests ‘CCD_INFO_EXTENDED2_IMAGING’ or ‘CCD_INFO_EXTENDED2_TRACKING’.

The capabilitiesBits is a bitmap, yay.

capabilities_b0

Structure/Union member

capabilities_b1

Structure/Union member

capabilities_b2

Structure/Union member

capabilities_b3

Structure/Union member

capabilities_b4

Structure/Union member

capabilities_b5

Structure/Union member

capabilities_unusued

Structure/Union member

dumpExtra

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetCCDInfoResults6[source]

Bases: Structure

ctypes Structure to hold the results from the Get CCD Info command when used with the request ‘CCD_INFO_EXTENDED3’.

The sbigudrv.h C header says there should be three bitmask fields, each of type ulong, which would be 64 bits on this platform (OS X), BUT trial and error has determined they’re actually 32 bits long.

camera_b0

Structure/Union member

camera_b1

Structure/Union member

camera_unused

Structure/Union member

ccd_b0

Structure/Union member

ccd_b1

Structure/Union member

ccd_unused

Structure/Union member

extraBits

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetDriverControlParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Get Driver Control command, used to query the value of a specific driver control parameter.

controlParameter

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetDriverControlResults[source]

Bases: Structure

ctypes Structure to hold the result from the Get Driver Control command, used to query the value of a specific driver control parameter

controlValue

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetDriverHandleResults[source]

Bases: Structure

ctypes Structure to hold the results from the Get Driver Handle command. The handle is the camera ID used when switching control between connected cameras with the Set Driver Handle command.

handle

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetDriverInfoParams[source]

Bases: Structure

ctypes Structure used to hold the parameters for the Get Driver Info command

request

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetDriverInfoResults0[source]

Bases: Structure

ctypes Structure used to hold the results from the Get Driver Info command

maxRequest

Structure/Union member

name

Structure/Union member

version

Structure/Union member

class panoptes.pocs.camera.sbigudrv.GetLinkStatusResults[source]

Bases: Structure

ctypes Structure to hold the results from the Get Link Status command.

baseAddress

Structure/Union member

cameraType

Structure/Union member

comFailed

Structure/Union member

comTotal

Structure/Union member

linkEstablished

Structure/Union member

class panoptes.pocs.camera.sbigudrv.OpenDeviceParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Open Device command.

deviceType

Structure/Union member

ipAddress

Structure/Union member

lptBaseAddress

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryCommandStatusParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Query Command Status command.

command

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryCommandStatusResults[source]

Bases: Structure

ctypes Structure to hold the results from the Query Command Status command.

status

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryTemperatureStatusParams[source]

Bases: Structure

ctypes Structure used to hold the parameters for the Query Temperature Status command.

request

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryTemperatureStatusResults[source]

Bases: Structure

ctypes Structure used to hold the results from the Query Temperature Status command (standard version).

ambientThermistor

Structure/Union member

ccdSetpoint

Structure/Union member

ccdThermistor

Structure/Union member

enabled

Structure/Union member

power

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryTemperatureStatusResults2[source]

Bases: Structure

ctypes Structure used to hold the results from the Query Temperature Status command (extended version).

ambientTemperature

Structure/Union member

ccdSetpoint

Structure/Union member

coolingEnabled

Structure/Union member

externalTrackingCCDPower

Structure/Union member

externalTrackingCCDTemperature

Structure/Union member

fanEnabled

Structure/Union member

fanPower

Structure/Union member

fanSpeed

Structure/Union member

heatsinkTemperature

Structure/Union member

imagingCCDPower

Structure/Union member

imagingCCDTemperature

Structure/Union member

trackingCCDPower

Structure/Union member

trackingCCDSetpoint

Structure/Union member

trackingCCDTemperature

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryUSBInfo[source]

Bases: Structure

ctypes (Sub-)Structure used to hold details of individual cameras returned by ‘CC_QUERY_USB’ command

cameraFound

Structure/Union member

cameraType

Structure/Union member

name

Structure/Union member

serialNumber

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryUSBResults[source]

Bases: Structure

ctypes Structure used to hold the results from ‘CC_QUERY_USB’ command (max 4 cameras).

camerasFound

Structure/Union member

usbInfo

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryUSBResults2[source]

Bases: Structure

ctypes Structure used to hold the results from ‘CC_QUERY_USB2’ command (max 8 cameras).

camerasFound

Structure/Union member

usbInfo

Structure/Union member

class panoptes.pocs.camera.sbigudrv.QueryUSBResults3[source]

Bases: Structure

ctypes Structure used to hold the results from ‘CC_QUERY_USB3’ command (max 24 cameras).

camerasFound

Structure/Union member

usbInfo

Structure/Union member

class panoptes.pocs.camera.sbigudrv.ReadoutInfo[source]

Bases: Structure

ctypes Structure to store details of an individual readout mode. An array of up to 20 of these will be returned as part of the GetCCDInfoResults0 struct when the Get CCD Info command is used with request ‘CCD_INFO_IMAGING’.

The gain field is a 4 digit Binary Coded Decimal (yes, really) of the form XX.XX, in units of electrons/ADU.

The pixel_width and pixel_height fields are 6 digit Binary Coded Decimals for the form XXXXXX.XX in units of microns, helpfully supporting pixels up to 1 metre across.

gain

Structure/Union member

height

Structure/Union member

mode

Structure/Union member

pixelHeight

Structure/Union member

pixelWidth

Structure/Union member

width

Structure/Union member

class panoptes.pocs.camera.sbigudrv.ReadoutLineParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Readout Line command.

ccd

Structure/Union member

pixelLength

Structure/Union member

pixelStart

Structure/Union member

readoutMode

Structure/Union member

class panoptes.pocs.camera.sbigudrv.SBIGDriver(library_path=None, retries=1, **kwargs)[source]

Bases: AbstractSDKDriver

cfw_get_info(handle, model='AUTO')[source]

Get info from the colour filter wheel

This will return the usual status information plus the firmware version and the number of filter wheel positions.

Parameters:
  • handle (int) – handle of the camera that the filter wheel is connected to.

  • model (str, optional) – Model of the filter wheel to control. Default is ‘AUTO’, which asks the driver to autodetect the model.

Returns:

dictionary containing the ‘model’, ‘firmware_version’ and ‘n_positions’ for the

filter wheel.

Return type:

dict

Raises:

RuntimeError – raised if the driver returns an error

cfw_goto(handle, position, model='AUTO', cfw_event=None, timeout=<Quantity 10. s>)[source]

Move colour filer wheel to a given position

This function returns immediately after starting the move but spawns a thread to poll the filter wheel until the move completes (see _cfw_poll method for details). This thread will log the result of the move, and optionally set a threading.Event to signal that it has completed.

Parameters:
  • handle (int) – handle of the camera that the filter wheel is connected to.

  • position (int) – position to move the filter wheel. Must an integer >= 1.

  • model (str, optional) – Model of the filter wheel to control. Default is ‘AUTO’, which asks the driver to autodetect the model.

  • cfw_event (threading.Event, optional) – Event to set once the move is complete

  • timeout (u.Quantity, optional) – maximum time to wait for the move to complete. Should be a Quantity with time units. If a numeric type without units is given seconds will be assumed. Default is 10 seconds.

Returns:

dictionary containing the ‘model’, ‘position’, ‘status’ and ‘error’ values

returned by the driver.

Return type:

dict

Raises:

RuntimeError – raised if the driver returns an error

cfw_init(handle, model='AUTO', timeout=<Quantity 10. s>)[source]

Initialise colour filter wheel

Sends the initialise command to the colour filter wheel attached to the camera specified with handle. This will generally not be required because all SBIG filter wheels initialise themselves on power up.

Parameters:
  • handle (int) – handle of the camera that the filter wheel is connected to.

  • model (str, optional) – Model of the filter wheel to control. Default is ‘AUTO’, which asks the driver to autodetect the model.

  • timeout (u.Quantity, optional) – maximum time to wait for the move to complete. Should be a Quantity with time units. If a numeric type without units is given seconds will be assumed. Default is 10 seconds.

Returns:

dictionary containing the ‘model’, ‘position’, ‘status’ and ‘error’ values

returned by the driver.

Return type:

dict

Raises:

RuntimeError – raised if the driver returns an error

cfw_query(handle, model='AUTO')[source]

Query status of the colour filter wheel

This is mostly used to poll the filter wheel status after asking the filter wheel to move in order to find out when the move has completed.

Parameters:
  • handle (int) – handle of the camera that the filter wheel is connected to.

  • model (str, optional) – Model of the filter wheel to control. Default is ‘AUTO’, which asks the driver to autodetect the model.

Returns:

dictionary containing the ‘model’, ‘position’, ‘status’ and ‘error’ values

returned by the driver.

Return type:

dict

Raises:

RuntimeError – raised if the driver returns an error

disable_vdd_optimized(handle)[source]

Stops selective lowering of the CCD’s Vdd voltage to ensure consistent bias structures.

There are many driver control parameters, almost all of which we would not want to change from their default values. The one exception is DCP_VDD_OPTIMIZED. From the SBIG manual:

The DCP_VDD_OPTIMIZED parameter defaults to TRUE which lowers the CCD’s Vdd (which reduces amplifier glow) only for images 3 seconds and longer. This was done to increase the image throughput for short exposures as raising and lowering Vdd takes 100s of milliseconds. The lowering and subsequent raising of Vdd delays the image readout slightly which causes short exposures to have a different bias structure than long exposures. Setting this parameter to FALSE stops the short exposure optimization from occurring.

The default behaviour will improve image throughput for exposure times of 3 seconds or less but at the penalty of altering the bias structure between short and long exposures. This could cause systematic errors in bias frames, dark current measurements, etc. It’s probably not worth it.

get_SDK_version(request_type='DRIVER_STD')[source]

Get the version of the SDK

get_ccd_info(handle)[source]

Use Get CCD Info to gather all relevant info about CCD capabilities. Already have camera type, ‘name’ and serial number, this gets the rest.

get_devices()[source]

Gets currently connected camera inf.

Returns:

All currently connected camera serial numbers with corresponding handles.

Return type:

dict

get_driver_handle()[source]
get_exposure_status(handle)[source]

Returns the current exposure status of the camera, e.g. ‘CS_IDLE’, ‘CS_INTEGRATING’

open_device(device_type)[source]
open_driver()[source]
query_temp_status(handle)[source]
readout(handle, readout_mode, top, left, height, width)[source]
property retries
set_handle(handle)[source]
set_temp_regulation(handle, target_temperature, enabled)[source]
start_exposure(handle, seconds, dark, antiblooming, readout_mode, top, left, height, width)[source]
class panoptes.pocs.camera.sbigudrv.SetDriverControlParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Set Driver Control command, used to set the value of a specific driver control parameter

controlParameter

Structure/Union member

controlValue

Structure/Union member

class panoptes.pocs.camera.sbigudrv.SetDriverHandleParams[source]

Bases: Structure

ctypes Structure to hold the parameter for the Set Driver Handle command.

handle

Structure/Union member

class panoptes.pocs.camera.sbigudrv.SetTemperatureRegulationParams[source]

Bases: Structure

ctypes Structure used to hold the parameters for the Set Temperature Regulation command.

ccdSetpoint

Structure/Union member

regulation

Structure/Union member

class panoptes.pocs.camera.sbigudrv.SetTemperatureRegulationParams2[source]

Bases: Structure

ctypes Structure used to hold the parameters for the Set Temperature Regulation 2 command.

ccdSetpoint

Structure/Union member

regulation

Structure/Union member

class panoptes.pocs.camera.sbigudrv.StartExposureParams2[source]

Bases: Structure

ctypes Structure to hold the parameters for the Start Exposure 2 command. (The Start Exposure command is deprecated.)

abgState

Structure/Union member

ccd

Structure/Union member

exposureTime

Structure/Union member

height

Structure/Union member

left

Structure/Union member

openShutter

Structure/Union member

readoutMode

Structure/Union member

top

Structure/Union member

width

Structure/Union member

class panoptes.pocs.camera.sbigudrv.StartReadoutParams[source]

Bases: Structure

ctypes Structure to hold the parameters for the Start Readout command.

ccd

Structure/Union member

height

Structure/Union member

left

Structure/Union member

readoutMode

Structure/Union member

top

Structure/Union member

width

Structure/Union member

panoptes.pocs.camera.sdk module

class panoptes.pocs.camera.sdk.AbstractSDKCamera(name='Generic SDK camera', driver=<class 'panoptes.pocs.camera.sdk.AbstractSDKDriver'>, library_path=None, filter_type=None, target_temperature=None, *args, **kwargs)[source]

Bases: AbstractCamera

property properties

A collection of camera properties as read from the camera

class panoptes.pocs.camera.sdk.AbstractSDKDriver(name, library_path=None, *args, **kwargs)[source]

Bases: PanBase

abstract get_SDK_version()[source]

Get the version of the SDK

abstract get_devices()[source]

Get connected device UIDs and corresponding device nodes/handles/IDs.

property version

panoptes.pocs.camera.zwo module

class panoptes.pocs.camera.zwo.Camera(name='ZWO ASI Camera', gain=100, image_type=None, *args, **kwargs)[source]

Bases: AbstractSDKCamera

property bit_depth

ADC bit depth

connect(enable_cooling=False)[source]

Connect to ZWO ASI camera.

Gets ‘camera_ID’ (needed for all driver commands), camera properties and details of available camera commands/parameters.

property cooling_enabled

Current status of the camera’s image sensor cooling system (enabled/disabled)

property cooling_power

Current power level of the camera’s image sensor cooling system (as a percentage).

property egain

Image sensor gain in e-/ADU for the current gain, as reported by the camera.

property gain

Current value of the camera’s gain setting in internal units.

See egain for the corresponding electrons / ADU value.

property image_type

Current camera image type, one of ‘RAW8’, ‘RAW16’, ‘Y8’, ‘RGB24’

property is_exposing

True if an exposure is currently under way, otherwise False

start_video(seconds, filename_root, max_frames, image_type=None)[source]
stop_video()[source]
property target_temperature

Current value of the target temperature for the camera’s image sensor cooling control.

Can be set by assigning an astropy.units.Quantity

property temperature

Current temperature of the camera’s image sensor

Module contents

panoptes.pocs.camera.create_cameras_from_config(config=None, cameras=None, auto_primary=True, recreate_existing=False, *args, **kwargs)[source]

Create camera object(s) based on the config.

Creates a camera for each camera item listed in the config. Ensures the appropriate camera module is loaded.

Parameters:
  • config (dict or None) – A config object for a camera or None to lookup in config-server.

  • cameras (list of panoptes.pocs.camera.Camera or None) – A list of camera objects or None.

  • auto_primary (bool) – If True, when no camera is marked as the primary camera, the first camera in the list will be used as primary. Default True.

  • recreate_existing (bool) – If True, a camera object will be recreated if an existing camera with the same uid is already assigned. Should currently only affect cameras that use the sdk (i.g. not DSLRs). Default False raises an exception if camera is already assigned.

  • *args (list) – Passed to get_config.

  • **kwargs (dict) – Can pass a cameras object that overrides the info in the configuration file. Can also pass auto_detect`(bool) to try and automatically discover the ports. Any other items as passed to `get_config.

Returns:

An ordered dictionary of created camera objects, with the

camera name as key and camera instance as value. Returns an empty OrderedDict if there is no camera configuration items.

Return type:

OrderedDict

Raises:
  • error.CameraNotFound – Raised if camera cannot be found at specified port or if auto_detect=True and no cameras are found.

  • error.PanError – Description

panoptes.pocs.camera.get_gphoto2_cmd()[source]

Finds the gphoto2 command on the system

panoptes.pocs.camera.list_connected_cameras(endpoint: AnyHttpUrl | None = None)[source]

Detect connected cameras.

Uses gphoto2 to try and detect which cameras are connected. Cameras should be known and placed in config but this is a useful utility.

Returns:

A list of the ports with detected cameras.

Return type:

list