nitypes.waveform.Timing

class nitypes.waveform.Timing(sample_interval_mode: nitypes.waveform.SampleIntervalMode, timestamp: nitypes.waveform.typing.TTimestamp_co | None = None, time_offset: nitypes.waveform.typing.TTimeOffset_co | None = None, sample_interval: nitypes.waveform.typing.TSampleInterval_co | None = None, timestamps: collections.abc.Sequence[nitypes.waveform.typing.TTimestamp_co] | None = None, *, copy_timestamps: bool = True)

Bases: Generic[nitypes.waveform.typing.TTimestamp_co, nitypes.waveform.typing.TTimeOffset_co, nitypes.waveform.typing.TSampleInterval_co]

Waveform timing information.

Waveform timing objects are immutable.

Parameters:
  • sample_interval_mode (nitypes.waveform.SampleIntervalMode)

  • timestamp (nitypes.waveform.typing.TTimestamp_co | None)

  • time_offset (nitypes.waveform.typing.TTimeOffset_co | None)

  • sample_interval (nitypes.waveform.typing.TSampleInterval_co | None)

  • timestamps (collections.abc.Sequence[nitypes.waveform.typing.TTimestamp_co] | None)

  • copy_timestamps (bool)

empty: ClassVar[Timing[datetime.datetime, datetime.timedelta, datetime.timedelta]]

A waveform timing object with no timestamp, time offset, or sample interval.

classmethod create_with_no_interval(timestamp: nitypes.waveform.typing.TTimestamp | None = None, time_offset: nitypes.waveform.typing.TTimeOffset | None = None) Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset, nitypes.waveform.typing.TSampleInterval_co]

Create a waveform timing object with no sample interval.

Parameters:
  • timestamp (nitypes.waveform.typing.TTimestamp | None) – A timestamp representing the start of an acquisition or a related occurrence.

  • time_offset (nitypes.waveform.typing.TTimeOffset | None) – The time difference between the timestamp and the time that the first sample was acquired.

Returns:

A waveform timing object.

Return type:

Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset, nitypes.waveform.typing.TSampleInterval_co]

classmethod create_with_regular_interval(sample_interval: nitypes.waveform.typing.TSampleInterval, timestamp: nitypes.waveform.typing.TTimestamp | None = None, time_offset: nitypes.waveform.typing.TTimeOffset | None = None) Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset, nitypes.waveform.typing.TSampleInterval]

Create a waveform timing object with a regular sample interval.

Parameters:
  • sample_interval (nitypes.waveform.typing.TSampleInterval) – The time difference between samples.

  • timestamp (nitypes.waveform.typing.TTimestamp | None) – A timestamp representing the start of an acquisition or a related occurrence.

  • time_offset (nitypes.waveform.typing.TTimeOffset | None) – The time difference between the timestamp and the time that the first sample was acquired.

Returns:

A waveform timing object.

Return type:

Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset, nitypes.waveform.typing.TSampleInterval]

classmethod create_with_irregular_interval(timestamps: collections.abc.Sequence[nitypes.waveform.typing.TTimestamp]) Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset_co, nitypes.waveform.typing.TSampleInterval_co]

Create a waveform timing object with an irregular sample interval.

Parameters:

timestamps (collections.abc.Sequence[nitypes.waveform.typing.TTimestamp]) – A sequence containing a timestamp for each sample in the waveform, specifying the time that the sample was acquired.

Returns:

A waveform timing object.

Return type:

Timing[nitypes.waveform.typing.TTimestamp, nitypes.waveform.typing.TTimeOffset_co, nitypes.waveform.typing.TSampleInterval_co]

__slots__ = ['_sample_interval_strategy', '_sample_interval_mode', '_timestamp', '_time_offset',...
property has_timestamp: bool

Indicates whether the waveform timing has a timestamp.

Return type:

bool

property timestamp: nitypes.waveform.typing.TTimestamp_co

A timestamp representing the start of an acquisition or a related occurrence.

Return type:

nitypes.waveform.typing.TTimestamp_co

property has_start_time: bool

Indicates whether the waveform timing has a start_time.

Return type:

bool

property start_time: nitypes.waveform.typing.TTimestamp_co

The time that the first sample in the waveform was acquired.

This is equivalent to t0 in a LabVIEW waveform. This value is derived from timestamp + time_offset.

Return type:

nitypes.waveform.typing.TTimestamp_co

property has_time_offset: bool

Indicates whether the waveform timing has a time offset.

Return type:

bool

property time_offset: nitypes.waveform.typing.TTimeOffset_co

The time difference between the timestamp and the first sample.

Return type:

nitypes.waveform.typing.TTimeOffset_co

property has_sample_interval: bool

Indicates whether the waveform timing has a sample interval.

Return type:

bool

property sample_interval: nitypes.waveform.typing.TSampleInterval_co

The time interval between samples.

This is equivalent to dt in a LabVIEW waveform.

Return type:

nitypes.waveform.typing.TSampleInterval_co

property sample_interval_mode: nitypes.waveform.SampleIntervalMode

The sample interval mode that specifies how the waveform is sampled.

Return type:

nitypes.waveform.SampleIntervalMode

get_timestamps(start_index: SupportsIndex, count: SupportsIndex) collections.abc.Iterable[nitypes.waveform.typing.TTimestamp_co]

Retrieve the timestamps of the waveform samples.

Parameters:
  • start_index (SupportsIndex) – The sample index of the first timestamp to retrieve.

  • count (SupportsIndex) – The number of timestamps to retrieve.

Returns:

An iterable containing the requested timestamps.

Return type:

collections.abc.Iterable[nitypes.waveform.typing.TTimestamp_co]

to_bintime() Timing[nitypes.bintime.DateTime, nitypes.bintime.TimeDelta, nitypes.bintime.TimeDelta]

Convert the timing information to use nitypes.bintime.

Return type:

Timing[nitypes.bintime.DateTime, nitypes.bintime.TimeDelta, nitypes.bintime.TimeDelta]

to_datetime() Timing[datetime.datetime, datetime.timedelta, datetime.timedelta]

Convert the timing information to use DateTime.

Return type:

Timing[datetime.datetime, datetime.timedelta, datetime.timedelta]

to_hightime() Timing[hightime.datetime, hightime.timedelta, hightime.timedelta]

Convert the timing information to use hightime.

Return type:

Timing[hightime.datetime, hightime.timedelta, hightime.timedelta]

__eq__(value: object, /) bool

Return self==value.

Parameters:

value (object)

Return type:

bool

__reduce__() tuple[Any, Ellipsis]

Return object state for pickling.

Return type:

tuple[Any, Ellipsis]

__repr__() str

Return repr(self).

Return type:

str