estim_error_nearest_data
- jwst.extract_1d.soss_extract.soss_boxextract.estim_error_nearest_data(err, data, pix_to_estim, valid_pix)[source]
Estimate pixel error empirically using error on nearby pixel values in data.
Intended to be used in a box extraction when the bad pixels are modeled.
- Parameters:
- errndarray
Uncertainty map (2D) of the pixels.
- datandarray
Pixel values (2D).
- pix_to_estimndarray
Boolean map (2D) of the pixels where the uncertainty needs to be estimated.
- valid_pixndarray
Boolean map (2D) of valid pixels to be used to find the error empirically.
- Returns:
- err_filledndarray
Same as
err(2D), but the pixels to be estimated are filled with the estimated values.
Notes
For uncorrelated noise, the average error on the replaced pixels will be roughly half of the average error on the original good pixels. The reason is because this method chooses the lower error between the two nearest-flux data points, leading to a factor-of-2 decrease (assuming errors are normally distributed). Future work should follow up on whether this remains the desired behavior.