コード例 #1
0
    def calc(self):
        """Calculate the position-over-time splines.

        This function is called internally after all data has been
        acquired.  It is never called if reps=0."""
        planes = numpy.empty((self.reps, 3))
        for i in xrange(self.reps):
            planes[i] = utils.fitplane(self.xy, self.z[i])
        avgtimes = numpy.average(self.t, axis=1)
        self.splines = [splrep(avgtimes, planes[:, n]) for n in range(3)]
コード例 #2
0
ファイル: data.py プロジェクト: lsst-camera-dh/ts5-metrology
 def plane(self):
     """Return the best-fit plane to this data."""
     from lsst.analysis import utils
     return utils.fitplane(self.points, self.z)
コード例 #3
0
 def error(self, pt):
     if self.data is None: return 0.
     xy, z = self.data.points.reshape((-1, 2)), self.data.data['z'].ravel()
     closest = argsort(sum(square(xy - pt), axis=-1))[:3]
     plane = utils.fitplane(xy[closest], z[closest])
     return utils.evalplane(plane, pt)