Changeset 5946


Ignore:
Timestamp:
Nov 12, 2008, 11:52:17 AM (16 years ago)
Author:
rwilson
Message:

More NumPy? changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source_numpy_conversion/anuga/load_mesh/loadASCII.py

    r5910 r5946  
    6060from os.path import splitext
    6161
     62from anuga.config import Float, Character, Int
    6263from anuga.coordinate_transforms.geo_reference import Geo_reference,TITLE, TitleError
    6364
     
    699700    if (mesh['vertices'].shape[0] > 0):
    700701        outfile.createDimension('num_of_vertices', mesh['vertices'].shape[0])
    701         outfile.createVariable('vertices', numpy.float, ('num_of_vertices',
     702        outfile.createVariable('vertices', Float, ('num_of_vertices',
    702703                                                   'num_of_dimensions'))
    703704        outfile.variables['vertices'][:] = mesh['vertices']
     
    709710                                    mesh['vertex_attribute_titles'].shape[1])
    710711            outfile.createVariable('vertex_attributes',
    711                                    numpy.float,
     712                                   Float,
    712713                                   ('num_of_vertices',
    713                                     'num_of_vertex_attributes'))   
     714                                    'num_of_vertex_attributes'))
    714715            outfile.createVariable('vertex_attribute_titles',
    715                                    numpy.character,
     716                                   Character,
    716717                                   ( 'num_of_vertex_attributes',
    717718                                     'num_of_vertex_attribute_title_chars' ))
     
    725726                                mesh['segments'].shape[0])
    726727        outfile.createVariable('segments',
    727                                IntType,
     728                               Int,
    728729                               ('num_of_segments', 'num_of_segment_ends'))
    729730        outfile.variables['segments'][:] = mesh['segments']
     
    732733                                    mesh['segment_tags'].shape[1])
    733734            outfile.createVariable('segment_tags',
    734                                    numpy.character,
     735                                   Character,
    735736                                   ('num_of_segments',
    736737                                    'num_of_segment_tag_chars'))
     
    741742                                mesh['triangles'].shape[0])
    742743        outfile.createVariable('triangles',
    743                                IntType,
     744                               Int,
    744745                               ('num_of_triangles',
    745746                                'num_of_triangle_vertices'))
    746747        outfile.createVariable('triangle_neighbors',
    747                                IntType,
     748                               Int,
    748749                               ('num_of_triangles',
    749750                                'num_of_triangle_faces'))
     
    755756                                    mesh['triangle_tags'].shape[1])
    756757            outfile.createVariable('triangle_tags',
    757                                    numpy.character,
     758                                   Character,
    758759                                   ('num_of_triangles',
    759760                                    'num_of_triangle_tag_chars'))
     
    765766    if (mesh['points'].shape[0] > 0):
    766767        outfile.createDimension('num_of_points', mesh['points'].shape[0])
    767         outfile.createVariable('points', numpy.float, ('num_of_points',
     768        outfile.createVariable('points', Float, ('num_of_points',
    768769                                                 'num_of_dimensions'))
    769770        outfile.variables['points'][:] = mesh['points']
     
    772773                                    mesh['point_attributes'].shape[1])
    773774            outfile.createVariable('point_attributes',
    774                                    numpy.float,
     775                                   Float,
    775776                                   ('num_of_points',
    776777                                    'num_of_point_attributes'))
     
    781782                                mesh['outline_segments'].shape[0])
    782783        outfile.createVariable('outline_segments',
    783                                IntType,
     784                               Int,
    784785                               ('num_of_outline_segments',
    785786                                'num_of_segment_ends'))
     
    789790                                    mesh['outline_segment_tags'].shape[1])
    790791            outfile.createVariable('outline_segment_tags',
    791                                    numpy.character,
     792                                   Character,
    792793                                   ('num_of_outline_segments',
    793794                                    'num_of_outline_segment_tag_chars'))
     
    796797    if (mesh['holes'].shape[0] > 0):
    797798        outfile.createDimension('num_of_holes', mesh['holes'].shape[0])
    798         outfile.createVariable('holes', numpy.float, ('num_of_holes',
     799        outfile.createVariable('holes', Float, ('num_of_holes',
    799800                                                'num_of_dimensions'))
    800801        outfile.variables['holes'][:] = mesh['holes']
     
    802803    if (mesh['regions'].shape[0] > 0):
    803804        outfile.createDimension('num_of_regions', mesh['regions'].shape[0])
    804         outfile.createVariable('regions', numpy.float, ('num_of_regions',
     805        outfile.createVariable('regions', Float, ('num_of_regions',
    805806                                                  'num_of_dimensions'))
    806807        outfile.createVariable('region_max_areas',
    807                                numpy.float,
     808                               Float,
    808809                               ('num_of_regions',))
    809810        outfile.variables['regions'][:] = mesh['regions']
     
    813814                                    mesh['region_tags'].shape[1])
    814815            outfile.createVariable('region_tags',
    815                                    numpy.character,
     816                                   Character,
    816817                                   ('num_of_regions',
    817818                                    'num_of_region_tag_chars'))
Note: See TracChangeset for help on using the changeset viewer.