AstrOmatic forum
Bug(?) with constant background subtraction - Printable Version

+- AstrOmatic forum (
+-- Forum: AstrOmatic software (/forumdisplay.php?fid=3)
+--- Forum: SWarp (/forumdisplay.php?fid=5)
+--- Thread: Bug(?) with constant background subtraction (/showthread.php?tid=593)

Bug(?) with constant background subtraction - dgb - 08-24-2010 18:40


I have noticed a surprising behaviour in the way SWarp (2.17.6) subtracts a constant background level supplied via the BACK_DEFAULT keyword, and thought it might not be the way it was intended it to be.

It seems that SWarp is first scaling the image (including applying flux corrections due to astrometric distortion of the pixels) before subtracting the constant background.

Since I am supplying the background level of the input images (which I would guess is what most people would do), this means that the resampled images are imperfectly subtracted. This is only a small effect (sub-percent-level due to the astrometric effect) in the images I have, but since they have a very large background level it makes a mess of the mosaic.

For now I will just subtract the background before supplying the images to SWarp, but i thought it was worth mentioning in case it causes confusion for anyone else.



RE: Bug(?) with constant background subtraction - Emmanuel Bertin - 08-25-2010 23:30

Hi Dave,

thanks! Yes you are right. This is (was) a bug. Among other fixes, today I rewrote part of the code that handled the rescaling of pixel values. Please check out the latest development version. It should work as intended now. I will do a new release soon, unless I broke something.
Thanks again for reporting this problem.
- Emmanuel.