Changeset 4080
- Timestamp:
- Dec 14, 2006, 1:48:57 PM (18 years ago)
- Location:
- anuga_work/production/perth_2006
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/perth_2006/build_perth.py
r4077 r4080 55 55 # Fine pts file to be clipped to area of interest 56 56 #------------------------------------------------------------------------------- 57 57 print"project.bounding_polygon",project.bounding_polygon 58 print"project.combined_dir_name",project.combined_dir_name 58 59 59 60 # topography directory filenames 61 onshore_in_dir_name = project.onshore_in_dir_name 62 coast_in_dir_name = project.coast_in_dir_name 63 island_in_dir_name = project.island_in_dir_name 64 island_in_dir_name1 = project.island_in_dir_name1 65 island_in_dir_name2 = project.island_in_dir_name2 66 island_in_dir_name3 = project.island_in_dir_name3 67 offshore_in_dir_name = project.offshore_in_dir_name 68 60 69 onshore_dir_name = project.onshore_dir_name 61 70 coast_dir_name = project.coast_dir_name 62 islands_dir_name = project.islands_dir_name 63 islands_dir_name1 = project.islands_dir_name1 64 islands_dir_name1 = project.islands_dir_name2 71 island_dir_name = project.island_dir_name 72 island_dir_name1 = project.island_dir_name1 73 island_dir_name2 = project.island_dir_name2 74 island_dir_name3 = project.island_dir_name3 65 75 offshore_dir_name = project.offshore_dir_name 66 76 67 77 # creates DEM from asc data 68 convert_dem_from_ascii2netcdf(onshore_dir_name, use_cache=True, verbose=True) 69 convert_dem_from_ascii2netcdf(islands_dir_name, use_cache=True, verbose=True) 70 convert_dem_from_ascii2netcdf(islands_dir_name1, use_cache=True, verbose=True) 71 convert_dem_from_ascii2netcdf(islands_dir_name2, use_cache=True, verbose=True) 78 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True) 79 convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True) 80 convert_dem_from_ascii2netcdf(island_in_dir_name1, basename_out=island_dir_name1, use_cache=True, verbose=True) 81 convert_dem_from_ascii2netcdf(island_in_dir_name2, basename_out=island_dir_name2, use_cache=True, verbose=True) 82 convert_dem_from_ascii2netcdf(island_in_dir_name3, basename_out=island_dir_name3, use_cache=True, verbose=True) 72 83 73 84 #creates pts file for onshore DEM … … 80 91 verbose=True) 81 92 82 #creates pts file for islands DEM 83 dem2pts(islands_dir_name, use_cache=True, verbose=True) 84 dem2pts(islands_dir_name1, use_cache=True, verbose=True) 85 dem2pts(islands_dir_name2, use_cache=True, verbose=True) 93 #creates pts file for island DEM 94 dem2pts(island_dir_name, use_cache=True, verbose=True) 95 dem2pts(island_dir_name1, use_cache=True, verbose=True) 96 dem2pts(island_dir_name2, use_cache=True, verbose=True) 97 dem2pts(island_dir_name3, use_cache=True, verbose=True) 86 98 87 99 print'create Geospatial data objects from topographies' 88 G1 = Geospatial_data(file_name = project.onshore_dir_name + '.pts') 89 G2 = Geospatial_data(file_name = project.coast_dir_name + '.xya') 90 G3 = Geospatial_data(file_name = project.islands_dir_name + '.pts') 91 G4 = Geospatial_data(file_name = project.islands_dir_name1 + '.pts') 92 G5 = Geospatial_data(file_name = project.islands_dir_name2 + '.pts') 93 G_off = Geospatial_data(file_name = project.offshore_dir_name + '.xya') 100 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') 101 G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya') 102 G3 = Geospatial_data(file_name = island_dir_name + '.pts') 103 G4 = Geospatial_data(file_name = island_dir_name1 + '.pts') 104 G5 = Geospatial_data(file_name = island_dir_name2 + '.pts') 105 G6 = Geospatial_data(file_name = island_dir_name3 + '.pts') 106 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya') 94 107 108 print'add all geospatial objects' 109 G = G1 + G2 + G3 + G4 + G5 + G6 + G_off 95 110 96 97 98 99 print 'G_offshore_data_old_e'#, G_offshore_old_e.get_data_points() 100 print'add all geospatial objects' 101 G = G1 + G2 + G3 + G4 + G5 + G_off 102 103 #print'clip combined geospatial object by bounding polygon' 111 print'clip combined geospatial object by bounding polygon' 104 112 G_clipped = G.clip(project.bounding_polygon) 105 113 #FIXME: add a clip function to pts 106 print'shape of clipped data', G_clipped.get_data_points().shape114 #print'shape of clipped data', G_clipped.get_data_points().shape 107 115 108 116 print'export combined DEM file' -
anuga_work/production/perth_2006/project.py
r4077 r4080 9 9 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 10 10 #from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm 11 from anuga.utilities.system_tools import get_user_name 11 12 12 13 # file and system info … … 20 21 home += sep +'data' 21 22 23 #time stuff 24 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 25 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 26 build_time = time+'_build' 27 run_time = time+'_run' 28 print 'gtime: ', gtime 29 22 30 #Making assumptions about the location of scenario data 23 31 state = 'western_australia' 24 32 scenario_name = 'perth' 25 scenario _dir_name= 'perth_tsunami_scenario_2006'33 scenario = 'perth_tsunami_scenario_2006' 26 34 27 35 # onshore data provided by WA DLI … … 31 39 island_name1 = 'gard_dli_ext' 32 40 island_name2 = 'carnac_island_dted' 41 island_name3 = 'penguin_dted' 33 42 34 43 # AHO + DPI data … … 39 48 combined_name ='perth_combined_elevation' 40 49 41 topographies_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'topographies'+sep 50 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep 51 topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep 42 52 topographies_time_dir = topographies_dir+build_time+sep 43 53 44 54 #input topo file location 55 onshore_in_dir_name = topographies_in_dir + onshore_name 56 island_in_dir_name = topographies_in_dir + island_name 57 island_in_dir_name1 = topographies_in_dir + island_name1 58 island_in_dir_name2 = topographies_in_dir + island_name2 59 island_in_dir_name3 = topographies_in_dir + island_name3 60 61 coast_in_dir_name = topographies_in_dir + coast_name 62 offshore_in_dir_name = topographies_in_dir + offshore_name 63 45 64 onshore_dir_name = topographies_dir + onshore_name 46 65 island_dir_name = topographies_dir + island_name 47 66 island_dir_name1 = topographies_dir + island_name1 48 67 island_dir_name2 = topographies_dir + island_name2 68 island_dir_name3 = topographies_dir + island_name3 49 69 50 70 coast_dir_name = topographies_dir + coast_name … … 54 74 combined_dir_name = topographies_dir + combined_name 55 75 combined_time_dir_name = topographies_time_dir + combined_name 56 combined_time_dir_final_name = topographies_time_dir + combined_final_name76 #combined_time_dir_final_name = topographies_time_dir + combined_final_name 57 77 58 78 59 79 #Derive subdirectories and filenames 60 80 61 meshes_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'meshes'+sep81 meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep 62 82 meshes_dir_name = meshes_dir + scenario_name 63 83 64 polygons_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'polygons'+sep65 tide_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'tide_data'+sep84 polygons_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'polygons'+sep 85 tide_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'tide_data'+sep 66 86 87 88 boundaries_source = 'mag_9_corrected' 67 89 #boundaries locations 68 boundaries_in_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep69 boundaries_in_dir_name = boundaries_in_dir + boundaries_name70 boundaries_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'boundaries'+sep71 boundaries_dir_name = boundaries_dir + boundaries_name72 #boundaries_time_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'boundaries'+sep+build_time+sep90 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep 91 boundaries_in_dir_name = boundaries_in_dir + scenario_name 92 boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep 93 boundaries_dir_name = boundaries_dir + scenario_name 94 #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep 73 95 #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing 74 96 #ideas 75 97 #boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep 76 98 77 #time stuff78 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir79 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir80 build_time = time+'_build'81 run_time = time+'_run'82 print 'gtime: ', gtime83 84 99 #output locations 85 output_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'outputs'+sep86 output_build_time_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep87 output_run_time_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'outputs'+sep+run_time+sep100 output_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep 101 output_build_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+build_time+sep 102 output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep 88 103 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 89 104 90 105 #gauges 91 106 gauge_name = 'perth.csv' 92 gauges_dir = home+sep+state+sep+scenario _datas_name+sep+'anuga'+sep+'gauges'+sep107 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep 93 108 gauges_dir_name = gauges_dir + gauge_name 94 109 … … 123 138 124 139 poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv') 125 assert zone == refzone140 #assert zone == refzone 126 141 127 142
Note: See TracChangeset
for help on using the changeset viewer.