panoptes.pocs.camera.gphoto package

Submodules

panoptes.pocs.camera.gphoto.base module

class panoptes.pocs.camera.gphoto.base.AbstractGPhotoCamera(*arg, **kwargs)[source]

Bases: AbstractCamera, ABC

Abstract camera class that uses gphoto2 interaction.

Parameters:

config (Dict) – Config key/value pairs, defaults to empty dict.

command(cmd: List[str] | str, check_exposing: bool = True)[source]

Run gphoto2 command.

connect()[source]
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).

get_command_result(timeout: float = 10) List[str] | None[source]

Get the output from the command.

Accepts a timeout param for communicating with the process.

Returns a list of strings corresponding to the output from the gphoto2 camera or None if no command has been specified.

get_property(prop: str) str[source]

Gets a property from the camera

classmethod gphoto_file_download(port: str, filename_pattern: str, only_new: bool = True)[source]

Downloads (newer) files from the camera on the given port using the filename pattern.

property is_exposing

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

load_properties() dict[source]

Load properties from the camera.

Reads all the configuration properties available via gphoto2 and returns as dictionary.

process_exposure(metadata, **kwargs)[source]

Converts the CR2 to FITS then processes image.

set_properties(prop2index: Dict[str, int] = None, prop2value: Dict[str, str] = None)[source]

Sets a number of properties all at once, by index or value.

Parameters:
  • prop2index (dict or None) – A dict with keys corresponding to the property to be set and values corresponding to the index option.

  • prop2value (dict or None) – A dict with keys corresponding to the property to be set and values corresponding to the literal value.

set_property(prop: str, val: str | int, is_value: bool = False, is_index: bool = False)[source]

Set a property on the camera.

Parameters:
  • prop (str) – The property to set.

  • val (str, int) – The value to set the property to.

  • is_value (bool) – If True, then the value is a literal value. Default False.

  • is_index (bool) – If True, then the value is an index. Default False.

Raises:

ValueError – If the property is not found.

classmethod start_tether(port, filename_pattern: str = '%Y%m%dT%H%M%S.%C')[source]

Start a tether for gphoto2 auto-download on given port using filename pattern.

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 uid: str

A six-digit serial number for the camera

panoptes.pocs.camera.gphoto.canon module

class panoptes.pocs.camera.gphoto.canon.Camera(readout_time: float = 1.0, file_extension: str = 'cr2', connect: bool = True, *args, **kwargs)[source]

Bases: AbstractGPhotoCamera

property bit_depth

ADC bit depth.

connect()[source]

Connect to Canon DSLR.

Gets the serial number from the camera and sets various settings.

property egain

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

classmethod get_shutterspeed_index(seconds: float, return_minimum: bool = False)[source]

Looks up the appropriate shutterspeed setting for the given seconds.

If the given seconds does not match a set shutterspeed, the ‘bulb’ setting is returned.

panoptes.pocs.camera.gphoto.remote module

class panoptes.pocs.camera.gphoto.remote.Camera(endpoint: AnyHttpUrl = 'http://localhost:6565', *args, **kwargs)[source]

Bases: Camera

A remote gphoto2 camera class.

command(cmd, endpoint: AnyHttpUrl = None)[source]

Run the gphoto2 command remotely.

This assumes the remote camera service is running at the endpoint specified on the camera object or passed to the method.

get_command_result(timeout: float = 10) List[str] | None[source]

Get the output from the remote camera service.

property is_exposing

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

Module contents