Changeset 488 for inundation/ga/storm_surge/pyvolution/least_squares.py
- Timestamp:
- Nov 5, 2004, 4:42:19 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/least_squares.py
r485 r488 3 3 Implements a penalised least-squares fit and associated interpolations. 4 4 5 The p analty term (or smoothing term) is controlled by the smoothing5 The penalty term (or smoothing term) is controlled by the smoothing 6 6 parameter alpha. 7 7 With a value of alpha=0, the fit function will attempt … … 20 20 21 21 #FIXME (Ole): Currently datapoints outside the triangular mesh are ignored. 22 # Is there a clean way of in lcuding them?22 # Is there a clean way of including them? 23 23 24 24 … … 152 152 Inputs: 153 153 154 vertex_coordinates: List of coordinate pairs [xi, eta] of points155 154 vertex_coordinates: List of coordinate pairs [xi, eta] of 155 points constituting mesh (or a an m x 2 Numeric array) 156 156 157 157 triangles: List of 3-tuples (or a Numeric array) of 158 158 integers representing indices of all vertices in the mesh. 159 159 160 point_coordinates: List of coordinate pairs [x, y] of data points 161 (or an nx2 Numeric array) 160 point_coordinates: List of coordinate pairs [x, y] of 161 data points (or an nx2 Numeric array) 162 If point_coordinates is absent, only smoothing matrix will 163 be built 162 164 163 165 alpha: Smoothing parameter … … 504 506 def fit_points(self, z): 505 507 """Like fit, but more robust when each point has two or more attributes 506 FIXME (Ole): The name fit_points doesn't carry any meaning for me.507 How about something like fit_multiple or fit_columns?508 FIXME (Ole): The name fit_points doesn't carry any meaning 509 for me. How about something like fit_multiple or fit_columns? 508 510 """ 509 511 … … 529 531 530 532 def interpolate(self, f): 531 """ Compute predicted valuesat data points implied in self.A.533 """Evaluate smooth surface f at data points implied in self.A. 532 534 533 535 The mesh values representing a smooth surface are … … 546 548 547 549 548 549 #FIXME: We will need a method 'evaluate(self):' that will interpolate550 #a computed surface living on the mesh onto a collection of551 #arbitrary data points552 #553 #Precondition: self.fit(z) has stored its result in self.f.554 #555 #Input: data_points556 #Algorithm:557 # 1 Build a new temporary A matrix based on mesh and new data points558 # 2 Apply it to self.f (return A*self.f)559 #560 # ON561 562 563 564 550 #------------------------------------------------------------- 565 551 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.