def _derX(self,x,y,z):
        '''
        Returns the derivative with respect to x of the interpolated function
        at each value in x,y,z. Only called internally by HARKinterpolator3D.derivativeX.
        '''
        if _isscalar(x):
            x_pos = max(min(self.xSearchFunc(self.x_list,x),self.x_n-1),1)
            y_pos = max(min(self.ySearchFunc(self.y_list,y),self.y_n-1),1)
            z_pos = max(min(self.zSearchFunc(self.z_list,z),self.z_n-1),1)
        else:
            x_pos = self.xSearchFunc(self.x_list,x)
            x_pos[x_pos < 1] = 1
            x_pos[x_pos > self.x_n-1] = self.x_n-1
            y_pos = self.ySearchFunc(self.y_list,y)
            y_pos[y_pos < 1] = 1
            y_pos[y_pos > self.y_n-1] = self.y_n-1
            z_pos = self.zSearchFunc(self.z_list,z)
            z_pos[z_pos < 1] = 1
            z_pos[z_pos > self.z_n-1] = self.z_n-1
        beta = (y - self.y_list[y_pos-1])/(self.y_list[y_pos] - self.y_list[y_pos-1])
        gamma = (z - self.z_list[z_pos-1])/(self.z_list[z_pos] - self.z_list[z_pos-1])
        dfdx = (
           (  (1-beta)*(1-gamma)*self.f_values[x_pos,y_pos-1,z_pos-1]
           +  (1-beta)*gamma*self.f_values[x_pos,y_pos-1,z_pos]
           +  beta*(1-gamma)*self.f_values[x_pos,y_pos,z_pos-1]
           +  beta*gamma*self.f_values[x_pos,y_pos,z_pos]) -
           (  (1-beta)*(1-gamma)*self.f_values[x_pos-1,y_pos-1,z_pos-1]
           +  (1-beta)*gamma*self.f_values[x_pos-1,y_pos-1,z_pos]
           +  beta*(1-gamma)*self.f_values[x_pos-1,y_pos,z_pos-1]
           +  beta*gamma*self.f_values[x_pos-1,y_pos,z_pos]))/(self.x_list[x_pos] - self.x_list[x_pos-1])
        return dfdx
def _derX ( self , x , y , z ) : if _isscalar ( x ) : x_pos = max ( min ( self . xSearchFunc ( self . x_list , x ) , self . x_n - 1 ) , 1 ) y_pos = max ( min ( self . ySearchFunc ( self . y_list , y ) , self . y_n - 1 ) , 1 ) z_pos = max ( min ( self . zSearchFunc ( self . z_list , z ) , self . z_n - 1 ) , 1 ) else : x_pos = self . xSearchFunc ( self . x_list , x ) x_pos [ x_pos < 1 ] = 1 x_pos [ x_pos > self . x_n - 1 ] = self . x_n - 1 y_pos = self . ySearchFunc ( self . y_list , y ) y_pos [ y_pos < 1 ] = 1 y_pos [ y_pos > self . y_n - 1 ] = self . y_n - 1 z_pos = self . zSearchFunc ( self . z_list , z ) z_pos [ z_pos < 1 ] = 1 z_pos [ z_pos > self . z_n - 1 ] = self . z_n - 1 beta = ( y - self . y_list [ y_pos - 1 ] ) / ( self . y_list [ y_pos ] - self . y_list [ y_pos - 1 ] ) gamma = ( z - self . z_list [ z_pos - 1 ] ) / ( self . z_list [ z_pos ] - self . z_list [ z_pos - 1 ] ) dfdx = ( ( ( 1 - beta ) * ( 1 - gamma ) * self . f_values [ x_pos , y_pos - 1 , z_pos - 1 ] + ( 1 - beta ) * gamma * self . f_values [ x_pos , y_pos - 1 , z_pos ] + beta * ( 1 - gamma ) * self . f_values [ x_pos , y_pos , z_pos - 1 ] + beta * gamma * self . f_values [ x_pos , y_pos , z_pos ] ) - ( ( 1 - beta ) * ( 1 - gamma ) * self . f_values [ x_pos - 1 , y_pos - 1 , z_pos - 1 ] + ( 1 - beta ) * gamma * self . f_values [ x_pos - 1 , y_pos - 1 , z_pos ] + beta * ( 1 - gamma ) * self . f_values [ x_pos - 1 , y_pos , z_pos - 1 ] + beta * gamma * self . f_values [ x_pos - 1 , y_pos , z_pos ] ) ) / ( self . x_list [ x_pos ] - self . x_list [ x_pos - 1 ] ) return dfdx
Returns the derivative with respect to x of the interpolated function
        at each value in x,y,z. Only called internally by HARKinterpolator3D.derivativeX.