Functions

Separate functions mostly used in conjunction with various classes.

xarpes.functions.download_examples()[source]

Downloads the examples folder from the xARPES code only if it does not already exist. Prints executed steps and a final cleanup/failure message.

Returns:
0, 1int

Returns 0 if the execution succeeds, 1 if it fails.

xarpes.functions.error_function(p, xdata, ydata, function, extra_args)[source]

The error function used inside the fit_leastsq function.

Parameters:
pndarray

Array of parameters during the optimization

xdatandarray

Array of abscissa values the function is evaluated on

ydatandarray

Outcomes on ordinate the evaluated function is compared to

functionfunction

Function or class with call method to be evaluated

extra_args

Arguments provided to function that should not be optimized

Returns:
residual

Residual between evaluated function and ydata

xarpes.functions.fit_leastsq(p0, xdata, ydata, function, extra_args)[source]

Wrapper arround scipy.optimize.leastsq.

Parameters:
p0ndarray

Initial guess for parameters to be optimized

xdatandarray

Array of abscissa values the function is evaluated on

ydatandarray

Outcomes on ordinate the evaluated function is compared to

functionfunction

Function or class with call method to be evaluated

extra_args

Arguments provided to function that should not be optimized

Returns:
pfit_leastsqndarray

Array containing the optimized parameters

perr_leastsqndarray

Covariance matrix of the optimized parameters