Changeset 2924
- Timestamp:
- May 19, 2006, 4:12:41 PM (19 years ago)
- Location:
- inundation
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/fit_interpolate/fit.py
r2897 r2924 400 400 """ 401 401 #Since this is a wrapper for fit, lets handle the geo_spatial att's 402 403 402 if use_cache is True: 404 403 interp = cache(_fit, -
inundation/pyvolution/data_manager.py
r2891 r2924 1530 1530 northing_min = None, 1531 1531 northing_max = None, 1532 expand_search = False, #To avoid intractable situations (This will be fixed when least_squares gets redesigned)1533 1532 verbose = False, 1534 1533 origin = None, -
inundation/pyvolution/interpolate_sww.py
r2750 r2924 1 1 """ Interpolation of a sww file. 2 3 THIS FILE IS OBSOLETE 4 2 5 Used to interpolate height information from sww files. 3 6 -
inundation/pyvolution/quantity.py
r2762 r2924 168 168 function = None, # Callable object: f(x,y) 169 169 geospatial_data = None, #Arbitrary dataset 170 points = None, values = None, data_georef = None, #Input for least squares(obsoleted by use of geo_spatial object)170 points = None, values = None, data_georef = None, #Input for fit (obsoleted by use of geo_spatial object) 171 171 filename = None, attribute_name = None, #Input from file 172 172 alpha = None, … … 196 196 geospatial_data: 197 197 Arbitrary geo spatial dataset in the form of the class 198 Geospatial_data. Mesh points are populated using least squares199 fit ting198 Geospatial_data. Mesh points are populated using 199 fit_interpolate.fit fitting 200 200 201 201 points: 202 Nx2 array of data points for use with least squaresfit202 Nx2 array of data points for use with fit_interpolate.fit 203 203 If points are present, an N array of attribute 204 204 values corresponding to … … 214 214 filename: 215 215 Name of a .pts file containing data points and attributes for 216 use with least squares.216 use with fit_interpolate.fit. 217 217 218 218 attribute_name: … … 222 222 223 223 alpha: 224 Smoothing parameter to be used with least squares fits.225 See module least_squaresfor further details about alpha.224 Smoothing parameter to be used with fit_interpolate.fit. 225 See module fit_interpolate.fit for further details about alpha. 226 226 Alpha will only be used with points, values or filename. 227 227 Otherwise it will be ignored. … … 255 255 256 256 use_cache: True means that caching of intermediate results is 257 attempted for least squaresfit.257 attempted for fit_interpolate.fit. 258 258 259 259 … … 613 613 verbose = False, 614 614 use_cache = False): 615 """Set quantity values from arbitray data points using least squares 615 """ 616 Set quantity values from arbitray data points using 617 fit_interpolate.fit 616 618 """ 617 619 … … 619 621 from Numeric import Float 620 622 from utilities.numerical_tools import ensure_numeric 621 from pyvolution.least_squares import fit_to_mesh 623 #from pyvolution.least_squares import fit_to_mesh 624 from fit_interpolate.fit import fit_to_mesh 622 625 from coordinate_transforms.geo_reference import Geo_reference 623 626 … … 629 632 msg = 'set_values_from_points is only defined for '+\ 630 633 'location=\'vertices\'' 631 raise ms g634 raise ms 632 635 633 636 coordinates = self.domain.coordinates … … 647 650 648 651 649 #Call least squares method652 #Call fit_interpolate.fit function 650 653 args = (coordinates, triangles, points, values) 651 654 kwargs = {'data_origin': data_georef.get_origin(), 652 655 'mesh_origin': mesh_georef.get_origin(), 653 656 'alpha': alpha, 654 'precrop': True,655 657 'verbose': verbose} 656 658 … … 685 687 use_cache = False): 686 688 """Set quantity based on arbitrary points in .pts file 687 using least_squaresattribute_name selects name of attribute689 using attribute_name selects name of attribute 688 690 present in file. 689 691 If not specified try to use whatever is available in file. -
inundation/pyvolution/test_combine_pts.py
r2699 r2924 7 7 8 8 9 from least_squares import *9 #from least_squares import * 10 10 from Numeric import allclose, array, transpose 11 11 -
inundation/pyvolution/test_quantity.py
r2754 r2924 9 9 from Numeric import allclose, array, ones, Float 10 10 11 from pyvolution.least_squares import fit_to_mesh 11 from fit_interpolate.fit import fit_to_mesh 12 #from pyvolution.least_squares import fit_to_mesh 12 13 from domain import Domain 13 14 from geospatial_data.geospatial_data import Geospatial_data 14 15 from coordinate_transforms.geo_reference import Geo_reference 15 16 16 #Aux for least_squaresexample17 #Aux for fit_interpolate.fit example 17 18 def linear_function(point): 18 19 point = array(point) … … 282 283 283 284 284 def test_set_values_using_ least_squares(self):285 def test_set_values_using_fit(self): 285 286 286 287 … … 304 305 z = linear_function(data_points) 305 306 306 #Use built-in least squaresfit307 #Use built-in fit_interpolate.fit 307 308 quantity.set_values( Geospatial_data(data_points, z), alpha = 0 ) 308 309 #quantity.set_values(points = data_points, values = z, alpha = 0) … … 330 331 331 332 332 def test_test_set_values_using_ least_squares_w_geo(self):333 def test_test_set_values_using_fit_w_geo(self): 333 334 334 335
Note: See TracChangeset
for help on using the changeset viewer.