Skip to content

Instantly share code, notes, and snippets.

@CharlesLedger
Last active February 19, 2019 07:41
Show Gist options
  • Save CharlesLedger/7bb4c96caaff350405300c1ce29efed1 to your computer and use it in GitHub Desktop.
Save CharlesLedger/7bb4c96caaff350405300c1ce29efed1 to your computer and use it in GitHub Desktop.
from lascar import *
container = NpyContainer('test_leakages','test_values') # load data
class Synchronization:
def __init__(self, lref):
self.ref_peak_offset = ref.argmax()
def __call__(self, leakage):
#We need to find the peak in each leakage,and roll it to match the ref_peak
peak_offset = leakage.argmax()
return np.roll(leakage, self.ref_peak_offset-peak_offset )
container.leakage_processing = Synchronisation(ref=container[0].leakage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment