Changeset 1141 for inundation/ga/storm_surge/pyvolution/data_manager.py
- Timestamp:
- Mar 24, 2005, 1:49:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/data_manager.py
r1140 r1141 1121 1121 1122 1122 #Get quantity and reduce if applicable 1123 if verbose: print 'Reading quantity %s' %quantity 1123 1124 q = fid.variables[quantity][:] 1124 1125 1125 1126 1126 1127 if len(q.shape) == 2: 1128 if verbose: print 'Reducing quantity %s' %quantity 1127 1129 q_reduced = zeros( number_of_points, Float ) 1128 1130 … … 1133 1135 1134 1136 #Now q has dimension: number_of_points 1137 1135 1138 1136 1139 #Write prj file 1140 if verbose: print 'Writing %s' %prjfile 1137 1141 prjid = open(prjfile, 'w') 1138 1142 prjid.write('Projection %s\n' %'UTM') … … 1148 1152 1149 1153 #Create grid 1154 if verbose: print 'Creating grid' 1150 1155 ncols = int((xmax-xmin)/cellsize)+1 1151 1156 nrows = int((ymax-ymin)/cellsize)+1 … … 1166 1171 1167 1172 #Interpolate 1173 1168 1174 from least_squares import Interpolation 1169 1175 from util import inside_polygon 1170 1176 1171 1177 interp = Interpolation(vertex_points, volumes, grid_points, alpha=0.0, 1172 precrop = False )1178 precrop = False, verbose = verbose) 1173 1179 1174 1180 #Interpolate using quantity values 1181 if verbose: print 'Interpolating' 1175 1182 grid_values = interp.interpolate(q).flat 1176 1183 1177 1184 #Write 1185 if verbose: print 'Writing %s' %ascfile 1178 1186 ascid = open(ascfile, 'w') 1179 1187
Note: See TracChangeset
for help on using the changeset viewer.