Skip to content

Commit

Permalink
Fix bug in the application of the stretch_factor and the timeshift. B…
Browse files Browse the repository at this point in the history
…oth can occur independently from each other, so you need to if tests.

The division by 2 in case of the timeshift is maybe not right, but it was working for my data.
  • Loading branch information
MSCL committed Aug 14, 2020
1 parent a6c7619 commit 70ec2c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jointly/synchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@ def get_synced_data(self, recalculate=False):
start_time = self.ref_signals.index.min()
for source_name, source in self.sources.items():
data = source['data'].copy()
if source['stretch_factor'] is not 1:
if source['stretch_factor'] != 1:
data = Synchronizer._stretch_signals(data, source['stretch_factor'], start_time)
data = data.shift(1, freq=source['timeshift'])
if source['timeshift'] is not None:
data = data.shift(1, freq=source['timeshift'] / 2)
synced_data[source_name] = data
return synced_data

Expand Down

0 comments on commit 70ec2c3

Please sign in to comment.