patches: modified code to center patches at a given barycenter before projection to basis