[5572] | 1 | # -*- coding: cp1252 -*- |
---|
| 2 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 3 | """ |
---|
| 4 | |
---|
| 5 | from os import sep, environ, getenv, getcwd |
---|
| 6 | from os.path import expanduser |
---|
| 7 | import sys |
---|
| 8 | from time import localtime, strftime, gmtime |
---|
| 9 | from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles |
---|
| 10 | from anuga.utilities.system_tools import get_user_name, get_host_name |
---|
| 11 | from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary |
---|
| 12 | from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon |
---|
| 13 | |
---|
| 14 | # file and system info |
---|
| 15 | #--------------------------------- |
---|
| 16 | #codename = 'project.py' |
---|
| 17 | |
---|
| 18 | home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name() |
---|
| 19 | muxhome = getenv('MUXHOME') |
---|
| 20 | user = get_user_name() |
---|
| 21 | host = get_host_name() |
---|
| 22 | |
---|
| 23 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
| 24 | |
---|
| 25 | #time stuff |
---|
| 26 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 27 | gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
| 28 | build_time = time+'_build' |
---|
| 29 | run_time = time+'_run' |
---|
| 30 | print 'gtime: ', gtime |
---|
| 31 | |
---|
| 32 | #Making assumptions about the location of scenario data |
---|
| 33 | state = 'anuga_validation' |
---|
| 34 | scenario = 'benchmark_problem_4' |
---|
| 35 | sww_name = 'slide' |
---|
| 36 | |
---|
[5633] | 37 | friction=0.01 #basal friction |
---|
| 38 | starttime=0 |
---|
| 39 | finaltime=500 #duration of evolution |
---|
| 40 | remainder_res = 1. #area of mesh triangle in m*2 |
---|
| 41 | export_cellsize=25 #length along side of mesh triangle |
---|
[5572] | 42 | |
---|
| 43 | dir_comment='_'+'finaltime'+str(finaltime)+'_'+str(user) |
---|
| 44 | |
---|
| 45 | anuga_dir = home+state+sep+scenario+sep+'anuga'+sep |
---|
| 46 | |
---|
| 47 | meshes_dir = anuga_dir+'meshes'+sep |
---|
| 48 | meshes_dir_name = meshes_dir + sww_name |
---|
| 49 | |
---|
| 50 | polygons_dir = anuga_dir+'polygons'+sep |
---|
| 51 | |
---|
| 52 | #output locations |
---|
| 53 | output_dir = anuga_dir+'outputs'+sep |
---|
| 54 | output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep |
---|
| 55 | output_run_time_dir_name = output_run_time_dir + sww_name #Used by post processing |
---|
| 56 | |
---|
| 57 | #gauges |
---|
| 58 | gauge_name = 'gauge_location.csv' |
---|
| 59 | gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep |
---|
| 60 | gauges_dir_name = gauges_dir + gauge_name |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | ############################### |
---|
| 64 | # Interior region definitions |
---|
| 65 | ############################### |
---|
| 66 | |
---|
| 67 | #Initial bounding polygon for data clipping |
---|
| 68 | #poly_all = read_polygon(polygons_dir+'poly_all.csv') |
---|
| 69 | #res_poly_all = 100000 |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | ################################################################### |
---|
| 73 | # Clipping regions for export to asc and regions for clipping data |
---|
| 74 | ################################################################### |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | #Geordie Bay extract ascii grid |
---|
| 78 | xminGeordie = 358000 |
---|
| 79 | xmaxGeordie = 362000 |
---|
| 80 | yminGeordie = 6458500 |
---|
| 81 | ymaxGeordie = 6461000 |
---|
| 82 | |
---|
| 83 | #Sorrento extract ascii grid |
---|
| 84 | xminSorrento = 379000 |
---|
| 85 | xmaxSorrento = 382500 |
---|
| 86 | yminSorrento = 6477000 |
---|
| 87 | ymaxSorrento = 6480000 |
---|
| 88 | |
---|
| 89 | #Fremantle extract ascii grid |
---|
| 90 | xminFremantle = 376000 |
---|
| 91 | xmaxFremantle = 388000 |
---|
| 92 | yminFremantle = 6449000 |
---|
| 93 | ymaxFremantle = 6461000 |
---|
| 94 | |
---|
| 95 | #Rockingham extract ascii grid |
---|
| 96 | xminRockingham = 373500 |
---|
| 97 | xmaxRockingham = 385500 |
---|
| 98 | yminRockingham = 6424000 |
---|
| 99 | ymaxRockingham = 6433000 |
---|
| 100 | |
---|