Changeset 1379


Ignore:
Timestamp:
May 12, 2005, 12:16:50 PM (20 years ago)
Author:
duncan
Message:

IO method name changes

Location:
inundation/ga/storm_surge/pyvolution
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/check_sww_tsh.py

    r966 r1379  
    66
    77import data_manager
    8 from load_mesh.loadASCII import import_mesh, import_triangulation
     8from load_mesh.loadASCII import import_mesh_file
    99from shallow_water import Domain
    1010from pmesh2domain import pmesh_to_domain_instance
  • inundation/ga/storm_surge/pyvolution/combine_pts.py

    r1101 r1379  
    2020                                     verbose = False):
    2121   
    22     from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points
     22    from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points
    2323
    2424   
    2525    # load fine points file
    2626    if verbose:print "loading Point files"
    27     try:
    28         fine = load_points_file(fine_points_file,delimiter = ',')
    29     except SyntaxError,e:
    30         fine = load_points_file(fine_points_file,delimiter = ' ')
    31    
     27    fine = import_points_file(fine_points_file)
    3228   
    3329    # load course points file
    34     try:
    35         coarse = load_points_file(coarse_points_file,
    36                                               delimiter = ',')
    37     except SyntaxError,e:
    38         coarse = load_points_file(coarse_points_file,
    39                                               delimiter = ' ')
     30    coarse = import_points_file(coarse_points_file)
    4031       
    4132    if verbose:print "doing other stuff"
     
    7869    # save
    7970    if verbose:print "writing points"
    80     write_pts(output_points_file, combined)
     71    export_points_file(output_points_file, combined)
    8172
    8273def add_points_files(fine_points_file,
     
    8576                                     verbose = False):
    8677   
    87     from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points
     78    from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points
    8879
    8980   
     
    9182    if verbose:print "loading Point files"
    9283    try:
    93         fine = load_points_file(fine_points_file,delimiter = ',')
     84        fine = import_points_file(fine_points_file,delimiter = ',')
    9485    except SyntaxError,e:
    95         fine = load_points_file(fine_points_file,delimiter = ' ')
     86        fine = import_points_file(fine_points_file,delimiter = ' ')
    9687   
    9788   
    9889    # load course points file
    9990    try:
    100         coarse = load_points_file(coarse_points_file,
     91        coarse = import_points_file(coarse_points_file,
    10192                                              delimiter = ',')
    10293    except SyntaxError,e:
    103         coarse = load_points_file(coarse_points_file,
     94        coarse = import_points_file(coarse_points_file,
    10495                                              delimiter = ' ')
    10596       
     
    127118    # save
    128119    if verbose:print "writing points"
    129     write_pts(output_points_file, combined)
     120    export_points_file(output_points_file, combined)
    130121
    131122def reduce_points_to_mesh_extent(points_file,
     
    134125                                     verbose = False):
    135126   
    136     from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points, mesh_file_to_mesh_dictionary
     127    from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points, mesh_file_to_mesh_dictionary
    137128
    138129   
    139130    # load  points file
    140131    try:
    141         points = load_points_file(points_file,delimiter = ',')
     132        points = import_points_file(points_file,delimiter = ',')
    142133    except SyntaxError,e:
    143         points = load_points_file(points_file,delimiter = ' ')
     134        points = import_points_file(points_file,delimiter = ' ')
    144135   
    145136    # load  mesh file
     
    165156
    166157    # save the list, along with geo-ref
    167     write_pts(output_points_file,points)
     158    export_points_file(output_points_file,points)
    168159   
    169160    #-------------------------------------------------------------
  • inundation/ga/storm_surge/pyvolution/interpolate_sww.py

    r1219 r1379  
    132132                             (w.r.t. time) are needed
    133133        """
    134         from load_mesh.loadASCII import load_points_file
    135        
    136         point_dict = load_points_file(point_file)
     134        from load_mesh.loadASCII import import_points_file
     135       
     136        point_dict = import_points_file(point_file)
    137137        return point_dict['pointlist']
    138138
  • inundation/ga/storm_surge/pyvolution/least_squares.py

    r1178 r1379  
    7777
    7878    from load_mesh.loadASCII import mesh_file_to_mesh_dictionary, \
    79                  load_points_file, export_mesh_file, \
     79                 import_points_file, export_mesh_file, \
    8080                 concatinate_attributelist
    8181
     
    9797    # load in the .pts file
    9898    try:
    99         point_dict = load_points_file(point_file,
     99        point_dict = import_points_file(point_file,
    100100                                      delimiter = ',',
    101101                                      verbose=verbose)
    102102    except SyntaxError,e:
    103         point_dict = load_points_file(point_file,
     103        point_dict = import_points_file(point_file,
    104104                                      delimiter = ' ',
    105105                                      verbose=verbose)
  • inundation/ga/storm_surge/pyvolution/test_combine_pts.py

    r1184 r1379  
    1212from coordinate_transforms.geo_reference import Geo_reference
    1313from combine_pts import *
    14 from load_mesh.loadASCII import load_points_file
     14from load_mesh.loadASCII import import_points_file
    1515
    1616class Test_combine_pts(unittest.TestCase):
     
    2424
    2525    def test_combine_rectangular_points_files(self):
    26         from load_mesh.loadASCII import write_pts
     26        from load_mesh.loadASCII import export_points_file
    2727        import tempfile
    2828        import os
     
    3939       
    4040        fine_file = tempfile.mktemp(".pts")
    41         write_pts(fine_file, fine_dict)
     41        export_points_file(fine_file, fine_dict)
    4242
    4343
     
    5252       
    5353        coarse_file = tempfile.mktemp(".pts")
    54         write_pts(coarse_file, coarse_dict)
     54        export_points_file(coarse_file, coarse_dict)
    5555       
    5656        out_file = tempfile.mktemp(".pts")
     
    6262        os.remove(coarse_file)
    6363
    64         results = load_points_file(out_file,
     64        results = import_points_file(out_file,
    6565                                  delimiter = ',')
    6666        answer = [[2.0, 0.0],
     
    8989
    9090    def test_combine_rectangular_points_filesII(self):
    91         from load_mesh.loadASCII import write_pts
     91        from load_mesh.loadASCII import export_points_file
    9292        import tempfile
    9393        import os
     
    101101       
    102102        fine_file = tempfile.mktemp(".pts")
    103         write_pts(fine_file, fine_dict)
     103        export_points_file(fine_file, fine_dict)
    104104
    105105
     
    114114       
    115115        coarse_file = tempfile.mktemp(".pts")
    116         write_pts(coarse_file, coarse_dict)
     116        export_points_file(coarse_file, coarse_dict)
    117117       
    118118        out_file = tempfile.mktemp(".pts")
     
    124124        os.remove(coarse_file)
    125125
    126         results = load_points_file(out_file,
     126        results = import_points_file(out_file,
    127127                                  delimiter = ',')
    128128        answer = [[2.0, 0.0],
     
    154154
    155155    def test_combine_rectangular_points_files_errors(self):
    156         from load_mesh.loadASCII import write_pts
     156        from load_mesh.loadASCII import export_points_file
    157157        import tempfile
    158158        import os
     
    168168       
    169169        fine_file = tempfile.mktemp(".pts")
    170         write_pts(fine_file, fine_dict)
     170        export_points_file(fine_file, fine_dict)
    171171
    172172
     
    181181       
    182182        coarse_file = tempfile.mktemp(".pts")
    183         write_pts(coarse_file, coarse_dict)
     183        export_points_file(coarse_file, coarse_dict)
    184184       
    185185        out_file = tempfile.mktemp(".pts")
     
    196196     
    197197    def test_reduce_points_to_mesh_extent(self):
    198         from load_mesh.loadASCII import write_pts, export_mesh_file
     198        from load_mesh.loadASCII import export_points_file, export_mesh_file
    199199        import tempfile
    200200        import os
     
    217217       
    218218        points_file = tempfile.mktemp(".pts")
    219         write_pts(points_file, fine_dict)
     219        export_points_file(points_file, fine_dict)
    220220
    221221
     
    247247        #os.remove(coarse_file)
    248248
    249         results = load_points_file(out_file,
     249        results = import_points_file(out_file,
    250250                                  delimiter = ',')
    251251        answer = [
  • inundation/ga/storm_surge/pyvolution/test_interpolate_sww.py

    r1018 r1379  
    145145        from Scientific.IO.NetCDF import NetCDFFile
    146146        import tempfile
    147         from load_mesh.loadASCII import  load_points_file, \
     147        from load_mesh.loadASCII import  import_points_file, \
    148148             concatinate_attributelist
    149149
     
    188188
    189189        #check the output file
    190         xya_dict = load_points_file(point_file_out)
     190        xya_dict = import_points_file(point_file_out)
    191191        #print "xya_dict", xya_dict
    192192        title_list,point_attributes = concatinate_attributelist(xya_dict['attributelist'])
Note: See TracChangeset for help on using the changeset viewer.