Skip to main content

Observatory Control System

Project description

PyPI Package PyPI - Python Version docker PyPI - License
GitHub Workflow Status pre-commit.ci status coverage Documentation Status

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

  • so3g - Required for using the HK Aggregator Agent.

  • crossbar (optional) - The supported WAMP router. Controllable via ocsbow. Can be installed with pip or run via Docker.

Installation

Install and update with pip:

$ pip3 install -U ocs

If you need to install the optional so3g module you can do so via:

$ pip3 install -U ocs[so3g]

Installing from Source

If you are considering contributing to OCS, or would like to use an unreleased feature, you will want to install from source. To do so, clone this repository and install using pip:

$ git clone https://github.com/simonsobs/ocs.git
$ cd ocs/
$ pip3 install -r requirements.txt
$ pip3 install .

Note: If you want to install locally, not globally, throw the –user flag on the pip3 commands.

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.

Test images will be tagged with the latest released version tag, the number of commits ahead of that release, the latest commit hash, i.e. v0.6.0-53-g0e390f6. These get built on each commit to the main branch, and are useful for testing and development, but should be considered unstable.

Documentation

The OCS documentation can be built using Sphinx. There is a separate requirements.txt file in the docs/ directory to install Sphinx and any additional documentation dependencies:

$ cd docs/
$ pip3 install -r requirements.txt
$ 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

Note: The integration tests require Docker and Docker Compose to run. Ensure those are installed and the user running the tests is in the docker group.

The first step is to build the Docker images required by the integration tests:

$ docker compose build

Then the tests for OCS can be run using pytest, and should be run from the tests/ directory:

$ cd tests/
$ python3 -m pytest

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


Download files

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

Source Distribution

ocs-0.12.1.tar.gz (112.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocs-0.12.1-py3-none-any.whl (133.3 kB view details)

Uploaded Python 3

File details

Details for the file ocs-0.12.1.tar.gz.

File metadata

  • Download URL: ocs-0.12.1.tar.gz
  • Upload date:
  • Size: 112.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ocs-0.12.1.tar.gz
Algorithm Hash digest
SHA256 8ec7df3c1f0f7e44e3c92f8449359552afda7aac5666dd7bb8b54dd027f59ee8
MD5 577883fd23caa8a653f2b846c05653e7
BLAKE2b-256 e4edfe3dd1f1b3e34a13bd3b18b5b1f6486b093e0f5fdcda99f6c80475452fcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocs-0.12.1.tar.gz:

Publisher: deploy.yml on simonsobs/ocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ocs-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: ocs-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 133.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ocs-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4809a4fded909c45842fc19cf3561496b4ca5b302c7e602a0ceb7c12cabec83c
MD5 355f3cdefa9f0bdfa669428d6c55d279
BLAKE2b-256 71d18874e5143e5f16c4d903857557ec29135c6e91e8b4f9ad946ec31040c73e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocs-0.12.1-py3-none-any.whl:

Publisher: deploy.yml on simonsobs/ocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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