===============================
hcam_devices
===============================
.. image:: https://img.shields.io/pypi/v/hcam_devices.svg
:target: https://pypi.python.org/pypi/hcam_devices
.. image:: https://img.shields.io/travis/StuartLittlefair/hcam_devices.svg
:target: https://travis-ci.org/StuartLittlefair/hcam_devices
.. image:: https://readthedocs.org/projects/hcam-devices/badge/?version=latest
:target: https://hcam-devices.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/StuartLittlefair/hcam_devices/shield.svg
:target: https://pyup.io/repos/github/StuartLittlefair/hcam_devices/
:alt: Updates
Hardware Communication for HiPERCAM
The HiPERCAM project necessitates communicating between numerous hardware components, distributed over
a network. ``hcam_devices`` provides a set of tools to allow devices on the network to run and communicate with each
other.
The architecture uses a central WAMP server (e.g. `crossbar <https://crossbar.io>`_) to handle communication
over websockets. Devices on the network publish telemetry regularly to the WAMP server, and any interested party
can subcribe to the telemetry topic to receive updates.
Devices can expose Remote Procedure Calls (RPCs) so that they may be controlled over the network, and also subscribe
to topics, so that settable attributes (e.g the temperature setpoint of a CCD) can be cpontrolled by publishing to those
topics.
Installation
------------
Install with the usual::
pip install .
or if you don't have root access::
pip install --user .
Usage
------
First of all, you will need a running WAMP server. I recommend `crossbar <https://crossbar.io>`_. A config file for a crossbar
instance is included with this package in the `data` directory. Once you have your WAMP server up and running, there are several
scripts that you can run.
hwserver
++++++++
This program runs the HiPERCAM peripheral hardware (e.g the CCD peltier controllers, focal plane slide, flow sensors etc).
Running this script will connect these devices to the WAMP server and allow monitoring and control
hwlogger
++++++++
So that the devices (especially the CCD heads) can be monitored off-site, this script subscribes to the CCD telemetry and saves
the hardware state to a persistent off-site `Influx <https://www.influxdata.com>`_ database. That database can be used with third
party tools like `grafana <https://grafana.com>`_ to enable neat dashboards for device monitoring.
hserver
++++++++
The NGC CCD controller is responsible for driving the CCDs, saving exposures etc. For maximum reliability and speed, this device
is connected to the WAMP server and controlled via it's own custom script, `hserver`.
gtcserver
+++++++++
Finally, the external GTC environment (Electronics racks, rotator, telescope offsets etc) are all connected to the WAMP server
using this script.
Control within python
+++++++++++++++++++++
Once these scripts are running, devices can be controlled in Python. This can be done using a WAMP library like `autobahn <https://autobahn.readthedocs.io/en/latest/>`_.
Alternatively, the WAMP server config included provides a simple HTTP interface that can be used as follows:
.. code-block:: python
from hcam_devices.wamp.utils import call, publish
# call RPCs
ngc_status = call('hipercam.NGC.rpc.summary')
call('hipercam.GTC.rpc.do_offset', raoff=0.05, decoff=0.001)
# publish to a topic
publish('hipercam.FocalPlaneSlide.target_position', -50)
Subscribing to device telemetry must be done using a WAMP library for now.
Optional package dependencies
-----------------------------
``hcam_devices`` supports several other tools, such as the finding chart tool ``hfinder`` and the
instrument control GUI ``hdriver``. Most users will need no extra modules installed. However,
If you want to be able to run ``hdriver``, *and* you want full communication with the telescope
whilst running at the GTC, you need to install the CORBA implementation ``omniORBpy``.
Full install instructions are found at the omniORB project `homepage <http://omniorb.sourceforge.net/>`_.
Be sure to install both omniORB and omniORBpy. Also, the omniORBpy module and the lib64 variant must
both be in the ``PYTHONPATH``. Finally, communicating with the GTC requires the installation of
Interface Definition Language (IDL) files, and the python modules compiled from them. Contact S. Littlefair
for these files, which must also be in the ``PYTHONPATH``.
* Free software: MIT license
=======
History
=======
0.1.0 (2020-06-05)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/HiPERCAM/hcam_devices",
"name": "hcam-devices",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "hcam_devices",
"author": "Stuart Littlefair",
"author_email": "s.littlefair@shef.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/bc/5e/74b1390491c1e7cd4ec34383fc0c38ef3294e693748d9d38ee139b21aed1/hcam_devices-1.5.0.tar.gz",
"platform": null,
"description": "===============================\nhcam_devices\n===============================\n\n\n.. image:: https://img.shields.io/pypi/v/hcam_devices.svg\n :target: https://pypi.python.org/pypi/hcam_devices\n\n.. image:: https://img.shields.io/travis/StuartLittlefair/hcam_devices.svg\n :target: https://travis-ci.org/StuartLittlefair/hcam_devices\n\n.. image:: https://readthedocs.org/projects/hcam-devices/badge/?version=latest\n :target: https://hcam-devices.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/StuartLittlefair/hcam_devices/shield.svg\n :target: https://pyup.io/repos/github/StuartLittlefair/hcam_devices/\n :alt: Updates\n\n\nHardware Communication for HiPERCAM\n\nThe HiPERCAM project necessitates communicating between numerous hardware components, distributed over\na network. ``hcam_devices`` provides a set of tools to allow devices on the network to run and communicate with each\nother.\n\nThe architecture uses a central WAMP server (e.g. `crossbar <https://crossbar.io>`_) to handle communication\nover websockets. Devices on the network publish telemetry regularly to the WAMP server, and any interested party\ncan subcribe to the telemetry topic to receive updates.\n\nDevices can expose Remote Procedure Calls (RPCs) so that they may be controlled over the network, and also subscribe\nto topics, so that settable attributes (e.g the temperature setpoint of a CCD) can be cpontrolled by publishing to those\ntopics.\n\nInstallation\n------------\n\nInstall with the usual::\n\n pip install .\n\nor if you don't have root access::\n\n pip install --user .\n\nUsage\n------\n\nFirst of all, you will need a running WAMP server. I recommend `crossbar <https://crossbar.io>`_. A config file for a crossbar\ninstance is included with this package in the `data` directory. Once you have your WAMP server up and running, there are several\nscripts that you can run.\n\nhwserver\n++++++++\n\nThis program runs the HiPERCAM peripheral hardware (e.g the CCD peltier controllers, focal plane slide, flow sensors etc).\nRunning this script will connect these devices to the WAMP server and allow monitoring and control\n\nhwlogger\n++++++++\n\nSo that the devices (especially the CCD heads) can be monitored off-site, this script subscribes to the CCD telemetry and saves\nthe hardware state to a persistent off-site `Influx <https://www.influxdata.com>`_ database. That database can be used with third\nparty tools like `grafana <https://grafana.com>`_ to enable neat dashboards for device monitoring.\n\nhserver\n++++++++\n\nThe NGC CCD controller is responsible for driving the CCDs, saving exposures etc. For maximum reliability and speed, this device\nis connected to the WAMP server and controlled via it's own custom script, `hserver`.\n\ngtcserver\n+++++++++\n\nFinally, the external GTC environment (Electronics racks, rotator, telescope offsets etc) are all connected to the WAMP server\nusing this script.\n\nControl within python\n+++++++++++++++++++++\n\nOnce these scripts are running, devices can be controlled in Python. This can be done using a WAMP library like `autobahn <https://autobahn.readthedocs.io/en/latest/>`_.\nAlternatively, the WAMP server config included provides a simple HTTP interface that can be used as follows:\n\n.. code-block:: python\n\n from hcam_devices.wamp.utils import call, publish\n\n # call RPCs\n ngc_status = call('hipercam.NGC.rpc.summary')\n call('hipercam.GTC.rpc.do_offset', raoff=0.05, decoff=0.001)\n\n #\u00a0publish to a topic\n publish('hipercam.FocalPlaneSlide.target_position', -50)\n\nSubscribing to device telemetry must be done using a WAMP library for now.\n\nOptional package dependencies\n-----------------------------\n\n``hcam_devices`` supports several other tools, such as the finding chart tool ``hfinder`` and the\ninstrument control GUI ``hdriver``. Most users will need no extra modules installed. However,\nIf you want to be able to run ``hdriver``, *and* you want full communication with the telescope\nwhilst running at the GTC, you need to install the CORBA implementation ``omniORBpy``.\n\nFull install instructions are found at the omniORB project `homepage <http://omniorb.sourceforge.net/>`_.\nBe sure to install both omniORB and omniORBpy. Also, the omniORBpy module and the lib64 variant must\nboth be in the ``PYTHONPATH``. Finally, communicating with the GTC requires the installation of\nInterface Definition Language (IDL) files, and the python modules compiled from them. Contact S. Littlefair\nfor these files, which must also be in the ``PYTHONPATH``.\n\n* Free software: MIT license\n\n\n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2020-06-05)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Device Communication via WAMP for HiPerCAM",
"version": "1.5.0",
"project_urls": {
"Download": "https://github.com/HiPERCAM/hcam_devices/archive/v1.5.0.tar.gz",
"Homepage": "https://github.com/HiPERCAM/hcam_devices"
},
"split_keywords": [
"hcam_devices"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "87cdeb3a69d83a4fef9868e4054be5465c98ab7ab6dbe707eb90462df5e1e875",
"md5": "ca06fc6436fb036e91f933fc6b5f040d",
"sha256": "026382624f36a6869d7ea271f0b6e3f2c34fb48145a458a1c885626834f78060"
},
"downloads": -1,
"filename": "hcam_devices-1.5.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca06fc6436fb036e91f933fc6b5f040d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 80593,
"upload_time": "2025-01-15T12:03:41",
"upload_time_iso_8601": "2025-01-15T12:03:41.729252Z",
"url": "https://files.pythonhosted.org/packages/87/cd/eb3a69d83a4fef9868e4054be5465c98ab7ab6dbe707eb90462df5e1e875/hcam_devices-1.5.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc5e74b1390491c1e7cd4ec34383fc0c38ef3294e693748d9d38ee139b21aed1",
"md5": "547f4a16cd335531d20cd45b2848c0b3",
"sha256": "1577f977ebf98505679ef978a63cee0e9eb9b301fc59562af5452b52dbc1d2dd"
},
"downloads": -1,
"filename": "hcam_devices-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "547f4a16cd335531d20cd45b2848c0b3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 65864,
"upload_time": "2025-01-15T12:03:44",
"upload_time_iso_8601": "2025-01-15T12:03:44.272727Z",
"url": "https://files.pythonhosted.org/packages/bc/5e/74b1390491c1e7cd4ec34383fc0c38ef3294e693748d9d38ee139b21aed1/hcam_devices-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 12:03:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HiPERCAM",
"github_project": "hcam_devices",
"github_not_found": true,
"lcname": "hcam-devices"
}