示例#1
0
def plot_nums_length(length, length_error, real_kappa):
    """
        Gets proportions of long/shorts rods.
    """
    msg = "\t\t\tK"+str(real_kappa)+"\t\t\t"
    names, rod_groups = system_state.create_rods_with_length(length=length, length_error=length_error,
                                            real_kappas=real_kappa)
    experiment_ = experiment.Experiment(system_states_name_list=names, kappas=real_kappa,
                                        system_states_list=rod_groups,
                                        dates=dates, diff_t=5/3.0)
    experiment_.plot_number_of_rods_over_time()
示例#2
0
 def run_default_length(length, length_error, real_kappa):
     """
         Gets proportions of long/shorts rods.
     """
     print "\n\n\n"
     plottable_rods, density_matrices = None, None
     bursts_groups = None
     name = str(int(real_kappa)) + "_default.log"
     log = open(name, 'w')
     msg = "\t\t\tK"+str(real_kappa)+"\t\t\t"
     print msg
     names, rod_groups = system_state.create_rods_with_length(length=length, length_error=length_error,
                                             real_kappas=real_kappa)
     experiment_ = experiment.Experiment(system_states_name_list=names, kappas=real_kappa,
                                         system_states_list=rod_groups,
                                         dates=dates, diff_t=5/3.0)
     log.write(str(msg+"\n"))
     experiment_.set_coef(coef)
     times = experiment_.times(1)
     if create_videos:
         experiment_.create_videos(divisions=divisions, fps=10, max_distance=evol_max_dist, max_angle_diff=evol_max_ang_diff,
                                  number_of_bursts=number_of_bursts, limit=temp_final_rod_num_limit, bursts_coef=burst_mult)
     if clusters:
         experiment_.plot_cluster_areas(cluster_divisions, cluster_index_length,
                 number_of_bursts=cluster_bursts, max_distance=cluster_max_dist,
                 max_angle_diff=cluster_max_angle, min_size=cluster_min_size)
     if clusters_hist:
         experiment_.create_cluster_histogram_video(cluster_divisions, 
                     cluster_index_length, max_distance=cluster_max_dist,
                     max_angle_diff=cluster_max_angle, fps=15)
     if avg_temp:
         experiment_.plot_average_average_quadratic_speed(max_distance=100, max_angle_diff=10, limit=5)
     if lost_percentage:
         percentage, std_dev = experiment_.lost_rods_percentage
         msg = "Rods lost: "+str(percentage)+"%\t"+" Standard deviation: "+str(std_dev)
         log.write(str(msg+"\n"))
     if plot_rods:
         plottable_rods = experiment_.plottable_rods
     if order_param:
         density_matrices = experiment_.plottable_density_matrices(divisions)
         bursts_groups = experiment_.bursts_groups
     try:
         names = None
         experiment_ = None
         rod_groups = None
         gc.collect()
     except NameError:
         pass
     log.close()
     return plottable_rods, density_matrices, bursts_groups, times
示例#3
0
 def run_prop_length(length, length_error, real_kappa):
     """
         Gets proportions of long/shorts rods.
     """
     msg = "\t\t\tK"+str(real_kappa)+"\t\t\t"
     names, rod_groups = system_state.create_rods_with_length(length=length, length_error=length_error,
                                             real_kappas=real_kappa, file_range=[0,5])
     experiment_ = experiment.Experiment(system_states_name_list=names, kappas=real_kappa,
                                         system_states_list=rod_groups,
                                         dates=dates, diff_t=5/3.0)
     msg = str(experiment_.average_kappa) + "\t|\t" + str(experiment_.average_kappa_dev)
     rad = experiment_.average_system_rad
     length = experiment_.average_rod_length
     width = experiment_.average_rod_width
     cov_area, cov_area_dev = experiment_.average_covered_area_proportion
     num_rods, num_rods_dev = experiment_.average_number_of_rods
     return cov_area, cov_area_dev, int(num_rods), int(num_rods_dev), rad, msg