Changeset 4665 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Aug 8, 2007, 9:39:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4663 r4665 2175 2175 ascid.close() 2176 2176 fid.close() 2177 2178 2177 return basename_out 2179 2178 … … 4907 4906 If you get both, do a convertion from the old to the new. 4908 4907 4909 If you only get new_origin, the points are absolute, convert to relative 4908 If you only get new_origin, the points are absolute, 4909 convert to relative 4910 4910 4911 4911 if you only get the current_origin the points are relative, store … … 4928 4928 4929 4929 number_of_points = len(points_utm) 4930 volumes = array(volumes) 4930 volumes = array(volumes) 4931 points_utm = array(points_utm) 4931 4932 4932 4933 # given the two geo_refs and the points, do the stuff … … 4951 4952 4952 4953 # This will put the geo ref in the middle 4953 #geo_ref = Geo_reference(refzone,(max(x)+min(x))/2.0,(max(x)+min(y))/2.) 4954 #geo_ref=Geo_reference(refzone,(max(x)+min(x))/2.0,(max(x)+min(y))/2.) 4955 4954 4956 x = points[:,0] 4955 4957 y = points[:,1] … … 5122 5124 #Title 5123 5125 fid.write('time' +d+ 'HA depth m'+d+ \ 5124 5126 'UA momentum East x m/sec' +d+ 'VA momentum North y m/sec' \ 5125 5127 + "\n") 5126 5128 for HA, UA, VA in map(None, mux['HA'], mux['UA'], mux['VA']): … … 5231 5233 if extra_info <>'': 5232 5234 extra_info = '_'+str(extra_info) 5233 screen_output_name = dir_name + "screen_output%s%s%s.txt" %(myid,numprocs,extra_info) 5234 screen_error_name = dir_name + "screen_error%s%s%s.txt" %(myid,numprocs,extra_info) 5235 screen_output_name = dir_name + "screen_output%s%s%s.txt" %(myid, 5236 numprocs, 5237 extra_info) 5238 screen_error_name = dir_name + "screen_error%s%s%s.txt" %(myid, 5239 numprocs, 5240 extra_info) 5235 5241 print screen_output_name 5236 5242 #used to catch screen output to file … … 5323 5329 might be a better way to do this using CSV module Writer and writeDict 5324 5330 5325 writes file to "output_dir" unless "completed" is in kwargs, then it writes to5326 "file_name" kwargs5331 writes file to "output_dir" unless "completed" is in kwargs, then 5332 it writes to "file_name" kwargs 5327 5333 5328 5334 """ … … 5401 5407 fid.close() 5402 5408 else: 5403 #backup plan, if header is different and has completed will append info to 5409 #backup plan, 5410 # if header is different and has completed will append info to 5404 5411 #end of details_temp.cvs file in output directory 5405 5412 file = str(kwargs['output_dir'])+'detail_temp.csv' … … 5431 5438 verbose=False) 5432 5439 5433 filename is a NetCDF sww file containing ANUGA model output. 5434 Optional arguments polygon and time_interval restricts the maximum runup calculation 5440 filename is a NetCDF sww file containing ANUGA model output. 5441 Optional arguments polygon and time_interval restricts the maximum 5442 runup calculation 5435 5443 to a points that lie within the specified polygon and time interval. 5436 5444 … … 5465 5473 5466 5474 filename is a NetCDF sww file containing ANUGA model output. 5467 Optional arguments polygon and time_interval restricts the maximum runup calculation 5475 Optional arguments polygon and time_interval restricts the maximum 5476 runup calculation 5468 5477 to a points that lie within the specified polygon and time interval. 5469 5478 … … 5495 5504 5496 5505 5497 Algorithm is as in get_maximum_inundation_elevation from shallow_water_domain 5506 Algorithm is as in get_maximum_inundation_elevation from 5507 shallow_water_domain 5498 5508 except that this function works with the sww file and computes the maximal 5499 5509 runup height over multiple timesteps. 5500 5510 5501 Optional arguments polygon and time_interval restricts the maximum runup calculation 5502 to a points that lie within the specified polygon and time interval. Polygon is 5511 Optional arguments polygon and time_interval restricts the 5512 maximum runup calculation 5513 to a points that lie within the specified polygon and time interval. 5514 Polygon is 5503 5515 assumed to be in (absolute) UTM coordinates in the same zone as domain. 5504 5516 … … 5561 5573 5562 5574 5563 # Here's where one could convert nodal information to centroid information 5575 # Here's where one could convert nodal information to centroid 5576 # information 5564 5577 # but is probably something we need to write in C. 5565 5578 # Here's a Python thought which is NOT finished!!! … … 5574 5587 msg = 'polygon must be a sequence of points.' 5575 5588 assert len(polygon[0]) == 2, msg 5576 # FIXME (Ole): Make a generic polygon input check in polygon.py and call it here 5589 # FIXME (Ole): Make a generic polygon input check in polygon.py 5590 # and call it here 5577 5591 5578 5592 points = concatenate((x[:,NewAxis], y[:,NewAxis]), axis=1) … … 5600 5614 msg = 'time_interval must be a sequence of length 2.' 5601 5615 assert len(time_interval) == 2, msg 5602 msg = 'time_interval %s must not be decreasing.' %(time_interval) 5616 msg = 'time_interval %s must not be decreasing.' %(time_interval) 5603 5617 assert time_interval[1] >= time_interval[0], msg 5604 5618 … … 5633 5647 for i in timesteps: 5634 5648 if use_centroid_values is True: 5635 stage_i = get_centroid_values(stage[i,:], volumes) 5649 stage_i = get_centroid_values(stage[i,:], volumes) 5636 5650 else: 5637 5651 stage_i = stage[i,:]
Note: See TracChangeset
for help on using the changeset viewer.