MulensModel
MulensModel copied to clipboard
Negative source flux in `FitData.scale_fluxes()` and model plotting in example 16
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?