예제 #1
0
for k in range(len(celltype)):
    ind = 0
    ind1 = len(indices)
    fig = plt.figure(figsize=[8, 8])
    for i in range(len(indices)):
        slopes.append([])
        pars = indices[i]
        par1['CD'] = cd[pars[0]]
        par1['g1_thresh_std'] = g1_std[pars[1]]
        par1['g2_std'] = g2_std[pars[2]]
        par1['l_std'] = l_std[pars[3]]
        if k == 0:  # don't do it twice
            for j in range(len(altmodels)):
                slopes[i].append([])
                par1['modeltype'] = altmodels[j]
                obs_temp, tg_temp = g.single_par_meas4(par1)  # discretized gen
                slopes[i][j].append(
                    obs_temp[0, :])  # mothers first, then daughters
        frac = np.array(1 - 2**(-par1['CD']))
        for j in range(len(models)):
            if j == 0:
                ind += 1
                index = ind
            if j == 1:
                ind1 += 1
                index = ind1
            colorval = scalarmap.to_rgba(values[index])
            plt.plot(f,
                     obs[pars[0], pars[1], pars[2], pars[3], :, j, 0, k],
                     label=modeltype[j] + ' $\sigma_i$=' +
                     str(np.round(par1['g1_thresh_std'], 2)) +
 #a = np.zeros((X, Y, Z, 6, 2, 3))
 if rank == 0:
     print 'Setup matrix'
 dx = X / size
 start = dx * rank
 stop = start + dx
 if rank == size - 1:
     stop = X
 for i in xrange(start, stop):
     par1['g2_std'] = g2_std[i]
     for j in range(Y):
         par1['g1_thresh_std'] = g1_std[j]
         for k in range(Z):
             par1['d_std'] = d_std[k]
             # obs1, obs2, tg1, tg2 = g.single_par_meas5(par1)  # Obs1 are leaf cells, obs2 are entire tree cells
             obs3, tg3 = g.single_par_meas4(par1)
             a[i, j, k, :, :] = obs3[:6, :]
             basepath = '/home/felix/simulation_data/discr_time_tester1_data/'
             # np.save(basepath + 'tgrow_m_model'+str(par1['modeltype'])+'_discr_time_leaf_cd_'
             #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k), tg1[0])
             # np.save(basepath + 'tgrow_m_model'+str(par1['modeltype'])+'_discr_time_tree_cd_'
             #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k), tg2[0])
             np.save(
                 basepath + 'tgrow_m_model' + str(par1['modeltype']) +
                 '_discr_genr_tree_cd_' + str(i) + '_s1_' + str(j) +
                 '_s2_' + str(k), tg3[0])
             # np.save(basepath + 'tgrow_d_model'+str(par1['modeltype'])+'_discr_time_leaf_cd_'
             #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k), tg1[1])
             # np.save(basepath + 'tgrow_d_model'+str(par1['modeltype'])+'_discr_time_tree_cd_'
             #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k), tg2[1])
             np.save(
     stop = X
 for i in xrange(start, stop):
     par1['CD'] = cd[i]
     for j in range(Y):
         par1['g1_thresh_std'] = g1_std[j]
         for k in range(Z):
             par1['g2_std'] = g2_std[k]
             for m in range(W):
                 par1['l_std'] = l_std[m]
                 for n in range(V):
                     par1['frac'] = f[n]
                     for num in range(len(models)):
                         par1['modeltype'] = models[num]
                         # obs1, obs2, tg1, tg2 = g.single_par_meas5(par1)
                         # Obs1 are leaf cells, obs2 are entire tree cells
                         obs3, tg3 = g.single_par_meas4(
                             par1)  # discretized gen
                         a[i, j, k, m, n,
                           num, :, :] = obs3[:6, :]  # discr gen
                         # a[i, j, k, m, n, num, :, :] = obs2[:6, :]  # discr time tree
                         # a[i, j, k, m, n, num, 2, :, :] = obs1[:6, :]  # discr time leaf
                         basepath = '/home/felix/simulation_data/model11_12/'
                         # np.save(basepath + 'tgrow_m_model'+str(par1['modeltype'])+'_discr_time_leaf_cd_'
                         #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k) + '_sl_' + str(m) + '_f_' + str(n),
                         #         tg1[0])
                         # np.save(basepath + 'tgrow_m_model'+str(par1['modeltype'])+'_discr_time_tree_cd_'
                         #         + str(i) + '_s1_' + str(j) + '_s2_' + str(k) + '_sl_' + str(m) + '_f_' + str(n),
                         #         tg2[0])
                         np.save(
                             basepath + 'tgrow_m_model' +
                             str(par1['modeltype']) +
                             '_discr_genr_tree_cd_' + str(i) + '_s1_' +