Changeset 2802


Ignore:
Timestamp:
May 5, 2006, 11:12:41 AM (19 years ago)
Author:
duncan
Message:

adding the fit class

Location:
inundation/fit_interpolate
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/fit_interpolate/interpolate.py

    r2787 r2802  
    3333from utilities.polygon import in_and_outside_polygon
    3434from geospatial_data.geospatial_data import Geospatial_data
    35 from search_functions import search_tree_of_vertices
    36 
    37 
    38 
    39 class Interpolate:
    40    
     35from fit_interpolate.search_functions import search_tree_of_vertices
     36from fit_interpolate.general_fit_interpolate import FitInterpolate
     37
     38
     39
     40class Interpolate (FitInterpolate):
     41       
    4142    def __init__(self,
    4243                 vertex_coordinates,
     
    7778        self._point_coordinates = None
    7879       
    79         #Convert input to Numeric arrays
    80         triangles = ensure_numeric(triangles, Int)
    81        
    82         if isinstance(vertex_coordinates,Geospatial_data):
    83             vertex_coordinates = vertex_coordinates.get_data_points( \
    84                 absolute = True)
    85             msg = "Use a Geospatial_data object or a mesh origin. Not both."
    86             assert mesh_origin == None, msg
    87            
    88         else:
    89             vertex_coordinates = ensure_numeric(vertex_coordinates, Float)
    90         #Build underlying mesh
    91         if verbose: print 'Building mesh'
    92         #self.mesh = General_mesh(vertex_coordinates, triangles,
    93         #FIXME: Trying the normal mesh while testing precrop,
    94         #       The functionality of boundary_polygon is needed for that
    95        
    96         if mesh_origin is None:
    97             geo = None #Geo_reference()
    98         else:
    99             if isinstance(mesh_origin, Geo_reference):
    100                 geo = mesh_origin
    101             else:
    102                 geo = Geo_reference(mesh_origin[0],
    103                                     mesh_origin[1],
    104                                     mesh_origin[2])
    105             vertex_coordinates = geo.get_absolute(vertex_coordinates)
    106         #Don't pass geo_reference to mesh.  It doesn't work.
    107         self.mesh = Mesh(vertex_coordinates, triangles)
    108         self.mesh.check_integrity()
    109         self.root = build_quadtree(self.mesh,
    110                               max_points_per_cell = max_vertices_per_cell)
    111         #print "self.root",self.root.show()
    112        
    113        
     80        FitInterpolate.__init__(self,
     81                 vertex_coordinates,
     82                 triangles,
     83                 mesh_origin,
     84                 verbose,
     85                 max_vertices_per_cell)
    11486
    11587     # FIXME: What is a good start_blocking_len value?
Note: See TracChangeset for help on using the changeset viewer.