phoebe-project / phoebe2

PHOEBE - Eclipsing Binary Star Modeling Software
http://phoebe-project.org
GNU General Public License v3.0
76 stars 28 forks source link

estimators: phase_nbins resulting in empty bin raises error #749

Open kecnry opened 1 year ago

kecnry commented 1 year ago

see https://github.com/phoebe-project/phoebe2/discussions/743

When any bin is empty of data, the two-gaussian fit raises a Residuals are not finite in the initial point. exception for all attempted models which eventually then results in the following traceback:

File ~/.local/lib/python3.10/site-packages/phoebe/solverbackends/solverbackends.py:641, in Lc_GeometryBackend.run_worker(self, b, solver, compute, **kwargs)
    637 model_classes = {'two-gaussian': ligeor.models.TwoGaussianModel,
    638                 'polyfit': ligeor.models.Polyfit}
    640 model = model_classes.get(analytical_model)(phases=phases, fluxes=fluxes, sigmas=sigmas)
--> 641 model.fit()
    642 eclipse_dict = model.compute_eclipse_params(interactive=interactive)
    644 fitted_params = [t0_supconj_param, ecc_param, per0_param, rsum_param, teffratio_param]

File ~/.local/lib/python3.10/site-packages/phoebe/dependencies/ligeor/models/twogaussian.py:102, in TwoGaussianModel.fit(self, fit_funcs, param_vals)
     99     self.fit_twoGaussian_models()
    100     # compute all model light curves
--> 102 self.compute_twoGaussian_models()
    103 # compute corresponding BIC values
    104 self.compute_twoGaussian_models_BIC()

File ~/.local/lib/python3.10/site-packages/phoebe/dependencies/ligeor/models/twogaussian.py:621, in TwoGaussianModel.compute_twoGaussian_models(self)
    618 models = {}
    620 for fkey in self.fits.keys():
--> 621     models[fkey] = self.twogfuncs[fkey](self.phases, *self.fits[fkey])
    623 self.models = models

TypeError: TwoGaussianModel.ce() missing 2 required positional arguments: 'Aell' and 'phi0'