Changeset 6262
- Timestamp:
- Feb 3, 2009, 1:44:29 PM (16 years ago)
- Location:
- anuga_work/production/busselton/standardised_version
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/standardised_version/build_busselton.py
r6261 r6262 14 14 15 15 # Standard modules 16 from os.path import dirname 17 from os import mkdir, access, F_OK 16 import os 18 17 19 18 # Related major packages 20 from anuga.shallow_water import Domain21 19 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 22 from anuga.geospatial_data.geospatial_data import *20 from anuga.geospatial_data.geospatial_data import Geospatial_data 23 21 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files 24 22 … … 31 29 #------------------------------------------------------------------------------ 32 30 33 #copy_code_files(project.output_build_time_dir,__file__,34 #dirname(project.__file__)+os.sep+ project.__name__+'.py' )35 #start_screen_catcher(project.output_build_time_dir)31 copy_code_files(project.output_build_time_dir,__file__, 32 os.path.dirname(project.__file__)+os.sep+ project.__name__+'.py' ) 33 start_screen_catcher(project.output_build_time_dir) 36 34 37 35 … … 46 44 print 'project.poly_all', project.poly_all 47 45 print 'project.combined_dir_name', project.combined_dir_name 48 49 # input elevation directory filenames50 #onshore_in_dir_name = project.onshore_in_dir_name51 #coast_in_dir_name = project.coast_in_dir_name52 #coast_in_dir_name1 = project.coast_in_dir_name153 #offshore_in_dir_name = project.offshore_in_dir_name54 #offshore_in_dir_name1 = project.offshore_in_dir_name155 #offshore_in_dir_name2 = project.offshore_in_dir_name256 #offshore_in_dir_name3 = project.offshore_in_dir_name357 #offshore_in_dir_name4 = project.offshore_in_dir_name458 #offshore_in_dir_name5 = project.offshore_in_dir_name559 60 # output elevation directory filenames61 #onshore_dir_name = project.onshore_dir_name62 #coast_dir_name = project.coast_dir_name63 #coast_dir_name1 = project.coast_dir_name164 #offshore_dir_name = project.offshore_dir_name65 #offshore_dir_name1 = project.offshore_dir_name166 #offshore_dir_name2 = project.offshore_dir_name267 #offshore_dir_name3 = project.offshore_dir_name368 #offshore_dir_name4 = project.offshore_dir_name469 #offshore_dir_name5 = project.offshore_dir_name570 71 46 72 47 # Create Geospatial data from ASCII files … … 90 65 91 66 92 #print "creates DEMs from asc data"93 #print onshore_in_dir_name, onshore_dir_name94 #print offshore_in_dir_name5, offshore_dir_name595 #96 #convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)97 #98 #convert_dem_from_ascii2netcdf(offshore_in_dir_name5, basename_out=offshore_dir_name5, use_cache=True, verbose=True)#99 ##100 #101 # creates pts file for onshore DEM102 #print "creates pts file for onshore DEM"103 #dem2pts(onshore_dir_name ,use_cache=True,verbose=True)104 #dem2pts(offshore_dir_name5 ,use_cache=True,verbose=True)105 106 # create onshore pts files107 #print'create Geospatial data1 objects from topographies'108 #G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')109 110 # create coastal and offshore pts files111 #print'create Geospatial data2 objects from topographies'112 #G2 = Geospatial_data(file_name = coast_in_dir_name)113 #print'create Geospatial data3 objects from topographies'114 #G3 = Geospatial_data(file_name = coast_in_dir_name1)115 #print'create Geospatial data4 objects from topographies'116 #G_off = Geospatial_data(file_name = offshore_in_dir_name)117 #print'create Geospatial data5 objects from topographies'118 #G_off1 = Geospatial_data(file_name = offshore_in_dir_name1)119 #print'create Geospatial data6 objects from topographies'120 #G_off2 = Geospatial_data(file_name = offshore_in_dir_name2)121 #print'create Geospatial data7 objects from topographies'122 #G_off3 = Geospatial_data(file_name = offshore_in_dir_name3)123 #print'create Geospatial data8 objects from topographies'124 #G_off4 = Geospatial_data(file_name = offshore_in_dir_name4)125 #print'create Geospatial data9 objects from topographies'126 #G_off5 = Geospatial_data(file_name = offshore_dir_name5 + '.pts')127 128 129 67 #------------------------------------------------------------------------------- 130 68 # Combine, clip and export dataset 131 69 #------------------------------------------------------------------------------- 132 70 133 #print'add all geospatial objects'134 #G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4135 136 71 print 'Add geospatial objects except', project.offshore_name5 137 print geospatial_data.keys()138 72 G = None 139 73 for key in geospatial_data: … … 141 75 G += geospatial_data[key] 142 76 143 print 'Clip (outside) combined geospatial object except %s by area of interest.'77 print 'Clip combined geospatial data' 144 78 G_clip = G.clip_outside(project.poly_aoi1) 145 146 print 'Clip combined geospatial object by bounding polygon'147 79 G_all = G_clip + geospatial_data[project.offshore_name5] # G_off5 148 80 G_clipped = G_all.clip(project.poly_all) 149 81 150 82 print 'Export combined DEM file' 151 #if access(project.topographies_dir,F_OK) == 0:152 # mkdir (project.topographies_dir)153 83 G_clipped.export_points_file(project.combined_dir_name + '.pts') 154 84 print 'Do txt version too' -
anuga_work/production/busselton/standardised_version/project.py
r6261 r6262 7 7 8 8 import os 9 from os import sep, environ, getenv, getcwd 10 from os.path import expanduser 11 import sys 9 from os import sep, getenv 12 10 from time import localtime, strftime, gmtime 13 from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon,number_mesh_triangles11 from anuga.utilities.polygon import read_polygon, number_mesh_triangles 14 12 from anuga.utilities.system_tools import get_user_name, get_host_name 15 from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary16 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon17 13 18 14 #------------------------------------------------------------------------------ -
anuga_work/production/busselton/standardised_version/run_busselton.py
r6261 r6262 16 16 """ 17 17 18 # Note repeated use of domain id19 # Note naming of fundamental datasets and directories20 21 22 18 #------------------------------------------------------------------------------ 23 19 # Import necessary modules … … 26 22 # Standard modules 27 23 import os 28 from os.path import dirname29 24 import time 30 25 … … 50 45 #----------------------------------------------------------------------- 51 46 52 #copy script must be before screen_catcher53 #copy_code_files(project.output_run_time_dir, __file__,54 #dirname(project.__file__)+os.sep+ project.__name__+'.py' )55 #start_screen_catcher(project.output_run_time_dir, myid, numprocs)47 copy script must be before screen_catcher 48 copy_code_files(project.output_run_time_dir, __file__, 49 os.path.dirname(project.__file__)+os.sep+ project.__name__+'.py' ) 50 start_screen_catcher(project.output_run_time_dir, myid, numprocs) 56 51 57 52 … … 133 128 'ocean': Bf}) 134 129 130 135 131 #------------------------------------------------------------------------- 136 132 # Evolve system through time
Note: See TracChangeset
for help on using the changeset viewer.