This repository was archived by the owner on Mar 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkind_of_data.py
More file actions
executable file
·53 lines (35 loc) · 1.41 KB
/
kind_of_data.py
File metadata and controls
executable file
·53 lines (35 loc) · 1.41 KB
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
import tables
from get_station_ID_from_filename import get_station_ID_from_filename
def kind_of_data(list_file_names):
""" Find out what kind of data is in a downloaded data file
'list_file_names' is simply a list of filename strings
"""
shower_data_present_in_table = []
weather_data_present_in_table = []
for i in list_file_names:
user_hisparc_station_id = get_station_ID_from_filename(i)
data = tables.openFile(i, 'r')
group = 'data.root.s%s' % user_hisparc_station_id
if 'events' in eval(group):
shower_data_present_in_table.append(True)
else:
shower_data_present_in_table.append(False)
if 'weather' in eval(group):
weather_data_present_in_table.append(True)
else:
weather_data_present_in_table.append(False)
data.close()
kind_of_data_in_table = zip(list_file_names, shower_data_present_in_table, weather_data_present_in_table)
return kind_of_data_in_table
"""
list1 = ['data_s502_2011,6,30 - 2011,6,30.h5','data_s502_2011,7,1 - 2011,7,31.h5','data_s502_2011,8,1 - 2011,8,3.h5']
ID1 = '502'
list2 = ['data_s501_2011,6,30 - 2011,6,30.h5','data_s501_2011,7,1 - 2011,7,31.h5','data_s501_2011,8,1 - 2011,8,3.h5']
ID2 = '501'
table1 = kind_of_data(list1, ID1)
table1.extend(kind_of_data(list2, ID2))
print table1
dat = open('hallo.py', 'w')
for i in table1:
dat.write(str(i))
"""