Changeset 2563 for inundation/fit_interpolate/interpolate.py
- Timestamp:
- Mar 21, 2006, 10:58:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/fit_interpolate/interpolate.py
r2504 r2563 19 19 20 20 import time 21 import os 22 from warnings import warn 21 23 22 24 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, \ … … 28 30 from coordinate_transforms.geo_reference import Geo_reference 29 31 from pyvolution.quad import build_quadtree 30 from utilities.numerical_tools import ensure_numeric 32 from utilities.numerical_tools import ensure_numeric, mean 31 33 from utilities.polygon import inside_polygon 32 34 … … 160 162 A[i,j] = sigmas[j] 161 163 else: 162 print 'Could not find triangle for point', x 164 # Hack so this message only appears when the test is 165 #run in fit_interpoate directory. 166 #Error message reminds me to do something 167 #with points outside the polygon 168 if os.getcwd()[-15:] == "fit_interpolate": 169 print 'Could not find triangle for point', x 163 170 return A 164 171 … … 258 265 259 266 260 # FIXME: What is a good start_blocking_ countvalue?267 # FIXME: What is a good start_blocking_len value? 261 268 def interpolate(self, f, point_coordinates = None, 262 269 start_blocking_len = 500000, verbose=False): … … 298 305 #There are no good point_coordinates. import sys; sys.exit() 299 306 msg = 'ERROR (interpolate.py): No point_coordinates inputted' 300 raise msg 307 raise Exception(msg) 308 301 309 302 310 if point_coordinates is not None: … … 342 350 343 351 344 class Interpolation_ interface:352 class Interpolation_function: 345 353 """Interpolation_interface - creates callable object f(t, id) or f(t,x,y) 346 354 which is interpolated from time series defined at vertices of … … 394 402 395 403 396 from util import mean, ensure_numeric404 #from util import mean, ensure_numeric 397 405 from config import time_format 398 406 import types … … 532 540 if x is None or y is None: 533 541 msg = 'Either point_id or x and y must be specified' 534 raise msg542 raise Exception(msg) 535 543 else: 536 544 if self.interpolation_points is None: … … 538 546 'with a list of interpolation points before parameter ' +\ 539 547 'point_id can be used' 540 raise msg548 raise Exception(msg) 541 549 542 550 543 551 msg = 'Time interval [%s:%s]' %(self.T[0], self.T[1]) 544 552 msg += ' does not match model time: %s\n' %t 545 if t < self.T[0]: raise msg546 if t > self.T[-1]: raise msg553 if t < self.T[0]: raise Exception(msg) 554 if t > self.T[-1]: raise Exception(msg) 547 555 548 556 oldindex = self.index #Time index … … 698 706 def read_sww(file_name): 699 707 """ 708 obsolete - Nothing should be calling this 709 700 710 Read in an sww file. 701 711
Note: See TracChangeset
for help on using the changeset viewer.