MulensModel icon indicating copy to clipboard operation
MulensModel copied to clipboard

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

Open rpoleski opened this issue 2 years ago • 0 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?

rpoleski avatar Feb 24 '23 10:02 rpoleski