-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
3d8f152
commit cbc41cf
Showing
4 changed files
with
513 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.