def hessian(self, x, y, coeffs, beta, center_x=0, center_y=0):
        """
        returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
        """
        shapelets = self._createShapelet(coeffs)
        n_order = self._get_num_n(len(coeffs))
        dxx_shapelets = self._dxx_shapelets(shapelets, beta)
        dyy_shapelets = self._dyy_shapelets(shapelets, beta)
        dxy_shapelets = self._dxy_shapelets(shapelets, beta)
        n = len(np.atleast_1d(x))
        if n <= 1:
            f_xx = self._shapeletOutput(x, y, beta, dxx_shapelets, precalc=False)
            f_yy = self._shapeletOutput(x, y, beta, dyy_shapelets, precalc=False)
            f_xy = self._shapeletOutput(x, y, beta, dxy_shapelets, precalc=False)
        else:
            H_x, H_y = self.pre_calc(x, y, beta, n_order+2, center_x, center_y)
            f_xx = self._shapeletOutput(H_x, H_y, beta, dxx_shapelets)
            f_yy = self._shapeletOutput(H_x, H_y, beta, dyy_shapelets)
            f_xy = self._shapeletOutput(H_x, H_y, beta, dxy_shapelets)
        return f_xx, f_yy, f_xy
def hessian ( self , x , y , coeffs , beta , center_x = 0 , center_y = 0 ) : shapelets = self . _createShapelet ( coeffs ) n_order = self . _get_num_n ( len ( coeffs ) ) dxx_shapelets = self . _dxx_shapelets ( shapelets , beta ) dyy_shapelets = self . _dyy_shapelets ( shapelets , beta ) dxy_shapelets = self . _dxy_shapelets ( shapelets , beta ) n = len ( np . atleast_1d ( x ) ) if n <= 1 : f_xx = self . _shapeletOutput ( x , y , beta , dxx_shapelets , precalc = False ) f_yy = self . _shapeletOutput ( x , y , beta , dyy_shapelets , precalc = False ) f_xy = self . _shapeletOutput ( x , y , beta , dxy_shapelets , precalc = False ) else : H_x , H_y = self . pre_calc ( x , y , beta , n_order + 2 , center_x , center_y ) f_xx = self . _shapeletOutput ( H_x , H_y , beta , dxx_shapelets ) f_yy = self . _shapeletOutput ( H_x , H_y , beta , dyy_shapelets ) f_xy = self . _shapeletOutput ( H_x , H_y , beta , dxy_shapelets ) return f_xx , f_yy , f_xy
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy