API

Actor

class lvmcam.actor.actor.LVMCamActor(*args, **kwargs)[source]

Bases: BaseCameraActor, AMQPActor

The LVMCam actor.

async parse_actor_reply(reply)[source]

Parses replies from the actor system and updates scraped data.

Parameters:

reply (AMQPReply)

async start(**kwargs)[source]

Starts the actor and adds cameras to the camera system.

lvmcam.actor.actor.get_camera_class(config)[source]

Returns a camera class with the correct image namer and fits model.

Parameters:

config (dict)

lvmcam.actor.actor.mergedicts(a, b)[source]

Camera

class lvmcam.camera.BlackflyCamera(*args, **kwargs)[source]

Bases: BaseCamera, ExposureTypeMixIn, ImageAreaMixIn, CoolerMixIn, GainMixIn

A FLIR (formerly Point Grey Research) Blackfly camera. Given the pixel scale on the benches of LVMi and the assumption of 9 um pixel sizes of the LVMi cameras, we assume that the cameras have roughly 1 arsec per pixel, so they are used without binning.

In addition we let the camera flip the standard image orientation of the data values assuming that values are stored into a FITS interface (where the first values in the sequential data are the bottom row). So this is not done in this python code but by the camera.

async expose(*args, **kwargs)[source]

Exposes the camera.

This is the general method to expose the camera. It receives the exposure time and type of exposure, along with other necessary arguments, and returns an Exposure instance with the data and metadata for the image.

The Exposure object is created and populated by expose and passed to the parent mixins for the camera class. It is also passed to the internal expose method where the concrete implementation of the camera expose system happens.

Parameters:
  • exptime – The exposure time for the image, in seconds.

  • image_type – The type of image ({'bias', 'dark', 'object', 'flat'}).

  • stack – Number of images to stack.

  • stack_function – The function to apply to the several images taken to generate the final stacked image. Defaults to the median.

  • fits_model – A FITSModel that can be used to override the default model for the camera.

  • filename – The path where to write the image. If not given, a new name is automatically assigned based on the camera instance of ImageNamer.

  • num – If specified, a num value to pass wot ImageNamer to define the sequence number of the exposure filename.

  • write – If True, writes the image to disk immediately.

  • postprocess – Whether to run the post-process stage. This argument is ignored if the subclass of BaseCamera does not override _post_process_internal.

  • kwargs – Other keyword arguments to pass to the internal expose and post-process methods.

Returns:

exposure – An Exposure object containing the image data, exposure time, and header datamodel.

async reconnect()[source]

Reconnects the camera.

class lvmcam.camera.BlackflyCameraSystem(camera_class=None, camera_config=None, include=None, exclude=None, logger=None, log_header=None, log_file=None, verbose=False)[source]

Bases: CameraSystem

A collection of GenICam cameras, possibly online.

Parameters:
  • camera_class (BaseCamera subclass) – The subclass of BaseCamera to use with this camera system.

  • camera_config (dict or path) – A dictionary with the configuration parameters for the multiple cameras that can be present in the system, or the path to a YAML file. Refer to the documentation for details on the accepted format.

  • include (list) – List of camera UIDs that can be connected.

  • exclude (list) – List of camera UIDs that will be ignored.

  • logger (Logger) – The logger instance to use. If None, a new logger will be created.

  • log_header (str) – A string to be prefixed to each message logged.

  • log_file (str) – The path to which to log.

  • verbose (bool) – Whether to log to stdout.

list_available_cameras()[source]

Lists the connected cameras as reported by the camera system.

Returns:

connected_cameras – A list of unique identifiers of cameras connected to the system.