Camera

Description

Module: geocompy.geo.cam

Definitions for the GeoCOM Camera subsystem.

Types

  • GeoComCAM

Definitions

class GeoComCAM(parent: GeoComType)[source]

Camera subsystem of the GeoCOM protocol.

This subsystem performs tasks relating to the overview camera and (on Nova instruments) the telescope mounted camera

All functions require a valid GeoCOM Imaging license.

Added in version GeoCOM-VivaTPS.

Parameters:
parent: GeoComType

The parent protocol instance of this subsystem.

get_autofocus_position() GeoComResponse[int][source]

RPC 23644, CAM_AF_GetMotorPosition

Gets the current position of the autofocus motor.

Returns:

Params:
  • int: Autofocus motor position.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_camera_direction(dist: float, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[Vector][source]

RPC 23611, CAM_GetCamViewingDir

Gets the view vector of the overview camera relative to its coordinates. The viewing vector is a 3D vector along the optical axis of the camera, with the given slope distance length.

Parameters:
dist: float

View vector length.

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Params:
  • Coordinate: Viewing vector.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_camera_fov(camera: Camera | str = Camera.OVERVIEW, zoom: Zoom | str = Zoom.X1) GeoComResponse[tuple[Angle, Angle]][source]

RPC 23619, CAM_GetCameraFoV

Gets field of view of the overview camera for a given zoom level.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

zoom: Zoom | str = Zoom.X1

Zoom level, by default X1

Returns:

Params:
  • Angle: Horizontal field of view.

  • Angle: Vertical field of view.

Error codes:
  • IVPARAM: Invalid parameter.

  • NA: Imaging license not found.

Return type:

GeoComResponse

get_camera_position(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[Coordinate][source]

RPC 23611, CAM_GetCamPos

Gets the position of the overview camera, relative to the station coordinates.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Params:
  • Coordinate: Relative coordinates of the camera.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

See also

tmc.get_station, get_camera_direction

get_camera_power_status(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[bool][source]

RPC 23636, CAM_GetCameraPowerSwitch

Gets the current state of the camera.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Params:
  • bool: Camera is powered and active.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_overview_crosshair() GeoComResponse[tuple[float, float]][source]

RPC 23624, CAM_GetActCameraCenter

Calculates the position of the optical crosshair on the overview camera image, at a previously set distance.

Returns:

Params:
  • float: Horizontal position of corsshair on image.

  • float: Vertical position of corsshair on image.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_overview_exterior_orientation(calibrated: bool = True) GeoComResponse[tuple[Coordinate, Angle, Angle, Angle]][source]

RPC 23603, CAM_OVC_ReadExterOrient

Gets the exterior orientation parameters of the camera.

Parameters:
calibrated: bool = True

Use calibrated data.

Returns:

Params:
  • Coordinate: Camera offset coordinates.

  • Angle: Yaw deviation.

  • Angle: Pitch deviation.

  • Angle: Roll deviation.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_overview_interior_orientation(calibrated: bool = True) GeoComResponse[tuple[float, float, float, float]][source]

RPC 23602, CAM_OVC_ReadInterOrient

Gets the interior orientation parameters of the camera.

Parameters:
calibrated: bool = True

Use calibrated data.

Returns:

Params:
  • float: Horizontal position of principal point [px].

  • float: Vertical position of principal point [px].

  • float: Focus length [m].

  • float: Pixel size [m/px].

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_sensor_size(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[tuple[float, float]][source]

RPC 23668, CAM_GetChipWindowSize

Gets the size of the camera chip.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Params:
  • float: Sensor width.

  • float: Sensor height.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_telescopic_crosshair() GeoComResponse[tuple[int, int]][source]

RPC 23671, CAM_OAC_GetCrossHairPos

Gets the position of the crosshair in the actual camera resolution.

Returns:

Params:
  • int: Horizontal position.

  • int: Vertical position.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

get_zoom(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[Zoom][source]

RPC 23609, CAM_GetZoomFactor

Sets the current zoom factor on a camera device.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Params:
  • Zoom: Current zoom level.

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

is_camera_ready(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23627, CAM_IsCameraReady

Checks if a camera is ready for use.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

  • CAM_NOT_READY: Camera is turned off, or currently starting up.

Return type:

GeoComResponse

set_actual_image_name(name: str, number: int, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23619, CAM_SetActualImageName

Sets the name and number of the next image to be taken.

Parameters:
name: str

Image name.

number: int

Image number.

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

See also

take_image

set_autofocus_position(position: int) GeoComResponse[None][source]

RPC 23645, CAM_AF_SetMotorPosition

Sets the autofocus motor to a specific position.

Parameters:
position: int

Autofocus motor position.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_camera_properties(resolution: Resolution | str, compression: Compression | str, jpegquality: JPEGQuality | str, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23633, CAM_SetCameraProperties

Sets camera parameters.

Parameters:
resolution: Resolution | str

Image resolution.

compression: Compression | str

Image compression.

jpegquality: JPEGQuality | str

JPEG image compression quality.

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_focus_to_distance(dist: float) GeoComResponse[None][source]

RPC 23652, CAM_AF_PositFocusMotorToDist

Sets the autofocus motor to the specified distance.

Parameters:
dist: float

Distance to focus to.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_focus_to_infinity() GeoComResponse[None][source]

RPC 23677, CAM_AF_PositFocusMotorToInfinity

Sets the autofocus motor to focus to infinity.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_focus_to_target() GeoComResponse[None][source]

RPC 23662, CAM_AF_SingleShotAutofocus

Focuses current target.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_focus_to_target_contrast(steps: int) GeoComResponse[None][source]

RPC 23663, CAM_AF_FocusContrastAroundCurrent

Focuses current target by contrast around target.

Parameters:
steps: int

Focus iteration steps.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_overview_distance(dist: float, face1: bool = True) GeoComResponse[None][source]

RPC 23625, CAM_GetActDistance

Sets distance to the current target.

Parameters:
dist: float

Target distance.

face1: bool = True

Telescope is in face 1 position.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

set_whitebalance(whitebalance: WhiteBalance | str = WhiteBalance.AUTO, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23626, CAM_SetWhiteBalanceMode

Sets the white balance mode for a camera device.

Parameters:
whitebalance: WhiteBalance | str = WhiteBalance.AUTO

White balance mode, by default WhiteBalance.AUTO

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

See also

take_image

set_zoom(zoom: Zoom | str, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23608, CAM_SetZoomFactor

Sets the specified zoom factor on a camera device.

Parameters:
zoom: Zoom | str

Zoom level to set.

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

start_remote_video(fps: int, bitrate: int, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23675, CAM_StartRemoteVideo

Starts a remote video stream that can be watched when connected wirelessly to the instrument. Networkstrea: rtsp://192.168.254.3/TSCame.

Parameters:
fps: int

Frame rate 3/5/10 [Hz].

bitrate: int

Video bit rate in [100; 6144] range [kbps].

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

stop_remote_video() GeoComResponse[None][source]

RPC 23676, CAM_StopRemoteVideo

Stops the remote video stream.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

switch_camera_power(activate: bool, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23637, CAM_SetCameraPowerSwitch

Sets the state of the camera.

Parameters:
activate: bool

Power up and activate camera.

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

switch_continuous_autofocus(start: bool) GeoComResponse[None][source]

RPC 23669, CAM_AF_ContinuousAutofocus

Starts or stops the continuous autofocus.

Parameters:
start: bool

Start the continuous autofocus.

Returns:

Error codes:
  • NA: Imaging license not found.

Return type:

GeoComResponse

take_image(camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23623, CAM_TakeImage

Takes a new image with the selected camera.

Parameters:
camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • CAM_IMAGE_SAVING_ERROR: Error while saving, SD card might not be available.

  • NA: Imaging license not found.

Return type:

GeoComResponse

wait_for_camera_ready(wait: int = 30, camera: Camera | str = Camera.OVERVIEW) GeoComResponse[None][source]

RPC 23638, CAM_WaitForCameraReady

Waits for the camera device to become ready for use.

Parameters:
wait: int = 30

Time to wait for the camera to come online [s].

camera: Camera | str = Camera.OVERVIEW

Camera device, by default OVERVIEW

Returns:

Error codes:
  • NA: Imaging license not found.

  • TIMEOUT: Camera did not become usable within the specified time.

Return type:

GeoComResponse