Signal Functions

pycube.signaltools.tf.par_freq_response(file_list=[])

Calculate the frequency response of the given pairs of signals.

Cube Parameters:
  • task_source (str): name of the source task, with h5 file with the signals in the subfolder ‘results’

  • task_target (str, optional): name of the target task, defaults to current task

  • tf_def (list[dict]): list of dicts, each containing signals “in” and “out” as well as “result”, the latter being the name of the resultant transfer function which defaults to “signal1_signal2” if empty/missing

  • fft_length (int): length per time sequence segment, must be a power of 2

  • fft_overlap_percent (int): segment overlap in %

  • window (str): window as per scipy.signal.get_window, windows without parameters

Example for tf_def:

param.tf_def = [
    {
        'in': signal_1,
        'out': signal_2,
        'result': 'tf12',
    },
    {
        'in': signal_1,
        'out': signal_3,
        'result': '',
    },
]
Parameters:

file_list (List[str]) – list of h5 files to be used. Defaults to empty: All h5 files found in the source folders are used

pycube.signaltools.trigger.par_fetch_data()

Get values at a trigger point from a selection of h5 files. The data is consolidated as a pandas dataframe and stored as csv and Excel file.

Cube Parameters:
  • task_source (str): name of the source task, with h5 file with the signals in the subfolder ‘results’

  • task_target (str, optional): name of the target task, defaults to current task

  • target_filename (str): name of the file containing the consolidated data

  • signal_trigger (str): name of the trigger signal (*)

  • trigger_rising (bool): if True rising edges are detected, if False falling edges are detected

  • trigger_threshold (float): if this value is exceeded, values are fetched

  • start_time (float): Offset time at which the trigger search starts (*)

  • substring (str): substring to define a selection of files

Optional parameter to style the table image:
  • plot_png (bool, optional): determines whether a png image of the dataframe is generated. Default is False. If set True, but no other optional parameter is set, a png image with white background is generated

  • color_map (str, optional): name of the Python color map used. Set ‘’ for no background color

  • color_axis (str, optional): determines the type of color coding None = global color coding, 0 = coding per column, 1 = coding per row

  • decimal_places (int, optional): number of visualized digits. Set -1 for no rounding

  • color_NaN (str, optional): color to highlight NaN values. Set ‘’ for no highlighting

  • color_min (str, optional): color to highlight minimum values. Set ‘’ for no highlighting

  • min_color_axis (str, optional): determines the type of color coding None = global color coding, 0 = coding per column, 1 = coding per row

  • color_max (str, optional): color to highlight maximum values. Set ‘’ for no highlighting

  • max_color_axis (str, optional): determines the type of color coding None = global color coding, 0 = coding per column, 1 = coding per row

(*) if signal_trigger is not defined or empty, start_time is taken as the trigger point. if trigger event is not found, the final time is taken as the trigger point.