framel.frgetevent only reads events from the first frame in a file
The framel.frgetevent
function doesn't seem to read the FrEvent
structures as advertised, only reading from the first Frame
in the file.
For the data/test.gwf
file in the Fr project, FrDump
shows 30 events total:
$ FrDump -i data/test.gwf -d 2
-----------Parameters used--------------
Input Files: data/test.gwf
First frame : 0 0 (GPS=0.0)
Last frame : 2147483647 2147483647 (GPS=2147483647.0)
Debug level : 2
Dump all Frame info
----------------------------------------
data/test.gwf 925484675 10 925484675 925484684.509000
Frame time range: 925484675.000000 to 925484685.000000
Event time range: 925484675.000000 to 925484684.509000
For file: data/test.gwf
Dump file TOC: 10 Frames; ULeaps=34
First frame GPS=925484675 (UTC:Mon May 4 15:04:20 2009) (t0)
Last frame GPS=925484684 (UTC:Mon May 4 15:04:29 2009)
run# frame# t-t0(s) dataQuality position firstADC first ser f. table size(B)
0 0 0 0 0 40 4543 14835 15355 31063
1 0 1 1 0 31103 31458 40970 41049 21318
2 0 2 2 0 52421 52776 62302 62381 21332
3 0 3 3 0 73753 74108 83630 83709 21328
4 0 4 4 0 95081 95436 104940 105019 21310
.... ....
8 0 8 8 0 180409 180764 190278 190357 21320
9 0 9 9 0 201729 202084 211616 211695 24500
Maximum frame size: 31063 bytes at GPS=925484675.000
Detector:demo position=1309 localTime:99999 s.
Number of static data blocks: 2
For Static Data:gain detector:demo 1 instances
TStart TEnd version position
925484675 925484695 0 3557
For Static Data:filter detector:demo 1 instances
TStart TEnd version position
925484675 999999999 0 2163
Channel list for ADC:
(channel=0 group=0) Adc0: in 10 frames
(channel=0 group=0) Adc1: in 10 frames
(channel=0 group=0) Adc2: in 10 frames
(channel=0 group=0) Adc3: in 10 frames
(channel=0 group=0) Bad_data_(data[0]=nan): in 10 frames
(channel=0 group=0) D1: in 10 frames
(channel=0 group=0) fastAdc0: in 10 frames
(channel=0 group=0) fastAdc1: in 10 frames
Channel list for proc:
fastProc in 10 frames
Channel list for sim:
sim1 in 10 frames
Channel list for ser:
sms1 in 10 frames
Channel list for summary:
Quality_1 in 10 frames
Quality_2 in 10 frames
FrEvent:
Burst_1: 10 event(s):
0 GPS: 925484675.2000 UTC: Mon May 4 15:04:20 2009 amplitude: 2e-20 pos: 29240
1 GPS: 925484675.2000 UTC: Mon May 4 15:04:20 2009 amplitude: 2e-20 pos: 51943
2 GPS: 925484675.2000 UTC: Mon May 4 15:04:20 2009 amplitude: 2e-20 pos: 73275
3 GPS: 925484675.2000 UTC: Mon May 4 15:04:20 2009 amplitude: 2e-20 pos: 94603
4 GPS: 925484675.2000 UTC: Mon May 4 15:04:20 2009 amplitude: 2e-20 pos: 115913
....
trigger_1: 20 event(s):
0 GPS: 925484675.5000 UTC: Mon May 4 15:04:20 2009 amplitude: 1.1e-20 pos: 28101
1 GPS: 925484675.5000 UTC: Mon May 4 15:04:20 2009 amplitude: 2.2e-20 pos: 29102
2 GPS: 925484676.5010 UTC: Mon May 4 15:04:21 2009 amplitude: 1.21e-20 pos: 51647
3 GPS: 925484676.5010 UTC: Mon May 4 15:04:21 2009 amplitude: 2.42e-20 pos: 51805
4 GPS: 925484677.5020 UTC: Mon May 4 15:04:22 2009 amplitude: 1.331e-20 pos: 72979
....
FrSimEvent:
Sim_Inspiral: 10 event(s):
0 GPS: 925484675.0000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 30153
1 GPS: 925484676.0060 UTC: Mon May 4 15:04:21 2009 amplitude: 1e-21 pos: 52141
2 GPS: 925484677.0120 UTC: Mon May 4 15:04:22 2009 amplitude: 1e-21 pos: 73473
3 GPS: 925484678.0180 UTC: Mon May 4 15:04:23 2009 amplitude: 1e-21 pos: 94801
4 GPS: 925484679.0240 UTC: Mon May 4 15:04:24 2009 amplitude: 1e-21 pos: 116111
....
Sim_Inspiral_2: 10 event(s):
0 GPS: 925484675.4000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 29357
1 GPS: 925484675.4000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 52060
2 GPS: 925484675.4000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 73392
3 GPS: 925484675.4000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 94720
4 GPS: 925484675.4000 UTC: Mon May 4 15:04:20 2009 amplitude: 1e-21 pos: 116030
....
However, framel.frgetevent()
only seems to read events from the first Framel
in the file:
$ python3 -c "import framel, pprint; events = framel.frgetevent('data/test.gwf', verbose=0); pprint.pprint(events)"
[{'<ctypes.LP_c_char object at 0x7f053c0e1520>': 2.3,
'<ctypes.LP_c_char object at 0x7f053c0e15b0>': 1.3,
'<ctypes.LP_c_char object at 0x7f053c0e1640>': 1.4,
'GTimeN': 500000000,
'GTimeS': 925484675,
'amplitude': 1.0999999650920748e-20,
'comment': 'Binary search',
'eventStatus': 0,
'inputs': 'V0:Pr_B1_ACq',
'name': 'trigger_1',
'probability': 0.009999999776482582,
'statistics': '',
'timeAfter': 0.20000000298023224,
'timeBefore': 1.0},
{'<ctypes.LP_c_char object at 0x7f053c0e16d0>': 0.123,
'<ctypes.LP_c_char object at 0x7f053c0e1760>': 234.0,
'GTimeN': 500000000,
'GTimeS': 925484675,
'amplitude': 2.1999999301841496e-20,
'comment': 'Binary search',
'eventStatus': 0,
'inputs': 'V0:Pr_B1_ACq',
'name': 'trigger_1',
'probability': 0.009999999776482582,
'statistics': '',
'timeAfter': 0.20000000298023224,
'timeBefore': 1.0},
{'GTimeN': 200000047,
'GTimeS': 925484675,
'amplitude': 1.999999936531045e-20,
'comment': 'Burst algorithm 1234',
'eventStatus': 0,
'inputs': 'V0:Pr_B1_ACp',
'name': 'Burst_1',
'probability': 0.019999999552965164,
'statistics': '',
'timeAfter': 0.30000001192092896,
'timeBefore': 5.0}]
Edited by Duncan Macleod