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)
Example #2
0
 def planarize(self):
     """Subtract the best-fit plane from this data."""
     from lsst.analysis import utils
     assert numpy.isfinite(self.z).all()
     self.z -= utils.evalplane(self.plane(), self.points)
 def error(self, t, pt):
     """Return the error due to drift at time 't' and point 'pt'."""
     return utils.evalplane([splev(t, spl) for spl in self.splines], pt) if self.splines else 0