def __call__(self, x):

        xval = np.log10(x)

        if self.x[-1] > self.x[0]:
            top = xval > self.x[-1]
            bot = xval < self.x[0]
        else:
            top = xval < self.x[-1]
            bot = xval > self.x[0]

        if type(xval) == np.ndarray:

            yval = np.zeros(xval.shape)

            yval[top] = 10. ** (self.y[-1] + (xval[top] - self.x[-1]) * (self.y[-1] - self.y[-2]) / (self.x[-1] - self.x[-2]))
            yval[bot] = 10. ** (self.y[0] + (xval[bot] - self.x[0]) * (self.y[0] - self.y[1]) / (self.x[0] - self.x[1]))

        else:

            if top:
                yval = 10. ** (self.y[-1] + (xval - self.x[-1]) * (self.y[-1] - self.y[-2]) / (self.x[-1] - self.x[-2]))
            elif bot:
                yval = 10. ** (self.y[0] + (xval - self.x[0]) * (self.y[0] - self.y[1]) / (self.x[0] - self.x[1]))
            else:
                raise Exception("xval should lie outside x array")

        return yval
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/util/functions.py/extrap1d_log10.__call__/original