Changeset 4706
- Timestamp:
- Sep 5, 2007, 5:36:27 PM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4705 r4706 351 351 N = len(poly) 352 352 fid.createDimension('polygon_length', N) 353 fid.createVariable('extrema :polygon',353 fid.createVariable('extrema.polygon', 354 354 self.precision, 355 355 ('polygon_length', 356 356 'two')) 357 fid.variables['extrema:polygon'][:] = poly 357 fid.variables['extrema.polygon'][:] = poly 358 358 359 359 360 interval = domain.monitor_time_interval 360 361 if interval is not None: 361 fid.createVariable('extrema :time_interval',362 fid.createVariable('extrema.time_interval', 362 363 self.precision, 363 364 ('two',)) 364 fid.variables['extrema:time_interval'][:] = interval 365 366 365 fid.variables['extrema.time_interval'][:] = interval 367 366 368 367 369 368 for q in domain.quantities_to_be_monitored: 370 369 #print 'doing', q 371 fid.createVariable(q+' :extrema', self.precision,370 fid.createVariable(q+'.extrema', self.precision, 372 371 ('numbers_in_range',)) 373 fid.createVariable(q+' :min_location', self.precision,372 fid.createVariable(q+'.min_location', self.precision, 374 373 ('numbers_in_range',)) 375 fid.createVariable(q+' :max_location', self.precision,374 fid.createVariable(q+'.max_location', self.precision, 376 375 ('numbers_in_range',)) 377 fid.createVariable(q+' :min_time', self.precision,376 fid.createVariable(q+'.min_time', self.precision, 378 377 ('singleton',)) 379 fid.createVariable(q+' :max_time', self.precision,378 fid.createVariable(q+'.max_time', self.precision, 380 379 ('singleton',)) 381 380 … … 582 581 583 582 if info['min'] is not None: 584 fid.variables[q + ' :extrema'][0] = info['min']585 fid.variables[q + ' :min_location'][:] =\583 fid.variables[q + '.extrema'][0] = info['min'] 584 fid.variables[q + '.min_location'][:] =\ 586 585 info['min_location'] 587 fid.variables[q + ' :min_time'][0] = info['min_time']586 fid.variables[q + '.min_time'][0] = info['min_time'] 588 587 589 588 if info['max'] is not None: 590 fid.variables[q + ' :extrema'][1] = info['max']591 fid.variables[q + ' :max_location'][:] =\589 fid.variables[q + '.extrema'][1] = info['max'] 590 fid.variables[q + '.max_location'][:] =\ 592 591 info['max_location'] 593 fid.variables[q + ' :max_time'][0] = info['max_time']592 fid.variables[q + '.max_time'][0] = info['max_time'] 594 593 595 594 -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r4705 r4706 304 304 305 305 # Get the variables 306 extrema = fid.variables['stage-elevation :extrema'][:]306 extrema = fid.variables['stage-elevation.extrema'][:] 307 307 assert allclose(extrema, [0.00, 0.30]) 308 308 309 loc = fid.variables['stage-elevation :min_location'][:]309 loc = fid.variables['stage-elevation.min_location'][:] 310 310 assert allclose(loc, [0.16666667, 0.33333333]) 311 311 312 loc = fid.variables['stage-elevation :max_location'][:]312 loc = fid.variables['stage-elevation.max_location'][:] 313 313 assert allclose(loc, [0.8333333, 0.16666667]) 314 314 315 time = fid.variables['stage-elevation :max_time'][:]315 time = fid.variables['stage-elevation.max_time'][:] 316 316 assert allclose(time, 0.0) 317 317 318 extrema = fid.variables['xmomentum :extrema'][:]318 extrema = fid.variables['xmomentum.extrema'][:] 319 319 assert allclose(extrema,[-0.06062178, 0.47886313]) 320 320 321 extrema = fid.variables['ymomentum :extrema'][:]321 extrema = fid.variables['ymomentum.extrema'][:] 322 322 assert allclose(extrema,[0.00, 0.06241221]) 323 323 324 time_interval = fid.variables['extrema :time_interval'][:]324 time_interval = fid.variables['extrema.time_interval'][:] 325 325 assert allclose(time_interval, [0,1]) 326 326 327 polygon = fid.variables['extrema :polygon'][:]327 polygon = fid.variables['extrema.polygon'][:] 328 328 assert allclose(polygon, domain.get_boundary_polygon()) 329 329
Note: See TracChangeset
for help on using the changeset viewer.