Changeset 2518
- Timestamp:
- Mar 9, 2006, 5:22:30 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/data_manager.py
r2516 r2518 1202 1202 # calculating number of NODATA_values for each row 1203 1203 nn = 0 1204 no_counts = []1205 1204 for i in range(nrows): 1206 v = dem_elevation_r[i,:] 1207 this_count = sum(v == NODATA_value) 1208 nn += this_count 1209 no_counts.append(this_count) 1210 1211 if verbose and nn > 0: 1212 print 'There are %d values in the elevation' %totalnopoints 1213 print 'There are %d NODATA_values in the elevation' %nn 1214 1205 y = (nrows-i)*cellsize + yllcorner 1206 for j in range(ncols): 1207 x = j*cellsize + xllcorner 1208 if easting_min <= x <= easting_max and \ 1209 northing_min <= y <= northing_max and \ 1210 dem_elevation_r[i,j] == NODATA_value: 1211 nn += 1 1212 1215 1213 # dimension definitions 1216 1214 nrows_in_bounding_box = int(round((northing_max-northing_min)/cellsize)) 1217 1215 ncols_in_bounding_box = int(round((easting_max-easting_min)/cellsize)) 1218 1219 nopoints = nrows_in_bounding_box*ncols_in_bounding_box-nn 1220 #nopoints = nrows_in_bounding_box*ncols_in_bounding_box 1216 1217 clippednopoints = nrows_in_bounding_box*ncols_in_bounding_box 1218 nopoints = clippednopoints-nn 1219 1220 if verbose and nn > 0: 1221 print 'There are %d values in the elevation' %totalnopoints 1222 print 'There are %d values in the clipped elevation' %clippednopoints 1223 print 'There are %d NODATA_values in the clipped elevation' %nn 1224 1221 1225 outfile.createDimension('number_of_points', nopoints) 1222 1226 outfile.createDimension('number_of_dimensions', 2) #This is 2d data … … 1239 1243 lower_index = global_index 1240 1244 1241 no_NODATA = no_counts[i] 1245 v = dem_elevation_r[i,:] 1246 no_NODATA = sum(v == NODATA_value) 1242 1247 if no_NODATA > 0: 1243 1248 newcols = ncols_in_bounding_box - no_NODATA … … 2290 2295 number_of_latitudes = latitudes.shape[0] 2291 2296 number_of_longitudes = longitudes.shape[0] 2292 2293 msg = 'No data received'2294 assert latitudes.shape[0] > 0, msg2295 assert longitudes.shape[0] > 0, msg2296 2297 2297 2298 assert amplitudes.shape[0] == number_of_times
Note: See TracChangeset
for help on using the changeset viewer.