Spatially median smooth the sky, clipping at 2.3sigma.
Thresholds are in units of the smoothed-sky sigma, which is estimated from the interquartile range.
This is required as we detect objects based on pixels above a threshold, but we know that objects are in fact larger. Specifically, if an object is detected in only one pixel we know that it in fact covers at least an entire seeing disk, and this stage of growing detected objects allows for this. Bin Frame Bin the frame by some power of two in both row and column direction. The data is scaled up by the square root of the area of the binned pixel, so that no significant information is lost. Binning is generally applied to data which has had an object finder run on it, and in which all detected objects have been replaced by the background level.