Changeset 981
- Timestamp:
- Mar 1, 2005, 1:31:28 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/data_manager.py
r980 r981 1144 1144 Lat and lon are assuemd to be in decimal degrees 1145 1145 1146 origin is a 5-tuple with geo referenced1147 UTM coordinates (zone, easting, northing , false_easting, false_northing)1146 origin is a 3-tuple with geo referenced 1147 UTM coordinates (zone, easting, northing) 1148 1148 1149 1149 nc format has values organised as HA[TIME, LATITUDE, LONGITUDE] -
inundation/ga/storm_surge/pyvolution/documentation/assumptions.txt
r980 r981 14 14 one UTM zone. However, the computation will use that of the mesh. 15 15 16 The dataflow is: (See data_manager.py )16 The dataflow is: (See data_manager.py and from scenarios) 17 17 18 18 19 Simulation scenarios 20 -------------------- 21 22 23 Sub directories contain scrips and derived files for each simulation. 24 The directory ../source_data contains large source files such as 25 DEMs provided externally as well as MOST tsunami simulations to be used 26 as boundary conditions. 27 28 Manual steps are: 29 Creation of DEMs from argcview (.asc + .prj) 30 Creation of mesh from pmesh (.tsh) 31 Creation of tsunami simulations from MOST (.nc) 32 33 34 Typical scripted steps are 35 36 prepare_dem.py: Convert asc and prj files supplied by arcview to 37 native dem and pts formats 38 39 prepare_pts.py: Convert netcdf output from MOST to an sww file suitable 40 as boundary condition 41 42 prepare_mesh.py: Merge DEM (pts) and mesh (tsh) using least squares 43 smoothing. The outputs are tsh files with elevation data. 44 45 run_simulation.py: Use the above together with various parameters to 46 run inundation simluation. 47 19 48 20 49 -
inundation/ga/storm_surge/pyvolution/least_squares.py
r976 r981 60 60 alpha=DEFAULT_ALPHA, verbose= False, 61 61 expand_search = False, 62 origin = None,63 mesh_origin =None):62 data_origin = None, 63 mesh_origin = None): 64 64 """ 65 65 Given a mesh file (tsh) and a point attribute file (xya), fit … … 67 67 results. 68 68 69 If origin is not None it is assumed to be 70 a 5-tuple with geo referenced 71 UTM coordinates (zone, easting, northing, false_easting, false_northing) 69 70 If data_origin is not None it is assumed to be 71 a 3-tuple with geo referenced 72 UTM coordinates (zone, easting, northing) 72 73 73 74 mesh_origin is the same but refers to the input tsh file. 74 FIXME: When that format contains it own origin, this parameter can go. 75 FIXME: When the tsh format contains it own origin, these parameters can go. 76 FIXME: And both origins should be obtained from the specified files. 75 77 """ 76 78 … … 80 82 81 83 # load in the .tsh file 84 #FIXME (Ole): mesh_origin should be extracted here 82 85 mesh_dict = mesh_file_to_mesh_dictionary(mesh_file) 83 86 vertex_coordinates = mesh_dict['vertices'] … … 88 91 if verbose:print "tsh file loaded" 89 92 90 # load in the . xyafile91 #FIXME (Ole): Maybe dataorigin should be extracted here93 # load in the .pts file 94 #FIXME (Ole): data_origin should be extracted here 92 95 try: 93 96 point_dict = load_points_file(point_file,delimiter = ',') … … 98 101 if verbose: print "points file loaded" 99 102 100 101 103 102 104 if verbose:print "fitting to mesh" … … 107 109 alpha = alpha, 108 110 verbose = verbose, 109 expand_search = expand_search) 111 expand_search = expand_search, 112 data_origin = data_origin, 113 mesh_origin = mesh_origin) 110 114 if verbose:print "finished fitting to mesh" 111 115 … … 124 128 mesh_dict['vertex_attributes'] = new_point_attributes 125 129 mesh_dict['vertex_attribute_titles'] = title_list 126 130 131 #FIXME (Ole): Remember to output mesh_origin as well 127 132 export_triangulation_file(mesh_output_file, mesh_dict) 128 133 … … 134 139 alpha = DEFAULT_ALPHA, 135 140 verbose = False, 136 expand_search = False): 141 expand_search = False, 142 data_origin = None, 143 mesh_origin = None): 137 144 """ 138 145 Fit a smooth surface to a triangulation, … … 154 161 155 162 point_attributes: Vector or array of data at the point_coordinates. 163 164 data_origin and mesh_origin are 3-tuples consisting of 165 UTM zone, easting and northing. If specified 166 point coordinates and vertex coordinates are assumed to be 167 relative to their respective origins. 168 156 169 """ 157 170 interp = Interpolation(vertex_coordinates, … … 160 173 alpha = alpha, 161 174 verbose = verbose, 162 expand_search = expand_search) 175 expand_search = expand_search, 176 data_origin = data_origin, 177 mesh_origin = mesh_origin) 163 178 # expand_search = False) 164 179
Note: See TracChangeset
for help on using the changeset viewer.