|
|
|
@ -73,20 +73,31 @@ def middleman(ls, rs):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
|
header = [ |
|
|
|
|
'lo_id', '', |
|
|
|
|
] + ['' for i in xrange(0, 19)] |
|
|
|
|
header = ['LO_xxx', '____', ] |
|
|
|
|
for m in MODEL_LIST: |
|
|
|
|
l_list, lo_data = get_test_data(m) |
|
|
|
|
m_header = header[:] |
|
|
|
|
m_header[1] = m |
|
|
|
|
for i in '1234': |
|
|
|
|
m_header = header[:] |
|
|
|
|
m_header[1] = m |
|
|
|
|
ros = get_ro_data(m, i) |
|
|
|
|
for r in ros: |
|
|
|
|
m_header.append(r[0]) |
|
|
|
|
result = middleman(lo_data, ros) |
|
|
|
|
output_name = '%s-%s.csv' % (m, i) |
|
|
|
|
result = [m_header] + result |
|
|
|
|
|
|
|
|
|
# process header -- get ind of first R_xxx |
|
|
|
|
number_ind = 0 |
|
|
|
|
cnt_ind = 0 |
|
|
|
|
for i in result[0]: |
|
|
|
|
try: |
|
|
|
|
float(i) |
|
|
|
|
number_ind = cnt_ind |
|
|
|
|
cnt_ind = 0 |
|
|
|
|
break |
|
|
|
|
except ValueError: |
|
|
|
|
cnt_ind += 1 |
|
|
|
|
__h = m_header[:2] + ['_' for i in xrange(0, number_ind-2)] + m_header[3:] |
|
|
|
|
result = [__h] + result |
|
|
|
|
create_csv(output_name, result, directory='part8') |
|
|
|
|
|
|
|
|
|
main() |
|
|
|
|