Update README.md

This commit is contained in:
2021-09-08 12:30:54 +00:00
parent f8cd002cb0
commit 36b14b470c

View File

@ -2,3 +2,48 @@
Online analysis via bsread Online analysis via bsread
## Examples
### Creating channels
```python
from bstrd import BS, bsstream
pid = BS("pid")
trace = BS("SATES21-GES1:A1_VALUES")
```
with optional `modulo` and `offset`
```python
inten = BS("SATFE10-PEPG046:FCUP-INTENSITY-CAL", modulo=10, offset=1)
```
### Receiving data
Read from channel:
```python
for _ in bsstream:
val = trace.value
print(val)
```
Read from data dict:
```python
for data in bsstream:
val = data["SATES21-GES1:A1_VALUES"]
print(val)
```
Iterate a single channel:
```python
for val in trace:
print(val)
```