Skip to content

Commit

Permalink
spectral extraction defaults: fix case where background exactly on edge
Browse files Browse the repository at this point in the history
* should default to one-sided if the default background separation would fall exactly on the edge of the image
  • Loading branch information
kecnry committed Sep 9, 2022
1 parent 8896492 commit 2b9c304
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b9c304

Please sign in to comment.