Skip to content

Add a typed facade for the tracking camera over the camera_interface module - #207

Merged
mikelangmayr merged 4 commits into
mainfrom
mike/tracking-camera-facade
Sep 15, 2026
Merged

mikelangmayr merged 4 commits into
mainfrom
mike/tracking-camera-facade

Conversation

@mikelangmayr

Copy link
Copy Markdown
Contributor
  • camera_interface exposes instrument commands as instrument_cmd(name, argument_string), so every caller would otherwise build the same argument strings by hand; TrackingCamera gives them real signatures and puts the formatting in one place
  • set_guiding_roi(y0, y1, x0, x1), set_centred_roi(height, width), set_readmode(ReadMode.RX), set_window(bool), set_autofetch(bool), set_freerun(bool), and initialize() for the open, load, power on, h2rg_init sequence
  • geometry() returns a Geometry dataclass with height and width rather than a string to parse, and ReadMode is an enum so a bad mode raises ValueError before anything is sent
  • anything not defined here forwards to the underlying camera_interface.Camera, so base commands like expose and exptime are reached directly without re-wrapping all 22
  • pure Python over the existing bindings, so nothing in camerad changes and no camera behaviour is at risk
  • 9 unit tests run against a fake camera, needing neither the compiled extension nor hardware; also exercised end to end against the Archon emulator, including a guiding ROI reading back as 10x10 and an exposure writing FITS
  • driver README covers the one unusual prerequisite, that camera_interface is a compiled extension rather than a PyPI package


```bash
cd camera-interface/build
pip install pybind11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the toml to install this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No: pybind11 is only needed to compile camera_interface, not to import it (the built .so links cfitsio, CCfits and OpenCV but not pybind11), so it is camera-interface's build dependency rather than one of ours, and camera_interface itself cannot go in the toml either since it is a compiled extension built per instrument rather than a package on an index. The real fix is to package camera-interface with scikit-build-core so pip install ./camera-interface --config-settings=cmake.define.INSTRUMENT=... pulls pybind11 into an isolated build env and installs the module into the venv, which deletes this instruction instead of explaining it; that is planned as a separate piece of work. README now says build-only.

@mikelangmayr
mikelangmayr force-pushed the mike/tracking-camera-facade branch from 9512aa7 to 530e0be Compare September 15, 2026 21:24
@mikelangmayr
mikelangmayr merged commit af079ef into main Sep 15, 2026
4 checks passed
@mikelangmayr
mikelangmayr deleted the mike/tracking-camera-facade branch September 15, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants