Distributed sardana recorder
Project description
Sardana Streams
Sardana data streaming infrastucture. Comprises:
- redis based sardana scan recorder
- Client recorders:
- generic scan stream client (library)
- SPEC recorder daemon
- HDF5 recorder daemon
- Scan GUI
Installation
From within your favorite python environment:
$ pip install sardana-streams
Usage
The name acme used in the following examples represents a fictional corporation that features prominently in the Road Runner cartoons.
Configuration
Activate sardana redis recorder:
- Put the installation directory where the
sardana_streams/recorder
resides in RecorderPath tango property of the MacroServer. (ex:/usr/local/lib/python3.5/dist-packages/sardana_streams/recorder
) - From spock:
- activate the recorder with:
senv DataRecorder "['RedisRecorder']"
- configure the recorder with
senv RedisRecorder "{'host': 'acme.org', 'port': 7379, 'db': 1}"
(replacehost
,port
anddb
with your own)
- activate the recorder with:
The RedisRecorder
env can be a string or a dictionary identifying the Redis
database.
In case a string is given, it recognizes the same format url argument from redis.from_url().
In case a dict is given it recognizes the same keyword arguments as redis.from_url() plus:
TTL
: scan time to live in seconds (defaults to one week)key_prefix
: scan key prefix (defaults to<macro server name>:sardana:scan
)
Example
Here is a simple example of a client which simply listens to scan events and prints them on screen:
import contextlib
import redis
from sardana_streams.client import ScanStream
db = redis.from_url('redis://acme.org:7379/1')
prefix = "acme:sardana:scan"
stream = ScanStream(db, prefix)
with contextlib.closing(stream):
for event in stream:
print(event)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.