def check(self): """ Check how far apart the transformed points are from the real points. Returns a matching array: (idx_i,idx_f,dist) """ points = self.transform_all() match = xymatch(points,self.fPoints,100.,maxmatch=1) return match
def coalign_fits(x0, y0, x1, y1): """ Return x1,y1 reordered to be in the same order as x0,y0. """ match = xymatch(np.array(zip(x0, y0)), np.array(zip(x1, y1)), 40, maxmatch=1) # Have to keep everything aligned to the original x0,y0 positions. match.sort(order="idx1") return x1[match["idx2"]], y1[match["idx2"]]