Ignore:
Timestamp:
Nov 5, 2004, 4:42:19 PM (20 years ago)
Author:
ole
Message:

Played with regridding of Cornell data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/least_squares.py

    r485 r488  
    33   Implements a penalised least-squares fit and associated interpolations.
    44
    5    The panalty term (or smoothing term) is controlled by the smoothing
     5   The penalty term (or smoothing term) is controlled by the smoothing
    66   parameter alpha.
    77   With a value of alpha=0, the fit function will attempt
     
    2020
    2121#FIXME (Ole): Currently datapoints outside the triangular mesh are ignored.
    22 #             Is there a clean way of inlcuding them?
     22#             Is there a clean way of including them?
    2323
    2424
     
    152152        Inputs:
    153153       
    154           vertex_coordinates: List of coordinate pairs [xi, eta] of points
    155           constituting mesh (or a an m x 2 Numeric array)
     154          vertex_coordinates: List of coordinate pairs [xi, eta] of
     155          points constituting mesh (or a an m x 2 Numeric array)
    156156       
    157157          triangles: List of 3-tuples (or a Numeric array) of
    158158          integers representing indices of all vertices in the mesh.
    159159
    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
    162164
    163165          alpha: Smoothing parameter
     
    504506    def fit_points(self, z):
    505507        """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?
    508510        """
    509511       
     
    529531       
    530532    def interpolate(self, f):
    531         """Compute predicted values at data points implied in self.A.
     533        """Evaluate smooth surface f at data points implied in self.A.
    532534
    533535        The mesh values representing a smooth surface are
     
    546548       
    547549           
    548      
    549     #FIXME: We will need a method 'evaluate(self):' that will interpolate
    550     #a computed surface living on the mesh onto a collection of
    551     #arbitrary data points
    552     #
    553     #Precondition: self.fit(z) has stored its result in self.f.
    554     #
    555     #Input: data_points
    556     #Algorithm:
    557     #  1 Build a new temporary A matrix based on mesh and new data points
    558     #  2 Apply it to self.f (return A*self.f)
    559     #
    560     # ON
    561 
    562 
    563 
    564550#-------------------------------------------------------------
    565551if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.