Ignore:
Timestamp:
Mar 31, 2005, 4:51:54 PM (20 years ago)
Author:
duncan
Message:

incorporating geo_ref object into domain class

File:
1 edited

Legend:

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

    r969 r1178  
    1414    from domain import Domain
    1515
    16     vertex_coordinates, volumes, tag_dict, vertex_quantity_dict ,tagged_elements_dict = \
    17                         pmesh_to_domain(fileName,
    18                                                    setting_function=setting_function)
     16    vertex_coordinates, volumes, tag_dict, vertex_quantity_dict \
     17                        ,tagged_elements_dict, geo_reference = \
     18           pmesh_to_domain(fileName,
     19                           setting_function=setting_function)
    1920       
    20     assert issubclass(DomainClass, Domain), "DomainClass is not a subclass of Domain."
     21    assert issubclass(DomainClass, Domain),"DomainClass is not a subclass of Domain."
    2122
    2223
    2324   
    2425    domain = DomainClass(vertex_coordinates, volumes, tag_dict,
    25                          tagged_elements = tagged_elements_dict )
     26                         tagged_elements = tagged_elements_dict,
     27                         geo_reference = geo_reference )
    2628
    2729
     
    3537    # This doesn't work on the domain instance.
    3638    # This is still needed so -ve elevations don't cuase 'lakes'
    37     # The fixme we discussed was to only create a quantity when its values are set.
     39    # The fixme we discussed was to only create a quantity when its values
     40    #are set.
    3841    # I think that's the way to go still
    3942   
     
    7073    volumes = mesh_dict['triangles']
    7174
    72     #if setting_function:
    73     #    if not type(setting_function) is ListType:
    74     #        setting_function = [setting_function]
    75     #    for funct in setting_function:
    76     #        mesh_dict = funct(mesh_dict, vertices = mesh_vertices,
    77     #                        volumes = volumes)
    78 
    79 
    8075    vertex_quantity_dict = {}
    8176    point_atts = transpose(mesh_dict['vertex_attributes'])
    8277    point_titles  = mesh_dict['vertex_attribute_titles']
     78    geo_reference  = mesh_dict['geo_reference']
    8379    for quantity, value_vector in map (None, point_titles, point_atts):
    8480        vertex_quantity_dict[quantity] = value_vector
    8581    tag_dict = pmesh_dict_to_tag_dict(mesh_dict)
    8682    tagged_elements_dict = build_tagged_elements_dictionary(mesh_dict)
    87     return vertex_coordinates, volumes, tag_dict, vertex_quantity_dict,tagged_elements_dict
     83    return vertex_coordinates, volumes, tag_dict, vertex_quantity_dict,tagged_elements_dict, geo_reference
    8884
    8985
Note: See TracChangeset for help on using the changeset viewer.