From 61c0f4ddb2f158547eb4e93b91d39d7cec9ff3f7 Mon Sep 17 00:00:00 2001 From: elanaku Date: Tue, 24 Feb 2026 23:00:55 -0300 Subject: [PATCH 1/4] add Galsim coordinate offset --- python/lsst/summit/utils/guiders/detection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/lsst/summit/utils/guiders/detection.py b/python/lsst/summit/utils/guiders/detection.py index 4f17b3c2..a5deb3f6 100644 --- a/python/lsst/summit/utils/guiders/detection.py +++ b/python/lsst/summit/utils/guiders/detection.py @@ -373,8 +373,11 @@ def measureStarOnStamp( star.runAperturePhotometry(dataBkgSub, apertureRadius, gain=gain, bkgStd=bkgStd) # 4) Add centroid and shape in amplifier roi coordinates - star.xroi += cutout.xmin_original - star.yroi += cutout.ymin_original + # GalSim uses 1-based indexing where (1,1) is the center of pixel [0,0]. + # Matplotlib's imshow with extent=(0,w,0,h) places pixel centers at half-integers. + # To align: subtract 0.5 to convert GalSim coords to matplotlib pixel-center coords. + star.xroi += cutout.xmin_original - 0.5 + star.yroi += cutout.ymin_original - 0.5 return star From 38f18ea6921985e2a6b98d712799b77921278b90 Mon Sep 17 00:00:00 2001 From: elanaku Date: Sat, 28 Feb 2026 00:09:37 -0300 Subject: [PATCH 2/4] Fix formatting --- python/lsst/summit/utils/guiders/detection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/lsst/summit/utils/guiders/detection.py b/python/lsst/summit/utils/guiders/detection.py index a5deb3f6..fd707880 100644 --- a/python/lsst/summit/utils/guiders/detection.py +++ b/python/lsst/summit/utils/guiders/detection.py @@ -373,9 +373,11 @@ def measureStarOnStamp( star.runAperturePhotometry(dataBkgSub, apertureRadius, gain=gain, bkgStd=bkgStd) # 4) Add centroid and shape in amplifier roi coordinates - # GalSim uses 1-based indexing where (1,1) is the center of pixel [0,0]. - # Matplotlib's imshow with extent=(0,w,0,h) places pixel centers at half-integers. - # To align: subtract 0.5 to convert GalSim coords to matplotlib pixel-center coords. + # GalSim uses 1-based indexing where (1,1) is the + # center of pixel [0,0].Matplotlib's imshow with + # extent=(0,w,0,h) places pixel centers at half-integers. + # To align: subtract 0.5 to convert GalSim coords to + # matplotlib pixel-center coords. star.xroi += cutout.xmin_original - 0.5 star.yroi += cutout.ymin_original - 0.5 return star From 73c5491adf981913b941e19be6984f9c5ffde837 Mon Sep 17 00:00:00 2001 From: elanaku Date: Sat, 28 Feb 2026 00:17:14 -0300 Subject: [PATCH 3/4] Fix formatting --- python/lsst/summit/utils/guiders/detection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/lsst/summit/utils/guiders/detection.py b/python/lsst/summit/utils/guiders/detection.py index fd707880..feb34c83 100644 --- a/python/lsst/summit/utils/guiders/detection.py +++ b/python/lsst/summit/utils/guiders/detection.py @@ -373,10 +373,10 @@ def measureStarOnStamp( star.runAperturePhotometry(dataBkgSub, apertureRadius, gain=gain, bkgStd=bkgStd) # 4) Add centroid and shape in amplifier roi coordinates - # GalSim uses 1-based indexing where (1,1) is the - # center of pixel [0,0].Matplotlib's imshow with + # GalSim uses 1-based indexing where (1,1) is the + # center of pixel [0,0].Matplotlib's imshow with # extent=(0,w,0,h) places pixel centers at half-integers. - # To align: subtract 0.5 to convert GalSim coords to + # To align: subtract 0.5 to convert GalSim coords to # matplotlib pixel-center coords. star.xroi += cutout.xmin_original - 0.5 star.yroi += cutout.ymin_original - 0.5 From d9535fd92f89ed67709aa36009e932b249aab82a Mon Sep 17 00:00:00 2001 From: Elana Kahn Urbach Date: Sun, 1 Mar 2026 22:45:22 +0000 Subject: [PATCH 4/4] Change residual threshold on fit --- python/lsst/summit/utils/guiders/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/summit/utils/guiders/metrics.py b/python/lsst/summit/utils/guiders/metrics.py index e57d6078..ec41e9dd 100644 --- a/python/lsst/summit/utils/guiders/metrics.py +++ b/python/lsst/summit/utils/guiders/metrics.py @@ -297,7 +297,7 @@ def computeTrendMetrics( global_std = float(mad_std(y)) fitter = RobustFitter() - fit_res = fitter.fit(x, y) + fit_res = fitter.fit(x, y, residualThreshold=3.0) return GuiderDriftResult( fit=fit_res,