pyecsca.sca.trace.trace module

Provides the Trace class.

class Trace(samples, meta=None, trace_set=None)[source]

Bases: object

Trace, which has some samples and metadata.

Construct a new trace.

Parameters:
  • samples (ndarray) – The sample array of the trace.

  • meta (Optional[Mapping[str, Any]]) – Metadata associated with the trace.

  • trace_set (Any) – A trace set the trace is contained in.

meta: Mapping[str, Any][source]
samples: ndarray[source]
property trace_set: Any[source]

Return the trace set this trace is contained in, if any.

with_samples(samples)[source]

Construct a copy of this trace, with the same metadata, but samples replaced by samples.

Parameters:

samples (ndarray) – The samples of the new trace.

Return type:

Trace

Returns:

The new trace.

astype(dtype)[source]

Construct a copy of this trace, with the same samples retyped using dtype.

Parameters:

dtype (Union[dtype[Any], None, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any]]) – The numpy dtype.

Return type:

Trace

Returns:

The new trace

class CombinedTrace(samples, meta=None, trace_set=None, parents=None)[source]

Bases: Trace

Trace that was combined from other traces, parents.

Construct a new trace.

Parameters:
  • samples (ndarray) – The sample array of the trace.

  • meta (Optional[Mapping[str, Any]]) – Metadata associated with the trace.

  • trace_set (Any) – A trace set the trace is contained in.

astype(dtype)[source]

Construct a copy of this trace, with the same samples retyped using dtype.

Parameters:

dtype (Union[dtype[Any], None, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any]]) – The numpy dtype.

Return type:

Trace

Returns:

The new trace

property trace_set: Any[source]

Return the trace set this trace is contained in, if any.

with_samples(samples)[source]

Construct a copy of this trace, with the same metadata, but samples replaced by samples.

Parameters:

samples (ndarray) – The samples of the new trace.

Return type:

Trace

Returns:

The new trace.

meta: Mapping[str, Any][source]
samples: ndarray[source]