Skip to main content

Device Communication via WAMP for HiPerCAM

Project description

hcam_devices

https://img.shields.io/pypi/v/hcam_devices.svg https://img.shields.io/travis/StuartLittlefair/hcam_devices.svg Documentation Status 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) 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. 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 database. That database can be used with third party tools like grafana 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. Alternatively, the WAMP server config included provides a simple HTTP interface that can be used as follows:

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. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hcam_devices-0.1.0.tar.gz (261.3 kB view details)

Uploaded Source

Built Distribution

hcam_devices-0.1.0-py2.py3-none-any.whl (272.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file hcam_devices-0.1.0.tar.gz.

File metadata

  • Download URL: hcam_devices-0.1.0.tar.gz
  • Upload date:
  • Size: 261.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for hcam_devices-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7aa917e6013a2c54c2fcab93c6b559a448c70f85403564ac51d7a56b320387ae
MD5 6a35f609c457caf8f1bf77210ec8791d
BLAKE2b-256 b57cdca1f62754ab1eb1017144b1315498084fd5d0348ad25c5f48d25d6c6e51

See more details on using hashes here.

File details

Details for the file hcam_devices-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for hcam_devices-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bdf4265321531232d05537d59e6cd97a88c10d1dcd1f583163643e580d7e447d
MD5 f1f329fe9a7a47a5bfedb82a25fed345
BLAKE2b-256 d5bde14c1e4472a57912b532efb04b19105c19addeb3295ab05ddc9b7c75248b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page