Changeset 3452 for inundation/fit_interpolate
- Timestamp:
- Aug 4, 2006, 2:26:23 PM (19 years ago)
- Location:
- inundation/fit_interpolate
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/fit_interpolate/general_fit_interpolate.py
r3085 r3452 30 30 from coordinate_transforms.geo_reference import Geo_reference 31 31 from pyvolution.quad import build_quadtree 32 from utilities.numerical_tools import ensure_numeric , mean, INF32 from utilities.numerical_tools import ensure_numeric 33 33 from utilities.polygon import in_and_outside_polygon 34 34 from geospatial_data.geospatial_data import Geospatial_data, \ -
inundation/fit_interpolate/interpolate.py
r3445 r3452 33 33 from coordinate_transforms.geo_reference import Geo_reference 34 34 from pyvolution.quad import build_quadtree 35 from utilities.numerical_tools import ensure_numeric, mean, INF35 from utilities.numerical_tools import ensure_numeric, mean, NAN 36 36 from utilities.polygon import in_and_outside_polygon 37 37 from geospatial_data.geospatial_data import Geospatial_data, ensure_absolute … … 201 201 #print "z", z 202 202 for i in self.outside_poly_indices: 203 z[i] = INF203 z[i] = NAN 204 204 return z 205 205 … … 330 330 depth = w - z 331 331 332 if w == INF or z == INF or uh == INF or vh == INF:333 velocity = INF332 if w == NAN or z == NAN or uh == NAN or vh == NAN: 333 velocity = NAN 334 334 else: 335 335 momentum = sqrt(uh*uh + vh*vh) … … 598 598 #Linear temporal interpolation 599 599 if ratio > 0: 600 if Q0 == INF and Q1 == INF:600 if Q0 == NAN and Q1 == NAN: 601 601 q[i] = Q0 602 602 else: -
inundation/fit_interpolate/test_interpolate.py
r3437 r3452 21 21 from coordinate_transforms.geo_reference import Geo_reference 22 22 from shallow_water import Domain, Transmissive_boundary 23 from utilities.numerical_tools import mean, INF23 from utilities.numerical_tools import mean, NAN 24 24 from data_manager import get_dataobject 25 25 from geospatial_data.geospatial_data import Geospatial_data … … 523 523 524 524 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) 526 526 527 527 #print "***********" … … 1135 1135 t = time[0] 1136 1136 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!') 1138 1138 t += 0.1 1139 1139 … … 1343 1343 2*linear_function(point_coords) ] 1344 1344 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] 1348 1348 #print "z",z 1349 1349 #print "answer _ fixed",answer
Note: See TracChangeset
for help on using the changeset viewer.