...
Note |
---|
title | How to properly use the EPICS store |
---|
|
It's important to understand that the contents of the store is relevant to the most recent event obtained from a data set. This means that: - the store will be empty contain the configuration pv's after a data set has been just open opened and no single event has been fetched from it
- the contents of the store will change from one event to the other one
Therefore it's up to a user code to implement a correct logic for fetching events and EPICS variables to ensure that they're properly synchronized. |
...
Code Block |
---|
|
ds = DataSource(dsname)
epics = ds.env().epicsStore()
prev_val = None
for i, evt in enumerate(ds.events()):
val = epics.value('LAS:FS0:ACOU:amp_rf1_17_2:rd')
if val != prev_val:
print "%6d:" % i, val
prev_val = val
0: 2016
725: 2024
845: 2019
966: 2014
1932: 2021
2053: 2020
2174: 2016
3381: 2020
3502: 2024
4830: 2018
6279: 2019
6400: 2018
7728: 2023
7849: 2019
9177: 2016
10626: 2021
10747: 2022
12075: 2016
13524: 2020
..
|
Configuration pv's refer to EPIC's ctrl headers. These are not often used for analysis and all EPICS pv's should be replaced by event data after the first event is fetched. However we have seen a few cases where a ctrl pv was not replaced immediately. These issues have been resolved for future runs, but to be careful, one could rewrite the main loop as follows:
Code Block |
---|
|
for i, evt in enumerate(ds.events()):
pv = epics.getPV('LAS:FS0:ACOU:amp_rf1_17_2:rd')
if pv.isCtrl():
print "warning: pv is still ctrl as of event %d, may be known or new bug" % i
continue
val = pv.value(0) |
Services
The Histogram Manager is the only public (user-level) service which is implemented in the current version of the framework. A reference to the manager can be obtain using:
...
Info |
---|
title | Where can I find a list of existing *psana* modules? |
---|
|
There are two documents which you may want to explore: |
...