; ; Used by fit_sed.pro ; ; function bg_mpfit, a, XVAL=x, YVAL=y, ERRVAL=err, COLOR_C= color_c if n_elements(err) EQ 0 then begin err = x err(*) = 1. endif model = BG( x, a, COLOR_C= color_c ) res = (y-model)/err return, res end