Changeset 6290
- Timestamp:
- Feb 6, 2009, 9:41:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/australia_ph2/sydney/build_boundary_7875.py
r6288 r6290 3 3 WA, Australia. The boundary is based on the National Hazard Map. 4 4 5 Input: order_filename from project _250m.py6 event_number needs to be reflected in the project _250mfile7 Output: creates a sts file and csv files stored in project _250m.boundaries_dir_event.5 Input: order_filename from project.py 6 event_number needs to be reflected in the project file 7 Output: creates a sts file and csv files stored in project.boundaries_dir_event. 8 8 The run_sydney.py is reliant on the output of this script. 9 9 """ 10 10 import os 11 11 from os import sep 12 import project_250m 12 from os.path import join 13 import project 13 14 14 15 from anuga.utilities.numerical_tools import ensure_numeric … … 29 30 #-------------------------------------------------------------------------- 30 31 31 dir=os.path.join(project _250m.muxhome,'mux')32 dir=os.path.join(project.muxhome,'mux') 32 33 33 34 # Refer to event_07875.list in home+state+sep+event08 for event details … … 63 64 weights=weight_factor*ones(len(urs_filenames),Float) 64 65 65 scenario_name=project _250m.scenario_name66 order_filename=os.path.join(project_250m.urs_boundary_name)66 scenario_name=project.scenario_name 67 urs_order = join(project.urs_order) 67 68 68 print 'reading', order_filename 69 # Create ordered sts file 70 print 'creating sts file' 69 print 'reading', urs_order 71 70 72 71 urs2sts(urs_filenames, 73 basename_out =os.path.join(project_250m.boundaries_dir_event,scenario_name),74 ordering_filename =order_filename,75 weights =weights,76 mean_stage =project_250m.tide,77 verbose =True)72 basename_out = join(project.event_sts), 73 ordering_filename = urs_order, 74 weights = weights, 75 mean_stage = project.tide, 76 verbose = True) 78 77 else: 79 78 print 'number of sources do not match event.list' … … 99 98 quantities[name] = fid.variables[name][:] 100 99 101 #------------------------------------------------------------------------------102 # Get Maxium wave height throughout timeseries at each index point103 #------------------------------------------------------------------------------100 #------------------------------------------------------------------------------ 101 # Get Maxium wave height throughout timeseries at each index point 102 #------------------------------------------------------------------------------ 104 103 105 104 maxname = 'max_sts_stage.csv' 106 fid_max = open(project _250m.boundaries_dir_event+sep+maxname,'w')105 fid_max = open(project.boundaries_dir_event+sep+maxname,'w') 107 106 s = 'index, x, y, max_stage \n' 108 107 fid_max.write(s) … … 116 115 fid_max.write(s) 117 116 118 #------------------------------------------------------------------------------119 # Get Minium wave height throughout timeseries at each index point120 #------------------------------------------------------------------------------117 #------------------------------------------------------------------------------ 118 # Get Minium wave height throughout timeseries at each index point 119 #------------------------------------------------------------------------------ 121 120 122 121 minname = 'min_sts_stage.csv' 123 fid_min = open(project _250m.boundaries_dir_event+sep+minname,'w')122 fid_min = open(project.boundaries_dir_event+sep+minname,'w') 124 123 s = 'index, x, y, max_stage \n' 125 124 fid_min.write(s) … … 135 134 136 135 137 fid_sts = open(project _250m.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')136 fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w') 138 137 s = 'time, stage, xmomentum, ymomentum \n' 139 138 fid_sts.write(s) 140 139 141 #------------------------------------------------------------------------------142 # End of the get gauges143 #------------------------------------------------------------------------------140 #------------------------------------------------------------------------------ 141 # End of the get gauges 142 #------------------------------------------------------------------------------ 144 143 for k in range(len(time)-1): 145 144 s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k]) … … 153 152 return quantities,elevation,time 154 153 155 quantities,elevation,time=get_sts_gauge_data(os.path.join(project _250m.boundaries_dir_event,project_250m.scenario_name),verbose=False)154 quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir_event,project.scenario_name),verbose=False) 156 155 157 156 print len(elevation), len(quantities['stage'][0,:])
Note: See TracChangeset
for help on using the changeset viewer.