1 import sys,shutil,os,glob
6 if not len(sys.argv) > 1:
7 print "Please specify an optimization name" 14 temp_dir = optname+
"_temp" 16 if os.path.exists(temp_dir):
17 shutil.rmtree(temp_dir)
21 tarfile = temp_dir+
".tar.gz" 22 if os.path.exists(tarfile):
26 os.makedirs(temp_dir+
"/fitness_vs_configuration/")
27 os.makedirs(temp_dir+
"/fitness_vs_configuration/eps")
28 os.makedirs(temp_dir+
"/fitness_vs_configuration/png")
30 fitness_types = [
"Standard",
"fhcnumu",
"fhcnumubar",
"fhcnuenuebar",
"rhcnumu",
"rhcnumubar",
"rhcnuenuebar",
"ih",
"nh",
"mh"]
31 for type
in fitness_types:
32 subdir = temp_dir+
"/fitness_vs_configuration/" 33 file_prefix = optname+
"_"+type+
"_fitness_vs_configuration" 34 shutil.copyfile(
"plots/"+file_prefix+
".eps",subdir+
"/eps/"+file_prefix+
".eps")
35 shutil.copyfile(
"plots/"+file_prefix+
".png",subdir+
"/png/"+file_prefix+
".png")
37 os.makedirs(temp_dir+
"/best_fluxes/")
38 os.makedirs(temp_dir+
"/best_fluxes/eps")
39 os.makedirs(temp_dir+
"/best_fluxes/png")
40 versions = [
"numu_fhc",
"numubar_fhc",
"nue_fhc",
"nuebar_fhc",
"numu_rhc",
"numubar_rhc",
"nue_rhc",
"nuebar_rhc"]
41 for version
in versions:
42 subdir = temp_dir+
"/best_fluxes/" 43 file_prefix = optname+
"_"+version+
"_best_fluxes" 44 shutil.copyfile(
"plots/"+file_prefix+
".eps",subdir+
"/eps/"+file_prefix+
".eps")
45 shutil.copyfile(
"plots/"+file_prefix+
".png",subdir+
"/png/"+file_prefix+
".png")
47 os.makedirs(temp_dir+
"/fitness_vs_parameter/")
48 os.makedirs(temp_dir+
"/fitness_vs_parameter/eps")
49 os.makedirs(temp_dir+
"/fitness_vs_parameter/png")
50 params = optimization.parameter_names
52 for fitness_type
in fitness_types:
53 subdir = temp_dir+
"/fitness_vs_parameter/" 54 file_prefix = optname+
"_"+fitness_type+
"_fitness_vs_"+param
55 shutil.copyfile(
"plots/"+file_prefix+
".eps",subdir+
"/eps/"+file_prefix+
".eps")
56 shutil.copyfile(
"plots/"+file_prefix+
".png",subdir+
"/png/"+file_prefix+
".png")
58 os.makedirs(temp_dir+
"/parameter_vs_configuration/")
59 os.makedirs(temp_dir+
"/parameter_vs_configuration/eps")
60 os.makedirs(temp_dir+
"/parameter_vs_configuration/png")
61 params = optimization.parameter_names
63 for fitness_type
in fitness_types:
64 subdir = temp_dir+
"/parameter_vs_configuration/" 65 file_prefix = optname+
"_"+param+
"_vs_configuration" 66 shutil.copyfile(
"plots/"+file_prefix+
".eps",subdir+
"/eps/"+file_prefix+
".eps")
67 shutil.copyfile(
"plots/"+file_prefix+
".png",subdir+
"/png/"+file_prefix+
".png")
69 os.makedirs(temp_dir+
"/parameter_vs_parameter/")
70 os.makedirs(temp_dir+
"/parameter_vs_parameter/eps")
71 os.makedirs(temp_dir+
"/parameter_vs_parameter/png")
72 params = optimization.parameter_names
75 subdir = temp_dir+
"/parameter_vs_parameter/" 76 file_prefix = optname+
"_"+param1+
"_vs_"+param2
77 if(os.path.exists(
"plots/"+file_prefix+
".eps")):
78 shutil.copyfile(
"plots/"+file_prefix+
".eps",subdir+
"/eps/"+file_prefix+
".eps")
79 shutil.copyfile(
"plots/"+file_prefix+
".png",subdir+
"/png/"+file_prefix+
".png")
81 os.makedirs(temp_dir+
"/visualizations/")
82 os.makedirs(temp_dir+
"/visualizations/eps")
83 os.makedirs(temp_dir+
"/visualizations/png")
84 params = optimization.parameter_names
86 subdir = temp_dir+
"/visualizations/" 88 eps_to_copy = glob.glob(
"vis_plots/*"+file_prefix+
"*.eps")
89 png_to_copy = glob.glob(
"vis_plots/*"+file_prefix+
"*.png")
91 for eps_file
in eps_to_copy:
92 shutil.copyfile(eps_file,subdir+
"/eps/"+os.path.basename(eps_file))
94 for png_file
in png_to_copy:
95 shutil.copyfile(png_file,subdir+
"/png/"+os.path.basename(png_file))
97 os.makedirs(temp_dir+
"/scans/")
98 os.makedirs(temp_dir+
"/scans/eps")
99 os.makedirs(temp_dir+
"/scans/png")
100 params = optimization.parameter_names
102 subdir = temp_dir+
"/scans/" 103 file_prefix = optname
104 eps_to_copy = glob.glob(
"scan_plots/*"+file_prefix+
"*.eps")
105 png_to_copy = glob.glob(
"scan_plots/*"+file_prefix+
"*.png")
107 for eps_file
in eps_to_copy:
108 shutil.copyfile(eps_file,subdir+
"/eps/"+os.path.basename(eps_file))
110 for png_file
in png_to_copy:
111 shutil.copyfile(png_file,subdir+
"/png/"+os.path.basename(png_file))
113 os.system(
"tar cvzf " + tarfile+
" " + temp_dir)