Synchronization API reference

Provides higher-level python objects to easily apply synchronization method to ths objects.

exception scared.synchronization.ResynchroError[source]

Error to raise in resynchronization function to reject trace.

exception scared.synchronization.SynchronizerError[source]

Synchronizer Error Exception.

class scared.synchronization.Synchronizer(input_ths, output, function, overwrite=False, **kwargs)[source]

Higher-level python objects to apply resynchronization method to ths objects.

input_ths

Input ths that contain campaign to synchronize.

Type:

TraceHeaderSet

output

If filename, an ETSWriter object is build with this filename.

Type:

str or TraceHeaderSet

function

Function to use for synchronization.

Type:

function

synchronized_counter

Number of synchronized traces.

overwrite

If True, reset and overwrite output file (default: False).

Type:

bool

kwargs

Used to pass extra named arguments to the synchronization function.

Note

  • The following arguments are passed to the synchronization function:
    • trace_object: trace object from trace set

    • **kwargs directly from Synchronizer

  • stdout is disabled during Synchronizer.run().

Warning

All plots in synchronization function must be disabled before launching Synchronizer.run().

__init__(input_ths, output, function, overwrite=False, **kwargs)[source]
check(nb_traces=5, catch_exceptions=True)[source]

Test synchronization function on traces picked randomly in trace set.

Parameters:
  • nb_traces (int) – Number of traces to test on.

  • catch_exceptions (bool) – If True, exceptions are caught and just printed. You can disable it to view the full traceback.

Returns:

Trace arrays.

Return type:

(list)

run()[source]

Perform synchronization.

Returns:

Ths object of synchronized campaign.

Return type:

(TraceHeaderSet)

Note

This function is callable only one time.

report()[source]

Print some statistics about synchronization.