Changeset 6013
- Timestamp:
- Nov 28, 2008, 11:17:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r6011 r6013 2074 2074 def sww2csv_gauges(sww_file, 2075 2075 gauge_file, 2076 out_name=None, 2076 2077 quantities = ['stage', 'depth', 'elevation', 2077 2078 'xmomentum', 'ymomentum'], … … 2096 2097 NOTE: order of column can change but names eg 'easting', 'elevation' 2097 2098 must be the same! ALL lowercaps! 2099 2100 out_name: prefix for output file name (default is 'gauge_') 2098 2101 2099 2102 Outputs: 2100 2103 one file for each gauge/point location in the points file. They 2101 2104 will be named with this format in the same directory as the 'sww_file' 2102 gauge_<name>.csv eg gauge_point1.csv 2105 <out_name><name>.csv 2106 eg gauge_point1.csv if <out_name> not supplied 2107 myfile_2_point1.csv if <out_name> ='myfile_2_' 2108 2103 2109 2104 2110 They will all have a header … … 2133 2139 assert type(gauge_file) == type(''),\ 2134 2140 'Gauge filename must be a string' 2141 assert type(out_name) == type(''),\ 2142 'Output filename prefix must be a string' 2135 2143 2136 2144 try: … … 2208 2216 use_cache=use_cache) 2209 2217 2210 gauge_file='gauge_' 2218 if out_name is None: 2219 gauge_file='gauge_' 2220 else: 2221 gauge_file = out_name 2211 2222 2212 2223 heading = [quantity for quantity in quantities] … … 2219 2230 for i,point in enumerate(points): 2220 2231 #print 'gauge file:',dir_name+sep+'gauge_'+point_name[i]+'.csv' 2221 points_writer.append(writer(file(dir_name+sep+ 'gauge_'+point_name[i]+'.csv', "wb")))2232 points_writer.append(writer(file(dir_name+sep+gauge_file+point_name[i]+'.csv', "wb"))) 2222 2233 points_writer[i].writerow(heading) 2223 2234
Note: See TracChangeset
for help on using the changeset viewer.