pint.templates.lcfitters.LCFitter
- class pint.templates.lcfitters.LCFitter(template, phases, weights=None, log10_ens=3, times=1, binned_bins=1000, binned_ebins=8, phase_shift=0)[source]
Bases:
object
Class for fitting light curves.
Arguments: template – an instance of LCTemplate phases – list of photon phases
Keyword arguments: weights [None] optional photon weights log10_ens [None] optional photon energies (log10(E/MeV)) times [None] optional photon arrival times binned_bins [100] phase bins to use in binned likelihood binned_ebins [8] energy bins to use in binned likelihood phase_shift [0] set this if a phase shift has been applied
Methods
aic
([template])Return the Akaike information criterion for the current state.
bic
([template])Return the Bayesian information criterion for the current state.
binned_gradient
(p, *args, **kwargs)binned_loglikelihood
(p, *args, **kwargs)bootstrap_errors
([nsamp, fit_kwargs, set_errors])chi
(p, *args)fit
([quick_fit_first, unbinned, ...])fit_background
([unbinned])Fit the background level, holding the ratios of the pulsed components fixed but varying their total normalization.
fit_bfgs
()fit_cg
()fit_fmin
(fit_func[, ftol])fit_l_bfgs_b
()fit_position
([unbinned, track, skip_coarse])Fit overall template position.
fit_tnc
(fit_func, grad_func[, ftol, quiet])get_ebands
([nband])hess_errors
([use_gradient])Set errors from hessian.
is_energy_dependent
()plot
([nbins, fignum, axes, plot_components, ...])plot_ebands
([nband, fignum, plot_zoom, ...])plot_residuals
([nbins, fignum])quick_fit
()Rotate both internal phases and template to a nice phase.
unbinned_gradient
(p, *args, **kwargs)unbinned_loglikelihood
(p, *args, **kwargs)write_template
([outputfile])- fit_position(unbinned=True, track=False, skip_coarse=False)[source]
Fit overall template position. Return shift and its error.
- Parameters:
- Returns:
delta_phi (float) – overall phase shift from template
delta_phi_err (float) – estimated uncertainty on phase shift from likelihood hessian
- fit_background(unbinned=True)[source]
Fit the background level, holding the ratios of the pulsed components fixed but varying their total normalization.
- rotate_for_display()[source]
Rotate both internal phases and template to a nice phase.
NB this will potentially break zero-phase references and will also necessitate re-binning if using binned mode.