rpoleski / MulensModel

Microlensing Modelling package

Home Page:https://rpoleski.github.io/MulensModel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Negative source flux in `FitData.scale_fluxes()` and model plotting in example 16

rpoleski opened this issue · comments

The function _get_ylim_for_best_model_plot() has a condition y_err < 0., but y_err there is scaled flux uncertainty. I think it can be negative only if either data_source_flux or source_flux in FitData.scale_fluxes() is negative. In that case we should probably:

  • add a warning in FitData.scale_fluxes() for negative output of flux uncertainty (because users don't expect that),
  • add a check in UlensModelFit._get_ylim_for_best_model_plot(): if np.sum(mask) == 0: continue; also handle above warning properly.
    Jen - can you do the first change?