mirror of
https://github.com/ciromattia/kcc
synced 2025-12-11 00:36:33 +00:00
* Inter-panel cropping method. * 1. Save interpanelcrop option. 2. Update readme with the the new interpanelcrop argument. 3. Add a tooltip to the inter-panel crop box.
29 lines
675 B
Python
29 lines
675 B
Python
def threshold_from_power(power):
|
|
return 240-(power*64)
|
|
|
|
|
|
'''
|
|
Groups close values together
|
|
'''
|
|
def group_close_values(vals, max_dist_tolerated):
|
|
groups = []
|
|
|
|
group_start = -1
|
|
group_end = 0
|
|
for i in range(len(vals)):
|
|
dist = vals[i] - group_end
|
|
if group_start == -1:
|
|
group_start = vals[i]
|
|
group_end = vals[i]
|
|
elif dist <= max_dist_tolerated:
|
|
group_end = vals[i]
|
|
else:
|
|
groups.append((group_start, group_end))
|
|
group_start = -1
|
|
group_end = -1
|
|
|
|
if group_start != -1:
|
|
groups.append((group_start, group_end))
|
|
|
|
return groups
|