From a4c7073c5eea6875fc30cddceb41be1881614083 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 9 Sep 2022 09:05:10 -0400 Subject: [PATCH] spectral extraction defaults: fix case where background exactly on edge * should default to one-sided if the default background separation would fall exactly on the edge of the image --- CHANGES.rst | 6 ++++++ .../plugins/spectral_extraction/spectral_extraction.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 90d8033b06..52cd76aa1f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -62,6 +62,12 @@ Mosviz Specviz ^^^^^^^ +Specviz2d +^^^^^^^^^ + +- Fixed default spectral extraction parameters when the background separation otherwise would have + fallen directly on the edge of the image. [#1633] + Other Changes and Additions --------------------------- diff --git a/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py index 5a5b219538..443627ca13 100644 --- a/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py @@ -169,7 +169,7 @@ def _trace_dataset_selected(self, msg=None): if self.bg_trace_pixel == 0: self.bg_trace_pixel = brightest_pixel if self.bg_separation == 0: - if default_bg_width * 2 > distance_from_edge: + if default_bg_width * 2 >= distance_from_edge: self.bg_type_selected = 'OneSided' # we want positive separation if brightest_pixel near bottom sign = 1 if (brightest_pixel < width / 2) else -1