autosweep.sweep.Sweep#

class autosweep.sweep.Sweep(traces: dict, attrs: Optional[dict] = None, metadata: Optional[dict] = None)[source]#

A class used to manipulate test data, usually taken as a sweep (IV, laser power meter, etc.). Simplifies handling metadta, units and import/export.

Parameters:
  • traces (dict) – The collection of data from the sweep, in ch-name (key) - values (value) pairs.

  • attrs (dict, optional) – The collection of trace attributes, with the same channel names as the traces

  • metadata (dict, optional) – Any additional metadata specific to this sweep

__init__(traces: dict, attrs: Optional[dict] = None, metadata: Optional[dict] = None)[source]#

Methods

__init__(traces[, attrs, metadata])

change_unit(col, coeff[, unit, desc])

This method can change the scaling of a trace, it's unit, and its description.

filter_range(x_min, x_max)

Applies an operation to filter all trace data within the x-value range passed in.

from_dict(data)

Used to create a Sweep instance from a dict.

get_axis_labels([use_generic_names])

Returns axis labels based on attributes (attrs).

get_trace_col(col)

A helper function which checks the input column name against the trace names and their aliases.

itercols()

Iterate over traces as (y-name, x-data, y-data).

to_dict()

Used to export all relevant parameters for re-creating the Sweep instance.

Attributes

attrs

ranges

Accessor for the min and max values of each trace

shape

The shape of traces.

x_col

Accessor for the name of the X column (first) trace data

y_cols

Accessor for the name of the Y columns (second onward) trace data