 Timestamp:
 Jan 8, 2007, 3:36:39 PM (17 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r4131 r4145 833 833 834 834 import sys 835 if not sys.version.startswith('2.4'):835 #if not sys.version.startswith('2.4'): 836 836 # Backwards compatibility 837 838 839 840 if sys.platform == 'win32':841 842 843 844 845 846 837 # from sets import Set as set 838 839 from sets import Set as set 840 841 for i,j in enumerate(quantity): 842 quantity[i] = quantity[i].lower() 843 p = list(set(quantity).difference(set(all_quantity))) 844 if len(p) <> 0: 845 msg = 'Quantities %s do not exist  please try again' %p 846 raise Exception, msg 847 847 848 848 return … … 928 928 max_momentums = [] 929 929 max_speeds = [] 930 c = 0930 max_depths = [] 931 931 model_time_plot3d = zeros((n0,m), Float) 932 932 stages_plot3d = zeros((n0,m), Float) … … 944 944 max_stage = 0 945 945 max_momentum = 0 946 max_speed = 0 946 max_speed = 0 947 max_depth = 0 947 948 gaugeloc = locations[k] 948 949 thisfile = file_loc[j]+sep+'gauges_time_series'+'_'+gaugeloc+'.csv' … … 983 984 if m > max_momentum: max_momentum = m 984 985 if vel > max_speed: max_speed = vel 986 if z > 0 and depth > max_depth: max_depth = depth 985 987 986 988 … … 990 992 min_stages.append(min_stage) 991 993 max_momentums.append(max_momentum) 992 max_speeds.append(max_speed) 994 max_speeds.append(max_speed) 995 max_depths.append(max_depth) 993 996 #### finished generating quantities for each swwfile ##### 994 997 … … 1026 1029 profilefig = 'solution_xprofile' 1027 1030 savefig('profilefig') 1028 1029 #stage_axis = axis([time_min/60.0, time_max/60.0, min(min_stages), max(max_stages)*1.1]) 1030 #stage_axis = axis([time_min/60.0, time_max/60.0, 3.0, 3.0]) 1031 #vel_axis = axis([time_min/60.0, time_max/60.0, min(max_speeds), max(max_speeds)*1.1]) 1032 #mom_axis = axis([time_min/60.0, time_max/60.0, min(max_momentums), max(max_momentums)*1.1]) 1031 1032 depth_axis = axis([time_min/60.0, time_max/60.0, 0, max(max_depths)*1.1]) 1033 stage_axis = axis([time_min/60.0, time_max/60.0, min(min_stages), max(max_stages)*1.1]) 1034 stage_axis = axis([time_min/60.0, time_max/60.0, 3.0, 3.0]) 1035 vel_axis = axis([time_min/60.0, time_max/60.0, min(max_speeds), max(max_speeds)*1.1]) 1036 mom_axis = axis([time_min/60.0, time_max/60.0, min(max_momentums), max(max_momentums)*1.1]) 1033 1037 1034 1038 cstr = ['g', 'r', 'b', 'c', 'm', 'y', 'k'] … … 1037 1041 elev_output = [] 1038 1042 if len(label_id) > 1: graphname_report = [] 1043 pp = 1 1044 div = 11. 1039 1045 for k in gauge_index: 1040 1046 g = gauges[k] 1041 1047 count1 = 0 1042 1048 if report == True and len(label_id) > 1: 1043 s = '\\begin{figure}[h bt] \n \\centering \n \\begin{tabular}{cc} \n'1049 s = '\\begin{figure}[ht] \n \\centering \n \\begin{tabular}{cc} \n' 1044 1050 fid.write(s) 1045 1051 if len(label_id) > 1: graphname_report = [] … … 1063 1069 plot(model_time[0:n[j]1,k,j], depths[0:n[j]1,k,j], '', c = cstr[j]) 1064 1070 units = 'm' 1071 axis(depth_axis) 1065 1072 if which_quantity == 'stage': 1066 if elevations[0 :n[j]1,k,j] < 0:1073 if elevations[0,k,j] < 0: 1067 1074 plot(model_time[0:n[j]1,k,j], stages[0:n[j]1,k,j], '', c = cstr[j]) 1075 axis(stage_axis) 1068 1076 else: 1069 1077 plot(model_time[0:n[j]1,k,j], depths[0:n[j]1,k,j], '', c = cstr[j]) 1070 #axis(stage_axis)1078 axis(depth_axis) 1071 1079 units = 'm' 1072 1080 if which_quantity == 'momentum': 1073 1081 plot(model_time[0:n[j]1,k,j], momenta[0:n[j]1,k,j], '', c = cstr[j]) 1074 #axis(mom_axis)1082 axis(mom_axis) 1075 1083 units = 'm^2 / sec' 1076 1084 if which_quantity == 'xmomentum': 1077 1085 plot(model_time[0:n[j]1,k,j], xmom[0:n[j]1,k,j], '', c = cstr[j]) 1078 #axis(mom_axis)1086 axis(mom_axis) 1079 1087 units = 'm^2 / sec' 1080 1088 if which_quantity == 'ymomentum': 1081 1089 plot(model_time[0:n[j]1,k,j], ymom[0:n[j]1,k,j], '', c = cstr[j]) 1082 #axis(mom_axis)1090 axis(mom_axis) 1083 1091 units = 'm^2 / sec' 1084 1092 if which_quantity == 'speed': 1085 1093 plot(model_time[0:n[j]1,k,j], speed[0:n[j]1,k,j], '', c = cstr[j]) 1086 #axis(vel_axis)1094 axis(vel_axis) 1087 1095 units = 'm / sec' 1088 1096 if which_quantity == 'bearing': … … 1170 1178 s = '\end{tabular} \n \\caption{%s} \n \label{fig:%s} \n \end{figure} \n \n' %(caption, label) 1171 1179 fid.write(s) 1172 c += 11173 if c % 6 == 0: fid.write('\\clearpage \n')1180 cc += 1 1181 if cc % 6 == 0: fid.write('\\clearpage \n') 1174 1182 savefig(graphname_latex) 1175 1183 … … 1186 1194 else: 1187 1195 word_quantity += plot_quantity[i] 1188 print 'hello', elevations[0,k,j]1189 1196 where1 = 0 1190 1197 count1 += 1 … … 1213 1220 s = '\end{tabular} \n \\caption{%s} \n \label{fig:%s} \n \end{figure} \n \n' %(caption, label) 1214 1221 fid.write(s) 1215 c += 1 1216 if c % 6 == 0: fid.write('\\clearpage \n') 1222 if float((k+1)/div  pp) == 0.: 1223 fid.write('\\clearpage \n') 1224 pp += 1 1217 1225 1218 1226 #### finished generating figures ###
Note: See TracChangeset
for help on using the changeset viewer.