if True:
    normalized = True

    files_withlabel = [
        r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/qpsk/leaf_4span_data_attenuation_=1.txt',
        r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/qpsk/leaf_4span_data_attenuation_=2.txt',
        r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/qpsk/leaf_4span_data_attenuation_=3.txt',
        r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/qpsk/leaf_4span_data_attenuation_=4.txt',
    ]
    ##

    #
    tmp = []
    for filename in files_withlabel:
        X, Y, labels = parse(filename,
                             startchannel=42,
                             endchannel=52,
                             label=True)
        if db_to_dec:
            X[X == 0] = -float('inf')
            X = 10**(X / 10)
        if target == 'Q':
            Y = BER2Q(Y)
        data = np.concatenate([X, Y, labels], axis=1)
        tmp.append(data)
#
#        for filename in files_nolabel:
#            X,Y,labels = parse(filename,startchannel=42,endchannel=52,label=None)
#            if db_to_dec:
#                X[X==0] = -float('inf')
#                X = 10**(X/10)
#            if target=='Q':
    #                      ]
    #    files_withlabel = [
    #             r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/16qam/leaf_4span_data_attenuation_=6.5.txt',
    #             r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/16qam/leaf_4span_data_attenuation_=7.txt',
    #             r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/16qam/leaf_4span_data_attenuation_=7.5.txt',
    #             r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/16qam/leaf_4span_data_attenuation_=8.txt',
    #             r'/home/onsi/wmo/forIntern/modules/NonlinearTestbed/data/leaf_4span/16qam/leaf_4span_data_attenuation_=8.5.txt',
    #            ]

    ###

    #
    tmp = []
    for filename in files_withlabel:
        X, OSNR, N, Y, labels = parse(filename,
                                      startchannel=42,
                                      endchannel=52,
                                      label=True)
        if db_to_dec:
            X[X == 0] = -float('inf')
            X = 10**(X / 10)
        if target == 'Q':
            Y = BER2Q(Y)
        if N.any():
            data = np.concatenate([X, Y, N], axis=1)
        else:
            data = np.concatenate([X, Y], axis=1)
        tmp.append(data)
#
#        for filename in files_nolabel:
#            X,Y,labels = parse(filename,startchannel=42,endchannel=52,label=None)
#            if db_to_dec: