Ignore:
Timestamp:
Aug 4, 2006, 2:26:23 PM (19 years ago)
Author:
duncan
Message:

In numerical_tools, changing INF name to NAN.

Location:
inundation/fit_interpolate
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inundation/fit_interpolate/general_fit_interpolate.py

    r3085 r3452  
    3030from coordinate_transforms.geo_reference import Geo_reference
    3131from pyvolution.quad import build_quadtree
    32 from utilities.numerical_tools import ensure_numeric, mean, INF
     32from utilities.numerical_tools import ensure_numeric
    3333from utilities.polygon import in_and_outside_polygon
    3434from geospatial_data.geospatial_data import Geospatial_data, \
  • inundation/fit_interpolate/interpolate.py

    r3445 r3452  
    3333from coordinate_transforms.geo_reference import Geo_reference
    3434from pyvolution.quad import build_quadtree
    35 from utilities.numerical_tools import ensure_numeric, mean, INF
     35from utilities.numerical_tools import ensure_numeric, mean, NAN
    3636from utilities.polygon import in_and_outside_polygon
    3737from geospatial_data.geospatial_data import Geospatial_data, ensure_absolute
     
    201201        #print "z", z
    202202        for i in self.outside_poly_indices:
    203             z[i] = INF
     203            z[i] = NAN
    204204        return z
    205205
     
    330330            depth = w - z
    331331             
    332             if w == INF or z == INF or uh == INF or vh == INF:
    333                 velocity = INF
     332            if w == NAN or z == NAN or uh == NAN or vh == NAN:
     333                velocity = NAN
    334334            else:
    335335                momentum = sqrt(uh*uh + vh*vh)
     
    598598            #Linear temporal interpolation   
    599599            if ratio > 0:
    600                 if Q0 == INF and Q1 == INF:
     600                if Q0 == NAN and Q1 == NAN:
    601601                    q[i]  = Q0
    602602                else:
  • inundation/fit_interpolate/test_interpolate.py

    r3437 r3452  
    2121from coordinate_transforms.geo_reference import Geo_reference
    2222from shallow_water import Domain, Transmissive_boundary
    23 from utilities.numerical_tools import mean, INF
     23from utilities.numerical_tools import mean, NAN
    2424from data_manager import get_dataobject
    2525from geospatial_data.geospatial_data import Geospatial_data
     
    523523
    524524        z = interp.interpolate(f, point_coords) #, verbose=True)
    525         answer = array([ [INF, INF, INF, INF]]) # (-1,-1)
     525        answer = array([ [NAN, NAN, NAN, NAN]]) # (-1,-1)
    526526
    527527        #print "***********"
     
    11351135        t = time[0]
    11361136        for j in range(50): #t in [1, 6]
    1137             self.failUnless(I(t, 5) == INF, 'Fail!')
     1137            self.failUnless(I(t, 5) == NAN, 'Fail!')
    11381138            t += 0.1 
    11391139           
     
    13431343                  2*linear_function(point_coords) ]
    13441344        answer = transpose(answer)
    1345         answer[2,:] = [INF, INF]
    1346         answer[3,:] = [INF, INF]
    1347         answer[11,:] = [INF, INF]
     1345        answer[2,:] = [NAN, NAN]
     1346        answer[3,:] = [NAN, NAN]
     1347        answer[11,:] = [NAN, NAN]
    13481348        #print "z",z
    13491349        #print "answer _ fixed",answer
Note: See TracChangeset for help on using the changeset viewer.