DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
rawdatautils
scripts
print_values_for_file_transfer_metadata.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
from
datetime
import
datetime
4
from
hdf5libs
import
HDF5RawDataFile
5
6
import
click
7
import
time
8
9
@click.command()
10
@click.argument('filename', type=click.Path(exists=True)
)
11
12
def
main
(filename):
13
14
h5_file =
HDF5RawDataFile
(filename)
15
file_layout_version = h5_file.get_version()
16
#print(f'file_layout_verion {file_layout_version}')
17
18
attr_name =
"creation_timestamp"
19
if
file_layout_version >= 6:
20
attr_value = h5_file.get_int_attribute(attr_name)
21
print(f
'{attr_name} {attr_value}'
)
22
else
:
23
attr_value = h5_file.get_attribute(attr_name)
24
print(f
'{attr_name} {attr_value}'
)
25
26
attr_name =
"closing_timestamp"
27
if
file_layout_version >= 6:
28
attr_value = h5_file.get_int_attribute(attr_name)
29
print(f
'{attr_name} {attr_value}'
)
30
else
:
31
attr_value = h5_file.get_attribute(attr_name)
32
print(f
'{attr_name} {attr_value}'
)
33
34
attr_name =
"offline_data_stream"
35
try
:
36
attr_value = h5_file.get_attribute(attr_name)
37
except
RuntimeError:
38
attr_value =
"cosmics"
39
print(f
'{attr_name} {attr_value}'
)
40
41
attr_name =
"run_was_for_test_purposes"
42
try
:
43
attr_value = h5_file.get_attribute(attr_name)
44
except
RuntimeError:
45
attr_value =
"false"
46
print(f
'{attr_name} {attr_value}'
)
47
48
attr_name =
"file_recovery_timestamp"
49
try
:
50
attr_value = h5_file.get_int_attribute(attr_name)
51
print(f
'{attr_name} {attr_value}'
)
52
except
RuntimeError:
53
pass
54
55
records = h5_file.get_all_record_ids()
56
57
print(
'=== start of record list'
)
58
for
r
in
records:
59
print(f
'{r[0]}.{r[1]}'
)
60
print(
'=== end of record list'
)
61
62
if
__name__ ==
'__main__'
:
63
main
()
hdf5libs.HDF5RawDataFile
Definition
__init__.py:7
print_values_for_file_transfer_metadata.main
main(filename)
Definition
print_values_for_file_transfer_metadata.py:12
Generated on
for DUNE-DAQ by
1.17.0