Skip to content

Commit

Permalink
Pach for low channel counts
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Mar 13, 2020
1 parent 04a9dea commit c99dd8a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions circus/shared/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ def __init__(self, params, app, extension_in='', extension_out='-merged'):
self.has_support = test_if_support(params, self.ext_in)
if self.has_support:
self.supports = io.load_data(params, 'supports', self.ext_in)
self.mean_channels = numpy.mean(numpy.sum(self.supports, 1))
if self.mean_channels < 3:
self.low_channel_count = True
if comm.rank == 0:
print_and_log(["Templates on few channels only, taking norm into account"], 'debug', logger)
else:
self.low_channel_count = False
self.bin_size = int(self.cc_bin * self.sampling_rate * 1e-3)
self.max_delay = 50
self.time_rpv = params.getfloat('merging', 'time_rpv')
Expand Down Expand Up @@ -1164,6 +1171,10 @@ def suggest_pairs(self, event):

indices = numpy.where(all_indices)[0]

if self.low_channel_count:
ratios = self.norms[self.pairs[indices,0]]/self.norms[self.pairs[indices,1]]
indices = indices[numpy.where(numpy.abs(ratios - 1) < 0.1)[0]]

if self.app is not None:
self.app.setOverrideCursor(QCursor(Qt.WaitCursor))

Expand Down

0 comments on commit c99dd8a

Please sign in to comment.