def main():
    file = "comTraj.npz"
    L, com_lipids, com_chol = trajIO.decompress(file)
    com_lipids, com_chol = trajIO.translateZ(com_lipids, com_chol)

    com_lipids = displacement.block_displacement(L, com_lipids)
    com_chol = displacement.block_displacement(L, com_chol)

    t = 28
    lipids = com_lipids[t]
    chol = com_chol[t]

    lipids, trash = trajIO.layering(lipids)
    chol, trash = trajIO.layering(chol)

    total = np.concatenate((lipids, chol), axis=0)
    total1 = iter.combine(lipids, chol)

    cluster = percentages.cluster(total, [0.25, 0.25, 0.25, 0.25])
    cluster1 = percentages.cluster(total1, [0.25, 0.25, 0.25, 0.25])

    #edm = euclideanDist.edm(L[t],cluster[0])
    #edm1 = euclideanDist.edm(L[t],cluster1[0])
    #print(np.array_equiv(edm,edm1))

    cutoff = 1.15

    labels1 = dc.dbscan_wrapper(cluster[0], L[t], cutoff)
    labels2 = iter.cluster_labels('upper', L[t], cluster1[0])

    return labels1, labels2
Beispiel #2
0
    linearNorm = {}
    linearWeighted = {}

    for size in cluster_sizes:
        logNorm[size] = np.zeros(size)
        logWeighted[size] = np.zeros(size)
        #linearNorm[size] = np.zeros(size)
        #linearWeighted[size] = np.zeros(size)

    #block
    for block in range(Nblock):
        start = block * nlog
        for time in times:
            t = start + time
            #print(t) #progress tracker
            upper, lower = trajIO.layering(com_lipids[t])
            original = {}
            original['upper'] = upper
            original['lower'] = lower

            for layer in ['upper', 'lower']:
                #clustering
                clusters = percentages.cluster(original[layer], percentage)

                for size in cluster_sizes:
                    for i in range(size):
                        Nparticles = len(clusters[i])
                        normSizes[block][time][layer][size][
                            i], weightedNormSizes[block][time][layer][size][
                                i] = dc.mean_cluster_size(
                                    clusters[i], L[t], cutoff)
    linearNorm = {}
    linearWeighted = {}

    for size in cluster_sizes:
        logNorm[size] = np.zeros(size)
        logWeighted[size] = np.zeros(size)
        #linearNorm[size] = np.zeros(size)
        #linearWeighted[size] = np.zeros(size)

    #block
    for block in range(Nblock):
        start = block * nlog
        for time in times:
            t = start + time
            print(t)  #progress tracker
            ul, ll = trajIO.layering(com_lipids[t])
            uc, lc = trajIO.layering(com_chol[t])

            original = {}
            original['upper'] = iter.combine(ul, uc)
            original['lower'] = iter.combine(ll, lc)

            random = {}
            random['upper'] = (ul, uc)
            random['lower'] = (ll, lc)

            for layer in ['upper', 'lower']:
                #clustering
                clusters = percentages.cluster(
                    original[layer], c.percentages['all']['higher'][4])
                if Nchol: clusters[block][t]['chol'][layer] = {}

            t += nlog
            time += nlog

    #running

    for block in range(Nblock):
        start = block * nlog

        for time in times:
            t = start + time

            for size in cluster_sizes:

                upper_lipids, lower_lipids = trajIO.layering(com_lipids[t])

                clusters[block][time]['lipids']['upper'][
                    size] = jenks_clusters.clusters(upper_lipids, size)
                clusters[block][time]['lipids']['lower'][
                    size] = jenks_clusters.clusters(lower_lipids, size)

                if Nchol:
                    upper_chol, lower_chol = trajIO.layering(com_chol[t])

                    clusters[block][time]['chol']['upper'][
                        size] = jenks_clusters.clusters(upper_chol, size)
                    clusters[block][time]['chol']['lower'][
                        size] = jenks_clusters.clusters(lower_chol, size)

    for block in range(Nblock):
Beispiel #5
0
                clusters[block][t]['chol'][layer] = {}

            t += nlog
            time += nlog

    #running

    for block in range(Nblock):
        start = block * nlog

        for time in times:
            t = start + time

            for size in cluster_sizes:

                upper_chol, lower_chol = trajIO.layering(com_chol[t])

                clusters[block][time]['chol']['upper'][
                    size] = jenks_clusters.clusters(upper_chol, size)
                clusters[block][time]['chol']['lower'][
                    size] = jenks_clusters.clusters(lower_chol, size)

    for block in range(Nblock):
        start = block * nlog
        linear_t = displacement.linear_gen(start, Nconf)

        com_chol = displacement.linear_displacement(L, com_chol, start, Nconf)

        for time in linear_t:
            t = start + time