msl.equipment.resources.dataray.datarayocx_64 module

Establishes a connection to the DATARAYOCX library developed by DataRay Inc.

class msl.equipment.resources.dataray.datarayocx_64.DataRayOCX64(record)[source]

Bases: Connection

A wrapper around the DataRayOCX32 class.

This class can be used with either a 32- or 64-bit Python interpreter to call the 32-bit functions in the DATARAYOCX library. A GUI is created to configure and visualize the images taken by the camera.

Tested with the WinCamD-LCM-8.0D36 software version.

The properties for a DataRay connection supports the following key-value pairs in the Connections Database:

'area_filter': int, area filter: 1=1pixel, 2=3pixels, 3=5pixels, 4=7pixels, 5=9pixels [default: 1]
'camera_index': int, the camera to use (between 0 and 7; 0=first camera found) [default: 0]
'centroid_method': int, the centroid method to use (0, 1 or 2) [default: 0]
'filter': float, percent full scale filter (0, 0.1, 0.2, 0.5, 1, 2, 5 or 10) [default: 0.2]
'major_minor_method': int, the major/minor method to use (0, 1 or 2) [default: 0]
'ui_size': int, the size of the User Interface (value=height of a button in pixels) [default: 25]

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters:

record (EquipmentRecord) – A record from an Equipment-Register Database.

wait_to_configure()[source]

Wait until the camera has been configured.

This is a blocking call and waits until you close the popup Window.

capture(timeout=10, restart=False)[source]

Capture an image.

Parameters:
  • timeout (float, optional) – The maximum number of seconds to wait to capture an image.

  • restart (bool, optional) – Whether to keep the camera running after the image is captured.

Returns:

dict – The information about the captured image. The key-value pairs are:

  • adc_peak_%: float, the maximum ADC value (as a percentage)

  • area_filter: int, area filtering applies a convolution to the pixels (1=1pixel, 2=3pixels, 3=5pixels, 4=7pixels, 5=9pixels)

  • centroid: tuple, the (x, y) centroid value

  • centroid_filter_size: int, centroid filter size (in pixels)

  • centroid_type: int, the centroid type (0, 1 or 2)

  • clip_level_centroid: float, the centroid clip level (between 0 and 1)

  • clip_level_geo: float, the geometric clip level (between 0 and 1)

  • crosshair: float, the angle between the horizontal x-axis and the solid crosshair line (in degrees)

  • eff_2w: float, the effective beam size (in um)

  • effective_centroid: tuple, the effective (x, y) centroid value

  • effective_geo_centroid: tuple, the effective (x, y) geometric centroid value

  • ellip: float, the ratio between the minor/major axis

  • elp: float, the beam azimutal angle for ISO 11146 (in degrees)

  • exposure_time: float, the exposure time (in ms)

  • filter_full_scale: float, used in the triangular weighting smoothing function

  • image: numpy.ndarray, the camera image

  • image_zoom: float, the zoom factor of the image

  • imager_gain: float, the gain used by the imager

  • inc_p: float, Dxx power (in Watts)

  • inc_power_area: float, Dxx beam area (in mm^2)

  • inc_power_major: float, Dxx beam diameter along the major axis (in mm)

  • inc_power_mean: float, Dxx mean beam diameter (in mm)

  • inc_power_minor: float, Dxx beam diameter along the minor axis (in mm)

  • is_fast_update: bool, whether the camera is in fast update or normal mode

  • is_full_resolution: bool, whether the camera is set to full resolution

  • maj_iso: float, the ISO 11146 beam size along the major axis (in um)

  • major: float, the beam size along the major axis (in um)

  • major_minor_method: int, the major/minor method used (0, 1 or 2)

  • mean: float, the mean beam size (in um)

  • mean_theta: float, Dxx mean angle (in mrad)

  • min_iso: float, the ISO 11146 beam size along the minor axis (in um)

  • minor: float, the beam size along the minor axis (in um)

  • num_averages: int, the number of averages per capture

  • num_captures: int, the number of images that have been captured

  • orient: float, the angle between the horizontal x-axis and the major or minor axis closest to the horizontal x-axis (in degrees)

  • peak: tuple, the peak location in (x, y), usually zero

  • pixel_width_um: float, the width of a pixel (in um)

  • pixel_height_um: float, the height of a pixel (in um)

  • pk_to_avg: float, the peak to average value

  • plateau_uniformity: float, the flatness of the plateau (between 0 and 1)

  • profile_x: numpy.ndarray, the profile in the X direction

  • profile_y: numpy.ndarray, the profile in the Y direction

  • roi: tuple, the selected region of interest (x, y, width, height)

  • xc: float, the centroid position along the x axis (in um)

  • xg: float, the geometric centroid position along the x axis (in um)

  • xp: float, the peak-intensity centroid position along the x axis (in um)

  • xu: float, the user-selected centroid position along the x axis (in um)

  • yc: float, the centroid position along the y axis (in um)

  • yg: float, the geometric centroid position along the y axis (in um)

  • yp: float, the peak-intensity centroid position along the y axis (in um)

  • yu: float, the user-selected centroid position along the y axis (in um)

Raises:

DataRayError – If not successful.

disconnect()[source]

Disconnect from the camera.

start()[source]

Start the camera.

stop()[source]

Stop the camera.