Changeset 5166
- Timestamp:
- Mar 12, 2008, 11:24:21 AM (16 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
r5136 r5166 1349 1349 fileName = temp_dir+sep+'time_series_3.csv' 1350 1350 file = open(fileName,"w") 1351 file.write(" Time,Stage,Speed,Momentum,Elevation\n\1351 file.write("time,stage,speed,momentum,elevation\n\ 1352 1352 1.0, 0, 0, 0, 10 \n\ 1353 1353 2.0, 5, 2, 4, 10 \n\ … … 1357 1357 fileName1 = temp_dir+sep+'time_series_4.csv' 1358 1358 file1 = open(fileName1,"w") 1359 file1.write(" Time,Stage,Speed,Momentum,Elevation\n\1359 file1.write("time,stage,speed,momentum,elevation\n\ 1360 1360 1.0, 0, 0, 0, 5 \n\ 1361 1361 2.0, -5, -2, -4, 5 \n\ … … 1365 1365 fileName2 = temp_dir+sep+'time_series_5.csv' 1366 1366 file2 = open(fileName2,"w") 1367 file2.write(" Time,Stage,Speed,Momentum,Elevation\n\1367 file2.write("time,stage,speed,momentum,elevation\n\ 1368 1368 1.0, 0, 0, 0, 7 \n\ 1369 1369 2.0, 4, -0.45, 57, 7 \n\ … … 1376 1376 base_name='time_series_', 1377 1377 plot_numbers=['3-5'], 1378 quantities=[' Speed','Stage','Momentum'],1378 quantities=['speed','stage','momentum'], 1379 1379 assess_all_csv_files=True, 1380 1380 extra_plot_name='test') 1381 1381 1382 # print 'stage+fileName[:-4]+test.png',dir+sep+'stage_'+name[:-4]+'_test.png'1383 assert(access(dir+sep+ 'stage_'+name[:-4]+'_test.png',F_OK)==True)1384 assert(access(dir+sep+ 'speed_'+name[:-4]+'_test.png',F_OK)==True)1385 assert(access(dir+sep+ 'momentum_'+name[:-4]+'_test.png',F_OK)==True)1382 #print dir+sep+name[:-4]+'_stage_test.png' 1383 assert(access(dir+sep+name[:-4]+'_stage_test.png',F_OK)==True) 1384 assert(access(dir+sep+name[:-4]+'_speed_test.png',F_OK)==True) 1385 assert(access(dir+sep+name[:-4]+'_momentum_test.png',F_OK)==True) 1386 1386 1387 1387 dir1, name1=os.path.split(fileName1) 1388 assert(access(dir+sep+ 'stage_'+name1[:-4]+'_test.png',F_OK)==True)1389 assert(access(dir+sep+ 'speed_'+name1[:-4]+'_test.png',F_OK)==True)1390 assert(access(dir+sep+ 'momentum_'+name1[:-4]+'_test.png',F_OK)==True)1388 assert(access(dir+sep+name1[:-4]+'_stage_test.png',F_OK)==True) 1389 assert(access(dir+sep+name1[:-4]+'_speed_test.png',F_OK)==True) 1390 assert(access(dir+sep+name1[:-4]+'_momentum_test.png',F_OK)==True) 1391 1391 1392 1392 1393 1393 dir2, name2=os.path.split(fileName2) 1394 assert(access(dir+sep+ 'stage_'+name2[:-4]+'_test.png',F_OK)==True)1395 assert(access(dir+sep+ 'speed_'+name2[:-4]+'_test.png',F_OK)==True)1396 assert(access(dir+sep+ 'momentum_'+name2[:-4]+'_test.png',F_OK)==True)1394 assert(access(dir+sep+name2[:-4]+'_stage_test.png',F_OK)==True) 1395 assert(access(dir+sep+name2[:-4]+'_speed_test.png',F_OK)==True) 1396 assert(access(dir+sep+name2[:-4]+'_momentum_test.png',F_OK)==True) 1397 1397 1398 1398 del_dir(temp_dir) -
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r5141 r5166 1509 1509 base_name='', 1510 1510 plot_numbers=['3-5'], 1511 quantities=[' Speed','Stage','Momentum'],1511 quantities=['speed','stage','momentum'], 1512 1512 assess_all_csv_files=True, 1513 1513 extra_plot_name='test' ): 1514 1514 1515 1515 print 'make_plots_from_csv_file has been replaced by csv2timeseries_graphs ', 1516 print 'Please use "from anuga. shallow_water.util import csv2timeseries_graphs"'1516 print 'Please use "from anuga.abstract_2d_finite_volumes.util import csv2timeseries_graphs"' 1517 1517 1518 1518 return csv2timeseries_graphs(directories_dic, … … 1704 1704 all_csv_filenames=[] 1705 1705 if verbose: print 'Determining files to access for axes ranges \n' 1706 # print directories_dic.keys, base_name 1706 1707 #print directories_dic.keys(), base_name 1707 1708 1708 1709 for i,directory in enumerate(directories_dic.keys()): … … 1723 1724 1724 1725 1725 #print "list_filenames", list_filenames1726 #print "list_filenames", list_filenames 1726 1727 1727 1728 #use all the files to get the values for the plot axis … … 1862 1863 legend_list_dic={} 1863 1864 legend_list =[] 1864 for i, directory in enumerate(directories_dic.keys()): 1865 for i, directory in enumerate(directories_dic.keys()): 1866 1865 1867 if verbose: print'Plotting in %s %s' %(directory, new_plot_numbers) 1866 1868 # print 'LIST',list_filenames … … 1879 1881 #if they don't exist 1880 1882 #print 'i %s,j %s, number %s, file %s' %(i,j,number,file) 1881 attribute_dic, title_index_dic = csv2dict(directory+ filename+'.csv')1883 attribute_dic, title_index_dic = csv2dict(directory+sep+filename+'.csv') 1882 1884 #get data from dict in to list 1883 1885 #do maths to list by changing to array … … 1930 1932 pylab.title('%s at %s gauge' %(quantity,filename[len(base_name):])) 1931 1933 if output_dir == '': 1932 figname = '%s%s _%s%s.png' %(directory,1934 figname = '%s%s%s_%s%s.png' %(directory,sep, 1933 1935 filename, 1934 1936 quantity, 1935 1937 extra_plot_name) 1936 1938 else: 1937 figname = '%s%s _%s%s.png' %(output_dir,1939 figname = '%s%s%s_%s%s.png' %(output_dir,sep, 1938 1940 filename, 1939 1941 quantity, -
anuga_work/development/attenuation_near_shore/create_mesh.py
r5161 r5166 77 77 dy = dx 78 78 L = 2080. 79 W = 2000.79 W = dx 80 80 81 81 # structured mesh 82 points, vertices, boundary = rectangular_cross(int(L/dx), int(W/dy), L, W, (-80.0, - 1000.0))82 points, vertices, boundary = rectangular_cross(int(L/dx), int(W/dy), L, W, (-80.0, -W*0.5)) 83 83 84 84 domain = Domain(points, vertices, boundary) -
anuga_work/development/attenuation_near_shore/run_beach_structured.py
r5161 r5166 123 123 124 124 head,tail = path.split(mesh_filename) 125 copy (mesh_filename,126 pro_instance.outputdir + tail )125 #copy (mesh_filename, 126 # pro_instance.outputdir + tail ) 127 127 #------------------------------------------------------------------------- 128 128 # Setup computational domain
Note: See TracChangeset
for help on using the changeset viewer.