Observatory Control System
Project description
Overview
The OCS makes it easy to coordinate hardware operation and I/O tasks in a distributed system such as an astronomical observatory or test laboratory. OCS relies on the use of a central WAMP router (currently crossbar.io) for coordinating the communication and control of these distributed systems.
The OCS provides Python (and JavaScript) functions and classes to allow “Clients” to talk to “Agents”. An Agent is a software program that knows how to do something interesting and useful, such as acquire data from some device or perform cleanup operations on a particular file system. A Control Client could be a web page with control buttons and log windows, or a script written by a user to perform a series of unattended, interlocking data acquisition tasks.
This repository, OCS, contains library code and core system components. Additional code for operating specific hardware can be found in the Simons Observatory Control System (SOCS) repository. Grafana and InfluxDB are supported to provide a near real-time monitoring and historical look back of the housekeeping data.
Dependencies
This code targets Python 3.6+.
There are also several Python package dependencies, which are listed in the requirements.txt file.
Installation
Clone this repository and install using pip:
$ git clone https://github.com/simonsobs/ocs.git $ cd ocs/ $ pip3 install -r requirements.txt $ python3 setup.py install
Note: If you want to install locally, not globally, throw the –user flag on both the pip3 and setup.py commands.
Warning: The master branch is not guaranteed to be stable, you might want to checkout a particular version tag before installation depending on which other software you are working with. See the latest tags.
Docker Images
Docker images for OCS and each Agent are available on Docker Hub. Official releases will be tagged with their release version, i.e. v0.1.0. These are only built on release, and the latest tag will point to the latest of these released tags. These should be considered stable.
Development images will be tagged with the latest released version tag, the number of commits ahead of that release, the latest commit hash, and the tag -dev, i.e. v0.6.0-53-g0e390f6-dev. These get built on each commit to the develop branch, and are useful for testing and development, but should be considered unstable.
Documentation
The OCS documentation can be built using sphinx once you have performed the installation:
$ cd docs/ $ make html
You can then open docs/_build/html/index.html in your preferred web browser. You can also find a copy hosted on Read the Docs.
Tests
The tests for OCS can be run using pytest, and should be run from the tests/ directory:
$ cd tests/ $ python3 -m pytest
To run the tests within a Docker container (useful if your local environment is missing some dependencies), first make sure you build the latest ocs image, then use docker run:
$ docker build -t ocs . $ docker run --rm ocs sh -c "python3 -m pytest -p no:wampy -m 'not integtest' ./tests/"
For more details see tests/README.rst.
Example
A self contained example, demonstrating the operation of a small observatory with a single OCS Agent is contained in example/miniobs/. See the readme in that directory for details.
Contributing
For guidelines on how to contribute to OCS see CONTRIBUTING.rst.
License
This project is licensed under the BSD 2-Clause License - see the LICENSE.txt file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.