specutils icon indicating copy to clipboard operation
specutils copied to clipboard

Handle uncertainties of 0 in fitting weights

Open rosteen opened this issue 3 years ago • 0 comments

Currently, if given weights="unc" in fitting, specutils naively tries to convert the spectrum's uncertainty attribute to StdDevUncertainty and then invert those values to use for weights in the model fit. This leads to a failed np.isfinite check in astropy model fitting if some/all of the uncertainties are 0. We need to handle these cases more elegantly, and potentially provide a couple arguments to let the users define how they want them handled.

rosteen avatar Dec 01 '22 14:12 rosteen