def get_X_from_x(self,x): "X is x compactified" L = self.L with np.errstate(invalid='ignore'): X = (x-L)/(x+L) return X