-
Notifications
You must be signed in to change notification settings - Fork 23
/
test_ldb.py
68 lines (41 loc) · 1.82 KB
/
test_ldb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
# should be done before importing pytimber
logging.basicConfig(level=logging.INFO)
import pytimber
ldb = pytimber.LoggingDB(source='ldb')
print('------------------------------------------------------------------------')
print(ldb.search('HX:BETA%'))
print('------------------------------------------------------------------------')
t1 = '2015-05-13 00:00:00.000'
t2 = '2015-05-15 00:00:00.000'
d = ldb.get('HX:FILLN', t1, t2)
print(d)
print('------------------------------------------------------------------------')
d = ldb.get('HX:FILLN', t1, t2, unixtime=False)
print(d)
print('------------------------------------------------------------------------')
t1 = '2015-05-13 12:00:00.000'
t2 = '2015-05-13 15:00:00.000'
d = ldb.get(ldb.search('HX:BETA%'), t1, t2, unixtime=True)
print(d)
print('------------------------------------------------------------------------')
t1 = '2015-05-13 12:00:00.000'
t2 = '2015-05-13 12:00:01.000'
d = ldb.get('LHC.BQBBQ.CONTINUOUS_HS.B1:ACQ_DATA_H', t1, t2)
print(d)
print('------------------------------------------------------------------------')
t1 = '2015-05-15 12:00:00.000'
t2 = '2015-05-15 15:00:00.000'
d = ldb.getScaled('MSC01.ZT8.107:COUNTS',t1,t2,scaleInterval='HOUR')
print(d)
print('------------------------------------------------------------------------')
print(dir(ldb.tree.LHC))
print('------------------------------------------------------------------------')
print(ldb.tree.LHC.Collimators.BPM.bpmColl._get_vars()[:10])
print('------------------------------------------------------------------------')
print(dir(ldb.tree.LHC.Collimators.BPM.bpmColl)[:10])
print('------------------------------------------------------------------------')
print(ldb.getUnit('%:LUMI_TOT_INST'))
print(ldb.getDescription('%:LUMI_TOT_INST'))