Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding agent for the Lightning Detector #640

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions docs/agents/ld_monitor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.. highlight:: rst

========================
Lightning Detector Agent
========================

The lightning detector agent communicates with the Lightning Detector System at
the site and parses the data to obtain approximate lightning strike distances
and standardized alarm levels.

.. argparse::
:module: socs.agents.ld_monitor.agent
:func: make_parser
:prog: agent.py

Configuration File Examples
---------------------------

Below are configuration examples for the ocs config file and for running the
Agent in a docker container.

OCS Site Config
````````````````

An example site-config-file block::

{'agent-class': 'LDMonitorAgent',
'instance-id': 'ld_monitor',
'arguments': [['--mode', 'acq']},

Docker Compose
``````````````

An example docker-compose configuration::

ocs-template:
image: simonsobs/socs:latest
hostname: ocs-docker
environment:
- LOGLEVEL=info
volumes:
- ${OCS_CONFIG_DIR}:/config

Description
-----------

The Lightning Detector System is connnected through serial communication with a
dedicated PC at the site, in which a propietary application calculates
approximate lightning strike distances and adjusts alarm levels accordingly.
Data is parsed and the most important parameters are updated. The dedicated PC
is continously running a script that streams the data via UDP to the client.

Transmitted Data
````````````````

The lightning detector transmits its data in "sentences". There are 5 types of
expected sentences:

* electric field
* lightning strike
* high-field
* status
* alarm timers

Electric field sentences report the electric field value measured by the
Electric Field Mill in kV/m. Strike sentences include lightning strike distance
and units (meters or miles) and is only transmitted if a strike is detected.
High field sentences report an alarm status with respect to set thresholds of
electric field. Status sentences include data such as alarms (red, orange,
yellow), remaining timers, all clear status, fault codes, among others. Alarm
timers sentences are disregarded, as its information is redundant. Each of the
sentences' data are parsed and published to the feed.

Agent API
---------

.. autoclass:: socs.agents.ld_monitor.agent.LDMonitorAgent
:members:

Supporting APIs
---------------

.. autoclass:: socs.agents.ld_monitor.agent.LDMonitor
:members:
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ API Reference Full API documentation for core parts of the SOCS library.
agents/lakeshore372
agents/lakeshore425
agents/latrt_xy_stage
agents/ld_monitor
agents/magpie
agents/meinberg_m1000_agent
agents/pfeiffer
Expand Down
Empty file.
Loading