Ignore:
Timestamp:
Aug 8, 2007, 9:39:22 AM (17 years ago)
Author:
duncan
Message:

working on ticket#176

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4663 r4665  
    21752175        ascid.close()
    21762176        fid.close()
    2177 
    21782177        return basename_out
    21792178
     
    49074906        If you get both, do a convertion from the old to the new.
    49084907       
    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
    49104910       
    49114911        if you only get the current_origin the points are relative, store
     
    49284928       
    49294929        number_of_points = len(points_utm)   
    4930         volumes = array(volumes)
     4930        volumes = array(volumes) 
     4931        points_utm = array(points_utm)
    49314932
    49324933        # given the two geo_refs and the points, do the stuff
     
    49514952   
    49524953        # 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       
    49544956        x =  points[:,0]
    49554957        y =  points[:,1]
     
    51225124        #Title
    51235125        fid.write('time' +d+ 'HA depth m'+d+ \
    5124                       'UA momentum East x m/sec' +d+ 'VA momentum North y m/sec' \
     5126                 'UA momentum East x m/sec' +d+ 'VA momentum North y m/sec' \
    51255127                      + "\n")
    51265128        for HA, UA, VA in map(None, mux['HA'], mux['UA'], mux['VA']):
     
    52315233    if extra_info <>'':
    52325234        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)
    52355241    print screen_output_name
    52365242    #used to catch screen output to file
     
    53235329    might be a better way to do this using CSV module Writer and writeDict
    53245330   
    5325     writes file to "output_dir" unless "completed" is in kwargs, then it writes to
    5326     "file_name" kwargs
     5331    writes file to "output_dir" unless "completed" is in kwargs, then
     5332    it writes to "file_name" kwargs
    53275333
    53285334    """
     
    54015407        fid.close()
    54025408    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
    54045411        #end of details_temp.cvs file in output directory
    54055412        file = str(kwargs['output_dir'])+'detail_temp.csv'
     
    54315438                                                 verbose=False)
    54325439
    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
    54355443    to a points that lie within the specified polygon and time interval.
    54365444
     
    54655473
    54665474    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
    54685477    to a points that lie within the specified polygon and time interval.
    54695478
     
    54955504   
    54965505
    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
    54985508    except that this function works with the sww file and computes the maximal
    54995509    runup height over multiple timesteps.
    55005510   
    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
    55035515    assumed to be in (absolute) UTM coordinates in the same zone as domain.
    55045516
     
    55615573   
    55625574   
    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
    55645577        # but is probably something we need to write in C.
    55655578        # Here's a Python thought which is NOT finished!!!
     
    55745587            msg = 'polygon must be a sequence of points.'
    55755588            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
    55775591           
    55785592            points = concatenate((x[:,NewAxis], y[:,NewAxis]), axis=1)
     
    56005614            msg = 'time_interval must be a sequence of length 2.'
    56015615            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)
    56035617            assert time_interval[1] >= time_interval[0], msg
    56045618           
     
    56335647        for i in timesteps:
    56345648            if use_centroid_values is True:
    5635                 stage_i = get_centroid_values(stage[i,:], volumes)                
     5649                stage_i = get_centroid_values(stage[i,:], volumes)   
    56365650            else:
    56375651                stage_i = stage[i,:]
Note: See TracChangeset for help on using the changeset viewer.