Skip to content

← utilities package

ShiftTimestamps

Shift the timestamps in the given signal by some delta.

This is mostly useful to compensate for shifts in the signal introduced by the data acquisition process, or shifts that were introduced by some preceding filters. In the latter case, the shift is known and can be accounted for by enabling the compensate for filter lags property. The timestamp_pairs port can receive pairs of timestamps (arranged as [[original, new], ...]), for piecewise interpolation of the data packet's timestamps using the timestamp pairs. This node can also be used to reset the timestamps so that the first timestamp in the signal is 0 (by enabling the beginning_from_zero property), which is useful if you wish to downstream trim or select a time range relative to the start of the file. Version 1.2.3

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: INOUT

offset

Offset to add to time stamps. In seconds. This parameter is mostly useful if your data acquisition process introduces some known consistent shift.

  • verbose name: Time Offset
  • default value: 0
  • port type: FloatPort
  • value type: float (can be None)

use_time_axis

In case of having both instance and time axes, force timeshift using the time axis instead of instance axis. This is useful in the case of having an instance axis with in which time is not being used. For example, using an instance axis to store session/subject meta data in grouping fields.

  • verbose name: Shift Time Axis Not Instance
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

timestamp_pairs

Pairs of timestamps for piecewise shifting as a nested array of floats: [[original, new], [original, new], .. .].

  • verbose name: Timestamp Pairs
  • default value: None
  • port type: ListPort
  • value type: list (can be None)

compensate_filter_lag

Compensate for filter delay. If enabled, this node will in addition compensate for the accumulated logical (signal) delay of the preceding filters. Note that this is unrelated to how long these filters actually take to compute -- it only measures by how much they shift the data content relative to its time axis.

  • verbose name: Compensate For Filter Lags
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

include_markers

Also shift time stamps of markers. If this is enabled, then this will not apply a relative shift between signal and markers, but apply to all streams in the data in the same way. This should be set to True if you are resetting the timestamps to 0 (with beginning_from_zero set to True), so that the markers do not change their relative position to the signal.

  • verbose name: Shift Whole Packet
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

marker_fields

List of marker (instance axis data) fields that should also be shifted. e.g. events may have a 'stop' column to indicate the stop time of each event. If the event time gets shifted then the stop time should get shifted too.

  • verbose name: Shift Marker Fields
  • default value: None
  • port type: ListPort
  • value type: list (can be None)

beginning_from_zero

Shift the timestamps such that the first stamp in the signal is 0. Other streams (e.g., markers) will be shifted consistently with it. Note that for streaming data, this will only reset the starting timestamp to 0 when the pipeline is restarted, not if there is some other change in the data at runtime that triggers a signal_changed event.

  • verbose name: Beginning From Zero
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

offset_triggers_state_reset

Changing the offset triggers a reset on subsequent nodes.

  • verbose name: Offset Triggers State Reset
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)