source: anuga_work/production/perth_2006/project.py @ 4219

Last change on this file since 4219 was 4147, checked in by sexton, 18 years ago

(1) updates to Dampier script based on Perth script (2) minor updates to Onslow report

File size: 5.5 KB
RevLine 
[3908]1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser
7import sys
8from time import localtime, strftime, gmtime
[4133]9from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
[3908]10#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
[4080]11from anuga.utilities.system_tools import get_user_name
[3908]12
[4077]13# file and system info
14#---------------------------------
15codename = 'project.py'
[3908]16
[4077]17home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
18user = get_user_name()
[3908]19
20# INUNDATIONHOME is the inundation directory, not the data directory.
21home += sep +'data'
22
[4080]23#time stuff
24time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
26build_time = time+'_build'
27run_time = time+'_run'
28print 'gtime: ', gtime
29
[4081]30tide = 0.6
31
[3908]32#Making assumptions about the location of scenario data
33state = 'western_australia'
[4077]34scenario_name = 'perth'
[4080]35scenario = 'perth_tsunami_scenario_2006'
[3908]36
37# onshore data provided by WA DLI
[4077]38onshore_name = 'perth_dli_ext' # original
39#island
40island_name = 'rott_dli_ext' # original
41island_name1 = 'gard_dli_ext'
42island_name2 = 'carnac_island_dted'
[4080]43island_name3 = 'penguin_dted'
[3908]44
[4147]45# AHO + DPI data + colin French coastline
[4077]46coast_name = 'waterline'
47offshore_name = 'perth_bathymetry'
[4091]48offshore1_name = 'missing_fairsheets'
[3908]49
[4077]50#final topo name
51combined_name ='perth_combined_elevation'
[4091]52combined_smaller_name = 'perth_combined_elevation_smaller'
[3908]53
[4091]54
[4080]55topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
56topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
[4077]57topographies_time_dir = topographies_dir+build_time+sep
[3908]58
[4147]59# input topo file location
[4080]60onshore_in_dir_name = topographies_in_dir + onshore_name
61island_in_dir_name = topographies_in_dir + island_name
62island_in_dir_name1 = topographies_in_dir + island_name1
63island_in_dir_name2 = topographies_in_dir + island_name2
64island_in_dir_name3 = topographies_in_dir + island_name3
65
66coast_in_dir_name = topographies_in_dir + coast_name
67offshore_in_dir_name = topographies_in_dir + offshore_name
[4091]68offshore1_in_dir_name = topographies_in_dir + offshore1_name
[4080]69
[4077]70onshore_dir_name = topographies_dir + onshore_name
71island_dir_name = topographies_dir + island_name
72island_dir_name1 = topographies_dir + island_name1
73island_dir_name2 = topographies_dir + island_name2
[4080]74island_dir_name3 = topographies_dir + island_name3
[3908]75
[4077]76coast_dir_name = topographies_dir + coast_name
77offshore_dir_name = topographies_dir + offshore_name
78
79#final topo files
80combined_dir_name = topographies_dir + combined_name
81combined_time_dir_name = topographies_time_dir + combined_name
[4091]82combined_smaller_name_dir = topographies_dir + combined_smaller_name
[4080]83#combined_time_dir_final_name = topographies_time_dir + combined_final_name
[4077]84
85
[3908]86
[4080]87meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep
[4077]88meshes_dir_name = meshes_dir + scenario_name
[3908]89
[4080]90polygons_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'polygons'+sep
91tide_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'tide_data'+sep
[3908]92
[4080]93
[4091]94boundaries_source = '????'
[4077]95#boundaries locations
[4080]96boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
97boundaries_in_dir_name = boundaries_in_dir + scenario_name
98boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep
99boundaries_dir_name = boundaries_dir + scenario_name
100#boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
[4077]101#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
[3908]102
[4077]103#output locations
[4080]104output_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep
105output_build_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+build_time+sep
106output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep
[4077]107output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
108
109#gauges
110gauge_name = 'perth.csv'
[4080]111gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
[4077]112gauges_dir_name = gauges_dir + gauge_name
113
114
[3908]115###############################
116# Domain definitions
117###############################
[4077]118from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
[3908]119
[4133]120poly_all = read_polygon(polygons_dir+'bounding_poly.csv')
121res_poly_all = 100000
[3908]122
[4077]123refzone = 50 
[3908]124
125
[4091]126###############################
127# Interior region definitions
128###############################
[4077]129
[4133]130#poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv')
131poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20_new_pts.csv')
132res_pos20_neg20 = 20000
[4077]133
[4133]134#poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv')
135poly_cbd = read_polygon(polygons_dir+'cbd_new_pts.csv')
136res_cbd = 1000
[4077]137
138poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
[4133]139res_penguin = 1000
[4080]140#assert zone == refzone
[4077]141
[4133]142interior_regions = [[poly_pos20_neg20,res_pos20_neg20],[poly_cbd,res_cbd]
143                     ,[poly_penguin,res_penguin]]
[4077]144
[4133]145trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
146
[4091]147print 'min number triangles', trigs_min
[4081]148
[3908]149###################################################################
150# Clipping regions for export to asc and regions for clipping data
151###################################################################
[4091]152
[3908]153# exporting asc grid
154eastingmin = 406215.87
155eastingmax = 440208.78
156northingmin = 7983427.73
157northingmax = 8032834.52
158
159
160
Note: See TracBrowser for help on using the repository browser.