sfit_minimizer.mm_funcs module

class sfit_minimizer.mm_funcs.PSPLFunction(event, parameters_to_fit, estimate_fluxes=False)

Bases: sfit_minimizer.sfit_classes.SFitFunction

A class for fitting a point-source point-lens microlensing light curve to observed data using sfit_minimizer.sfit_minimize.minimize(). Simultaneously fits microlensing parameters and source and blend fluxes for each dataset.

Arguments:
event: MulensModel.Event() object

event contains datasets and an initial model.

parameters_to_fit: list of str

list of the named model parameters to be fit. (Not including the fluxes.)

Note: if you want to fix the source or blend flux for a particular dataset, use the fix_source_flux or fix_blend_flux keywords in event as usual.

flatten_data()

Concatenate good points for all datasets into a single array with columns: Date, flux, err.

update_all(theta0=None, verbose=False)

Recalculate all of the data properties with respect to the new model parameters.

Keywords:
theta0: list of length M, optional

new trial values for the parameters of the function to be fit. If not provided, recalculate using the current value of theta.

verbose: bool, optional

Default is False. If True, prints output after each stage for debugging.

calc_residuals()

Calculate expected values of the residuals

calc_df()

Calculate the derivatives of the fitting function and store as self.df.