Changeset 2556
- Timestamp:
- Mar 17, 2006, 3:38:41 PM (18 years ago)
- Location:
- production/onslow_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
production/onslow_2006/project.py
r2543 r2556 11 11 12 12 from coordinate_transforms.redfearn import degminsec2decimal_degrees 13 14 from time import localtime, strftime 15 16 from os import getcwd 17 13 18 14 19 #Making assumptions about the location of scenario data 15 20 scenario_dir_name = 'onslow_tsunami_scenario_2006' 16 17 21 18 22 # 250m data to be provided … … 24 28 25 29 boundary_basename = 'SU-AU' 30 31 #swollen/ all data output 32 basename = 'source' 33 34 codename = 'project.py' 35 36 if sys.platform == 'win32': 37 home = environ['INUNDATIONHOME'] #Sandpit's parent dir 38 else: 39 home = expanduser('~') 40 41 #Derive subdirectories and filenames 42 43 44 meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep 45 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep 46 47 timedir = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 48 outputdir = home+sep+scenario_dir_name+sep+'output'+sep+timedir+sep 49 polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep 50 boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep 51 52 codedir = getcwd()+sep 53 codedirname = codedir + 'project.py' 54 55 meshname = meshdir + basename 56 57 coarsedemname = datadir + coarsename 58 59 onshore_dem_name = datadir + onshore_name 60 61 combineddemname = datadir + 'onslow_combined_elevation' 62 63 outputname = outputdir + basename #Used by post processing 64 65 #!gauge_filename = outputdir + 'onslow_gauges.xya' 66 #!gauge_outname = outputdir + 'gauges_max_output.xya' 26 67 27 68 # clipping region for fine elevation data … … 37 78 38 79 # region for visualisation 39 eminviz = 40 emaxviz = 41 nminviz = 42 nmaxviz = 43 44 #swollen/ all data output 45 basename = 'source_fine_clipped' 46 47 if sys.platform == 'win32': 48 home = environ['INUNDATIONHOME'] #Sandpit's parent dir 49 else: 50 home = expanduser('~') 51 52 #Derive subdirectories and filenames 53 meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep 54 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep 55 outputdir = home+sep+scenario_dir_name+sep+'output'+sep 56 polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep 57 boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep 58 59 meshname = meshdir + basename 60 61 coarsedemname = datadir + coarsename 62 63 onshore_dem_name = datadir + onshore_name 64 65 combineddemname = datadir + 'onslow_combined_elevation' 66 67 outputname = outputdir + basename #Used by post processing 68 69 #!gauge_filename = outputdir + 'onslow_gauges.xya' 70 #!gauge_outname = outputdir + 'gauges_max_output.xya' 80 eminviz = 260000 81 emaxviz = 320000 82 nminviz = 7590000 83 nmaxviz = 7630000 71 84 72 85 #Georeferencing … … 112 125 poly_direction = [k0, k1, k2, k3] 113 126 114 testpoly = [p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30]115 #!slump_origin = [385000.0, 6255000.0] #Absolute UTM -
production/onslow_2006/run_onslow.py
r2554 r2556 31 31 from smf import slump_tsunami # Function for submarine mudslide 32 32 33 from shutil import copy 34 from os import mkdir, access, F_OK 33 35 34 36 #------------------------------------------------------------------------------ … … 48 50 49 51 source_dir = project.boundarydir 52 53 #if dir doesn't exists then makes dir 54 if access(project.outputdir,F_OK) == 0 : 55 mkdir (project.outputdir) 56 # creates copy of code in output dir 57 copy (project.codedirname, project.outputdir + project.codename) 58 copy (project.codedir + 'run_onslow.py', project.outputdir + 'run_onlsow.py') 59 print "copied to"+ project.outputdir + project.codename + 'and run_onlsow.py' 50 60 51 61 # coarse data … … 65 75 66 76 # combining the coarse and fine data 67 combine_rectangular_points_files(project.coarsedemname + '.pts', 77 # NOTE MUST HAVE FINE FIRST! 78 combine_rectangular_points_files( 68 79 project.onshore_dem_name + '.pts', 80 project.coarsedemname + '.pts', 69 81 project.combineddemname + '.pts') 70 82 71 83 72 #------------------------------------------------------------------------------ 84 85 #------------------------------------------------------------------------------- 73 86 # Create the triangular mesh based on overall clipping polygon with a tagged 74 87 # boundary and interior regions defined in project.py along with … … 164 177 source_dir + project.boundary_basename), 165 178 {'verbose': True, 179 # note didn't work with the below 166 180 # 'minlat': south - 1, 167 181 # 'maxlat': north + 1,
Note: See TracChangeset
for help on using the changeset viewer.