#NEWLINE# def f_NDregion( region , ls_classes , p0 , p_bounds , n_peaks , wmask , **kw ) : #NEWLINE# #INDENT# '\n    Fit an N-dimensional regions containing one or more peaks.\n\n    Region is fit using a contrained Levenberg-Marquard optmization algorithm.\n    See :py:func:`fit_NDregion` for additional documentation.\n\n    Parameters\n    ----------\n    region : ndarray\n        Region to fit.\n    ls_classes : list\n        List of lineshape classes.\n    p0 : ndarray\n        Initial parameters.\n    p_bounds : list of tuples\n        List of (min, max) bounds for each element of p0.\n    n_peaks : int\n        Number of peaks in the simulated region.\n    wmask : ndarray\n        Array with same shape as region which is used to weight points in the\n        error calculation, typically a boolean array is used to exclude\n        certain points in the region.\n    **kw : optional\n        Additional keywords passed to the scipy.optimize.leastsq function.\n\n    See Also\n    --------\n    fit_NDregion : Fit N-dimensional region with user friendly parameter.\n\n    ' #NEWLINE# args = ( region , region . shape , ls_classes , n_peaks , wmask ) #NEWLINE# p_best = leastsqbound ( err_NDregion , p0 , bounds = p_bounds , args = args , ** kw ) #NEWLINE# return p_best