@jit(nopython=True)<EOL>def interp_box(x, y, z, box, values):
<EOL>val = <NUM_LIT:0><EOL>norm = <NUM_LIT:0><EOL>for i in range(<NUM_LIT:8>):<EOL><INDENT>distance = sqrt((x-box[i,<NUM_LIT:0>])**<NUM_LIT:2> + (y-box[i,<NUM_LIT:1>])**<NUM_LIT:2> + (z-box[i, <NUM_LIT:2>])**<NUM_LIT:2>)<EOL>if distance == <NUM_LIT:0>:<EOL><INDENT>val = values[i]<EOL>norm = <NUM_LIT:1.><EOL>break<EOL><DEDENT>w = <NUM_LIT:1.>/distance<EOL>val += w * values[i]<EOL>norm += w<EOL><DEDENT>return val/norm<EOL>
box is 8x3 array, though not really a box

values is length-8 array, corresponding to values at the "box" coords

TODO: should make power `p` an argument