def chooseOthersymbol(data,rssi, pilot_step, metrics_command, argvList):
    other_data_alltrace = []
    for i in range(len(data)):
        other_data_paket = []
        for j in range(len(data[i])):
            if j % pilot_step == 0:
                continue
            other_data_element = mds.metric_management(metrics_command, argvList, rssi[i],j)
            # print '[pick%d-%d][rssi]:%s\n' % (i,j,rssi[i][j]),
            other_data_paket.append(other_data_element)
        other_data_alltrace.append(other_data_paket)
    # print 'other symol',len(other_data_alltrace[1])
    return other_data_alltrace
    pass
def choosePilot(data,rssi, pilot_step, metrics_command, argvList):
    Pilot_data_alltrace = []
    pilot_ser_alltrace = []
    random.seed(3)
    for pkgindex in range(len(data)):
        pilot_data_packet = []
        pilot_ser_packet = []
        for plindex in range(0, len(data[pkgindex]), pilot_step):
            if data[pkgindex][plindex] != '0':# if current symbol is wrong ,
                pilot_ser_packet.append(random.uniform(0.99,1)) # assume the pilot error has high confidence
            else:
                pilot_ser_packet.append(random.uniform(0,0.01)) # assume the pilot error has low confidence
            pilot_data_element = mds.metric_management(metrics_command, argvList, rssi[pkgindex], plindex)

            # print 'pilot_element-%s-%s' % (pkgindex, plindex), pilot_data_element

            pilot_data_packet.append(pilot_data_element)
        Pilot_data_alltrace.append(pilot_data_packet)
        pilot_ser_alltrace.append(pilot_ser_packet)
    # print 'pilot',len(pilot_ser_alltrace[1]),len(Pilot_data_alltrace[1])
    return [Pilot_data_alltrace, pilot_ser_alltrace]
    pass