def function(self, x, y, amp, n_max, beta, center_x=0, center_y=0):
        """

        :param x:
        :param y:
        :param amp:
        :param beta:
        :param center_x:
        :param center_y:
        :return:
        """
        num_param = int((n_max+1)*(n_max+2)/2)
        f_ = np.zeros(len(np.atleast_1d(x)))
        n1 = 0
        n2 = 0
        H_x, H_y = self.shapelets.pre_calc(x, y, beta, n_max, center_x, center_y)
        for i in range(num_param):
            kwargs_source_shapelet = {'center_x': center_x, 'center_y': center_y, 'n1': n1, 'n2': n2, 'beta': beta, 'amp': amp[i]}
            out = self.shapelets.function(H_x, H_y, **kwargs_source_shapelet)
            f_ += out
            if n1 == 0:
                n1 = n2 + 1
                n2 = 0
            else:
                n1 -= 1
                n2 += 1
        try: len(x)
        except: f_ = f_[0]
        #if isinstance(x, int) or isinstance(x, float):
        #    f_ = f_[0]
        return np.nan_to_num(f_)
def function ( self , x , y , amp , n_max , beta , center_x = 0 , center_y = 0 ) : num_param = int ( ( n_max + 1 ) * ( n_max + 2 ) / 2 ) f_ = np . zeros ( len ( np . atleast_1d ( x ) ) ) n1 = 0 n2 = 0 H_x , H_y = self . shapelets . pre_calc ( x , y , beta , n_max , center_x , center_y ) for i in range ( num_param ) : kwargs_source_shapelet = { 'center_x' : center_x , 'center_y' : center_y , 'n1' : n1 , 'n2' : n2 , 'beta' : beta , 'amp' : amp [ i ] } out = self . shapelets . function ( H_x , H_y , ** kwargs_source_shapelet ) f_ += out if n1 == 0 : n1 = n2 + 1 n2 = 0 else : n1 -= 1 n2 += 1 try : len ( x ) except : f_ = f_ [ 0 ] return np . nan_to_num ( f_ )
:param x:
        :param y:
        :param amp:
        :param beta:
        :param center_x:
        :param center_y:
        :return: