Skip to content

Commit

Permalink
tweak logic so manual is always in same position as "OneSided"
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Oct 14, 2022
1 parent d0bc2e4 commit 76b4e4b
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,22 @@ def _trace_dataset_selected(self, msg=None):

# sign for one-sided and single trace-pixel depending on whether the brightest pixel is
# above or below the middle of the image
sign = 1 if (brightest_pixel < width / 2) else -1
if default_bg_width * 2 >= distance_from_edge:
sign = 1 if (brightest_pixel < width / 2) else -1
default_bg_separation = sign * default_bg_width * 2
else:
default_bg_separation = default_bg_width * 2

if self.trace_pixel == 0:
self.trace_pixel = brightest_pixel
if self.trace_window == 0:
self.trace_window = default_width
if self.bg_trace_pixel == 0:
self.bg_trace_pixel = brightest_pixel + sign * default_bg_width * 2
self.bg_trace_pixel = brightest_pixel + default_bg_separation
if self.bg_separation == 0:
if default_bg_width * 2 >= distance_from_edge:
self.bg_type_selected = 'OneSided'
self.bg_separation = sign * default_bg_width * 2
else:
self.bg_separation = default_bg_width * 2
self.bg_separation = default_bg_separation
if self.bg_width == 0:
self.bg_width = default_bg_width
if self.ext_width == 0:
Expand Down

0 comments on commit 76b4e4b

Please sign in to comment.