read the look up table
LUT = np.genfromtxt('test.out', delimiter=',', dtype=float)
LUT:
12, 25, 136, 6743
13, 26, 139, 6786
14, 27, 142, 6791
15, 28, 145, 6789
Values to be read from the LUT are as follows:
x1, x2, x3 = 12.5, 25.5, 137
Reading the neighboring two values in the LUT for each of the given values (3 columns), I have to linearly interpolate the results (4th column in LUT).
The given values (x1, x2, x3) belongs to between 1st and 2nd row of the LUT. Based on this how to read the results between 1st and 2nd row?
c1 = LUT[:, 0]
, (c2=, c3= ...) and thenx1 = (c1[0] + c1[1]) / 2
(x2=, x3=), which you already pretty much have. – Amylaceous