Line 18... |
Line 18... |
18 |
sys.exit(1) |
18 |
sys.exit(1) |
19 |
|
19 |
|
20 |
value = parser.parse_file(sys.argv[1]) |
20 |
value = parser.parse_file(sys.argv[1]) |
21 |
dataSource = value['data_path'] |
21 |
dataSource = value['data_path'] |
22 |
dataArchive = value['data_archive'] |
22 |
dataArchive = value['data_archive'] |
- |
|
23 |
dataUpload = value['data_upload'] |
- |
|
24 |
stationName = value['origin'] |
- |
|
25 |
|
23 |
loop = 1 |
26 |
loop = 1 |
24 |
|
27 |
|
25 |
|
28 |
|
26 |
while True: |
29 |
while True: |
27 |
try: |
30 |
try: |
Line 62... |
Line 65... |
62 |
values=pd.DataFrame() # empty DataFrame |
65 |
values=pd.DataFrame() # empty DataFrame |
63 |
|
66 |
|
64 |
for x in range(0,columnsInd): # for each column |
67 |
for x in range(0,columnsInd): # for each column |
65 |
values = values.set_value(0,x,round(df[x].mean(),3),0) #calculates mean value for all cloumns and round it by 3 |
68 |
values = values.set_value(0,x,round(df[x].mean(),3),0) #calculates mean value for all cloumns and round it by 3 |
66 |
|
69 |
|
67 |
filename = first[:8]+'000000_VRTY-S1_data_mean.csv' |
70 |
filename = dataUpload + first[:8]+'000000_' + stationName + '_data_mean.csv' |
68 |
outfile = open(filename, 'a') |
71 |
outfile = open(filename, 'a') |
69 |
values.to_csv(filename, sep=';', header=None, index=False, mode='a') # save (add) DataFrame to csv |
72 |
values.to_csv(filename, sep=';', header=None, index=False, mode='a') # save (add) DataFrame to csv |
70 |
outfile.close() |
73 |
outfile.close() |
71 |
|
74 |
|
72 |
# move files to archive structure |
75 |
# move files to archive structure |