isochrones/mist/utils.py
def interp_box(x, y, z, box, values):
    """
    box is 8x3 array, though not really a box
    
    values is length-8 array, corresponding to values at the "box" coords
    """
    
    # Calculate the distance to each vertex
    
    val = 0
    norm = 0
    for i in range(8):
        # weight = 1./distance
        w = 1./sqrt((x-box[i,0])**2 + (y-box[i,1])**2 + (z-box[i, 2])**2)
        val += w * values[i]
        norm += w
    
    return val/norm

    box is 8x3 array, though not really a box
    
    values is length-8 array, corresponding to values at the "box" coords
    
box is 8x3 array, though not really a box
values is length-8 array, corresponding to values at the "box" coords
box is 8x3 array though not really a box values is length - 8 array corresponding to values at the " box " coords
def interp_box(x, y, z, box, values):
    val = 0
    norm = 0
    for i in range(8):
        w = 1./sqrt((x-box[i,0])**2 + (y-box[i,1])**2 + (z-box[i, 2])**2)
        val += w * values[i]
        norm += w
    return val/norm
def interp_box ( x , y , z , box , values ) : val = 0 norm = 0 for i in range ( 8 ) : w = 1. / sqrt ( ( x - box [ i , 0 ] ) ** 2 + ( y - box [ i , 1 ] ) ** 2 + ( z - box [ i , 2 ] ) ** 2 ) val += w * values [ i ] norm += w return val / norm
box is 8x3 array, though not really a box
values is length-8 array, corresponding to values at the "box" coords
box is 8x3 array though not really a box values is length - 8 array corresponding to values at the " box " coords
"""
    box is 8x3 array, though not really a box
    
    values is length-8 array, corresponding to values at the "box" coords
    """ # Calculate the distance to each vertex # weight = 1./distance
x
y
z
box
values