panoptes.pocs.camera.gphoto package¶
Submodules¶
panoptes.pocs.camera.gphoto.base module¶
Base classes and helpers for DSLR cameras controlled via gphoto2.
Provides AbstractGPhotoCamera, a concrete AbstractCamera subclass that shells out to the system gphoto2 binary for exposure control and property management. This module is used by gphoto-based DSLR drivers.
- class panoptes.pocs.camera.gphoto.base.AbstractGPhotoCamera(*arg, **kwargs)[source]¶
Bases:
AbstractCamera,ABCAbstract 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 a gphoto2 command and start tracking the subprocess.
- Parameters:
- Raises:
panoptes.utils.error.InvalidCommand – If a command is already in progress or parameters are invalid for gphoto2.
panoptes.utils.error.PanError – For unexpected errors starting the subprocess.
- Returns:
None
- connect()[source]¶
Connect to the DSLR via gphoto2.
Implementations should validate communication to the camera (e.g., by listing capabilities) and set internal flags required by AbstractCamera.
- Raises:
NotImplementedError – This base class does not implement device-specific logic.
- property cooling_power¶
Cooling power level for the camera, if available.
- Returns:
DSLRs via gphoto2 typically do not expose cooling power metrics.
- Return type:
None
- get_command_result(timeout: float = 10) list[str] | None[source]¶
Retrieve stdout lines from the last gphoto2 subprocess.
- classmethod gphoto_file_download(port: str, filename_pattern: str, only_new: bool = True)[source]¶
Download files from the camera using gphoto2.
- Parameters:
- Returns:
The list of file paths reported as saved by gphoto2.
- Return type:
- property is_exposing¶
Whether a gphoto2 command (exposure) is still running.
- Returns:
True if the current exposure subprocess is active.
- Return type:
- load_properties() dict[source]¶
Load properties from the camera.
Reads all the configuration properties available via gphoto2 and returns as dictionary.
- Returns:
- A mapping of property labels to their detailed descriptors as
parsed from gphoto2 output.
- Return type:
- process_exposure(metadata, **kwargs)[source]¶
Convert the CR2 to FITS and pass to common processing.
- Parameters:
metadata (dict) – Header metadata saved for the image.
**kwargs – Forwarded to AbstractCamera.process_exposure.
- Returns:
None
- 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.
- set_property(prop: str, val: str | int, is_value: bool = False, is_index: bool = False)[source]¶
Set a property on the camera.
- classmethod start_tether(port, filename_pattern: str = '%Y%m%dT%H%M%S.%C')[source]¶
Start a gphoto2 tethering session for auto-download.
- property target_temperature¶
Target temperature for DSLR sensors (not applicable).
- Returns:
DSLRs controlled via gphoto2 generally lack regulated cooling.
- Return type:
None
- property temperature¶
Current sensor temperature if available (not typical for DSLRs).
- Returns:
gphoto2-controlled DSLRs generally do not report sensor temperature.
- Return type:
None
panoptes.pocs.camera.gphoto.canon module¶
Canon DSLR camera driver using gphoto2.
Provides a concrete Camera subclass for Canon EOS models controlled via gphoto2. Implements exposure sequencing, property setup, and a shutterspeed index helper compatible with the CLI-driven gphoto2 interface.
- class panoptes.pocs.camera.gphoto.canon.Camera(readout_time: float = 1.0, file_extension: str = 'cr2', setup_properties: bool = False, *args, **kwargs)[source]¶
Bases:
AbstractGPhotoCameraCanon EOS DSLR implementation using gphoto2.
Provides Canon-specific property defaults and exposure sequencing on top of AbstractGPhotoCamera.
- property bit_depth¶
ADC bit depth reported by the camera.
- Returns:
The analog-to-digital converter resolution in bits.
- Return type:
astropy.units.Quantity
- property egain¶
Estimated sensor gain (e-/ADU).
- Returns:
Electrons per ADU, used for photometric calibration.
- Return type:
astropy.units.Quantity
- classmethod get_shutterspeed_index(seconds: float, return_minimum: bool = False)[source]¶
Look up the gphoto2 shutterspeed index for a given exposure time.
- Parameters:
- Returns:
- The index expected by gphoto2 for the nearest matching shutter
speed. Returns 0 to indicate ‘bulb’ when no direct match is found, unless return_minimum is True and the time is below the minimum discrete setting.
- Return type:
panoptes.pocs.camera.gphoto.remote module¶
Remote gphoto2 camera wrapper.
Exposes a Camera subclass that delegates gphoto2 commands to a remote HTTP service (panoptes.pocs.utils.service.camera), enabling DSLR control on another host while keeping POCS orchestration local.
- class panoptes.pocs.camera.gphoto.remote.Camera(endpoint: AnyHttpUrl = 'http://localhost:6565', *args, **kwargs)[source]¶
Bases:
CameraA remote gphoto2 camera class.
- command(cmd, endpoint: AnyHttpUrl = None)[source]¶
Run a gphoto2 command on the remote camera service.