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