Skip to content

Commit cbc41cf

Browse files
felipecarreropre-commit-ci[bot]BrianJKoopman
authored
Add agent for the Lightning Detector (#640)
* Adding agent for the Lightning Detector * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed unused yaml library from code * replaced match function to comply with python3.8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added modifications suggested by Brian Koopman * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * another set of minor corrections after BK's review * final changes after PR review * removed unused docstrings * Function name modifications on agent, added .rst * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move rst file into docs directory * Add docs page to index * Fix build warnings and format docs * fixed bug when reading lightning strike sentences --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Brian Koopman <brian.koopman@yale.edu>
1 parent 3d8f152 commit cbc41cf

File tree

4 files changed

+513
-0
lines changed

4 files changed

+513
-0
lines changed

docs/agents/ld_monitor.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.. highlight:: rst
2+
3+
========================
4+
Lightning Detector Agent
5+
========================
6+
7+
The lightning detector agent communicates with the Lightning Detector System at
8+
the site and parses the data to obtain approximate lightning strike distances
9+
and standardized alarm levels.
10+
11+
.. argparse::
12+
:module: socs.agents.ld_monitor.agent
13+
:func: make_parser
14+
:prog: agent.py
15+
16+
Configuration File Examples
17+
---------------------------
18+
19+
Below are configuration examples for the ocs config file and for running the
20+
Agent in a docker container.
21+
22+
OCS Site Config
23+
````````````````
24+
25+
An example site-config-file block::
26+
27+
{'agent-class': 'LDMonitorAgent',
28+
'instance-id': 'ld_monitor',
29+
'arguments': [['--mode', 'acq']},
30+
31+
Docker Compose
32+
``````````````
33+
34+
An example docker-compose configuration::
35+
36+
ocs-template:
37+
image: simonsobs/socs:latest
38+
hostname: ocs-docker
39+
environment:
40+
- LOGLEVEL=info
41+
volumes:
42+
- ${OCS_CONFIG_DIR}:/config
43+
44+
Description
45+
-----------
46+
47+
The Lightning Detector System is connnected through serial communication with a
48+
dedicated PC at the site, in which a propietary application calculates
49+
approximate lightning strike distances and adjusts alarm levels accordingly.
50+
Data is parsed and the most important parameters are updated. The dedicated PC
51+
is continously running a script that streams the data via UDP to the client.
52+
53+
Transmitted Data
54+
````````````````
55+
56+
The lightning detector transmits its data in "sentences". There are 5 types of
57+
expected sentences:
58+
59+
* electric field
60+
* lightning strike
61+
* high-field
62+
* status
63+
* alarm timers
64+
65+
Electric field sentences report the electric field value measured by the
66+
Electric Field Mill in kV/m. Strike sentences include lightning strike distance
67+
and units (meters or miles) and is only transmitted if a strike is detected.
68+
High field sentences report an alarm status with respect to set thresholds of
69+
electric field. Status sentences include data such as alarms (red, orange,
70+
yellow), remaining timers, all clear status, fault codes, among others. Alarm
71+
timers sentences are disregarded, as its information is redundant. Each of the
72+
sentences' data are parsed and published to the feed.
73+
74+
Agent API
75+
---------
76+
77+
.. autoclass:: socs.agents.ld_monitor.agent.LDMonitorAgent
78+
:members:
79+
80+
Supporting APIs
81+
---------------
82+
83+
.. autoclass:: socs.agents.ld_monitor.agent.LDMonitor
84+
:members:

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ API Reference Full API documentation for core parts of the SOCS library.
6262
agents/lakeshore372
6363
agents/lakeshore425
6464
agents/latrt_xy_stage
65+
agents/ld_monitor
6566
agents/magpie
6667
agents/meinberg_m1000_agent
6768
agents/meinberg_syncbox_agent

socs/agents/ld_monitor/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)