From 56ea797634c7735e82481e9652cd878da90e0eee Mon Sep 17 00:00:00 2001 From: Alfredo Mejia-Narvaez Date: Thu, 1 Feb 2024 10:39:21 -0300 Subject: [PATCH] temporary fix for error propagation bug in detrending --- python/lvmdrp/functions/imageMethod.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/lvmdrp/functions/imageMethod.py b/python/lvmdrp/functions/imageMethod.py index 5e22168f..19ac1bbb 100644 --- a/python/lvmdrp/functions/imageMethod.py +++ b/python/lvmdrp/functions/imageMethod.py @@ -3376,7 +3376,10 @@ def detrend_frame( log.info("subtracting master dark") elif in_dark and in_pixelflat: log.info("subtracting master dark and dividing by master pixelflat") - detrended_img = (bcorr_img - mdark_img.convertUnit(to=bcorr_img._header["BUNIT"])) / mflat_img + + detrended_img = (bcorr_img - mdark_img.convertUnit(to=bcorr_img._header["BUNIT"])) + # NOTE: this is a hack to avoid the error propagation of the division in Image + detrended_img = detrended_img / mflat_img._data # propagate pixel mask log.info("propagating pixel mask")