x_best_leastsq

gammapy.stats.x_best_leastsq()

Best fit amplitude using weighted least squares fit.

For a single parameter amplitude fit this can be solved analytically.

Parameters
countsndarray

Counts image

backgroundndarray

Background image

modelndarray

Source template (multiplied with exposure).

weightsndarray

Fit weights.