Running and Using the Recorders¶
Command Line Signatures¶
dr_visibilities.py¶
Failed to extract help message
dr_manager_visibilities.py¶
Failed to extract help message
dr_beam.py¶
Failed to extract help message
dr_tengine.py¶
Failed to extract help message
Systemd User Services¶
The various data recorder pipelines can be launched as systemd user services. The included utils/generate_services.py helps with defining these services:
- usage: generate_services.py [-h] [–config CONFIG] [-p ANACONDA_PATH]
[-e CONDA_ENV] [-b | -s | -f | -t | -a] [-c]
generate systemd service files for the data recorder pipelines
- options:
- -h, --help
show this help message and exit
- --config CONFIG
JSON file that specifies the data recorder mappings (default: service_config.json)
- -p ANACONDA_PATH, --anaconda-path ANACONDA_PATH
root path to anaconda install to use (default: /opt/miniconda3)
- -e CONDA_ENV, --conda-env CONDA_ENV
anaconda enviroment name to use (default: datarecorder)
- -b, --power-beams
only generate/clean the power beam services (default: False)
- -s, --slow-visibilities
only generate/clean the slow visibitlies services (default: False)
- -f, --fast-visibilities
only generate/clean the fast visibilities services (default: False)
- -t, --t-engines
only generate/clean the T-engine services (default: False)
- -a, --all
generate/clean all services (default: True)
- -c, --clean
delete the generated services (default: False)
These services are configured for the lwacalim cluster to be run under the pipeline user by default.
Interacting with the Pipelines¶
You can read monitoring points or send a command to a pipeline with the mnc.mcs module:
>>> from mnc.mcs import Client
>>>
>>> # Create an anonymous client to talk to various subsystems
>>> c = Client()
>>>
>>> # Read the "bifrost/pipeline_lag" monitor point from the first power
>>> # beam (dr1)
>>> lag = c.read_monitor_point('bifrost/pipeline_lag', 'dr1')
>>> print(lag)
6.689624s at 2021-06-02 14:37:06.760481
>>>
>>> # Read a monitor point that does not exist
>>> lag = c.read_monitor_point('bifrost/pipeline_', 'dr1')
>>> print(lag)
None
>>>
>>> # Send a "ping" command to the first power beam
>>> response = c.send_command('dr1', 'ping')
>>> print(response)
(True, {'sequence_id': '12a3606ac3b011eb9eb410bf48e38102',
'timestamp': 1622644655.9322925, 'status': 'success',
'response': 'pong'})
>>>
>>> # Send a "ping" command to a subsystem that does not exist
>>> response = c.send_command('a_cat', 'ping')
>>> print(response)
(False, '5d42c5acc3b011eb9eb410bf48e38102')
>>>
>>> # Send a command "record" command to the first power beam
>>> from mnc.common import LWATime
>>> t_now = LWATime.now()
>>> mjd_now = int(t_now.mjd)
>>> mpm_now = int((t_now.mjd - mjd_now)*86400.0*1000.0)
>>> response = c.send_command('dr1', 'record',
start_mjd=mjd_now,
start_mpm=mpm_now,
duration_ms=30*1000)
>>> print(response)
(True, {'sequence_id': '76c6013ec3b411eb9eb410bf48e38102',
'timestamp': 1622646541.9380054, 'status': 'success',
'response': {'filename': '/home/jdowell/CodeSafe/ovro_data_recorder/059367_76c6013ec3b411eb9eb410bf48e38102'}})