Changeset 2660


Ignore:
Timestamp:
Apr 5, 2006, 12:07:43 PM (18 years ago)
Author:
duncan
Message:

bug fix

Location:
inundation/fit_interpolate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/fit_interpolate/interpolate.py

    r2659 r2660  
    229229                start=0
    230230                # creating a dummy array to concatenate to.
    231                 z = zeros((0,2)) # 2 for points in 2D space
     231               
     232                f = ensure_numeric(f, Float)
     233                z = zeros((0,f.shape[1]))
    232234                for end in range(start_blocking_len
    233235                                 ,len(point_coordinates)
     
    235237                    t = self.interpolate_block(f, point_coordinates[start:end],
    236238                                               verbose=verbose)
     239                    #print "t", t
     240                    #print "z", z
    237241                    z = concatenate((z,t))
    238242                    start = end
     
    269273        #print "self.inside_poly_indices", self.inside_poly_indices
    270274        #print "z", z
    271         #print "z.size", z.size
    272275        for i in self.outside_poly_indices:
    273276            z[i] = INF
  • inundation/fit_interpolate/test_interpolate.py

    r2659 r2660  
    524524                      2*linear_function(point_coords) ]
    525525            answer = transpose(answer)
     526            #print "z",z
     527            #print "answer",answer
     528            assert allclose(z, answer)
     529           
     530        f = array([linear_function(vertices),2*linear_function(vertices),
     531                   2*linear_function(vertices) - 100  ])
     532        f = transpose(f)
     533        #print "f",f
     534        for blocking_max in range(len(point_coords)+2):
     535        #if True:
     536         #   blocking_max = 5
     537            z = interp.interpolate(f, point_coords,
     538                                   start_blocking_len=blocking_max)
     539            answer = array([linear_function(point_coords),
     540                      2*linear_function(point_coords) ,
     541                      2*linear_function(point_coords)-100 ])
     542            z = transpose(z)
    526543            #print "z",z
    527544            #print "answer",answer
Note: See TracChangeset for help on using the changeset viewer.