Skip to content

UnprocessedWaveform

pyglaze.datamodels.UnprocessedWaveform

A dataclass representing an unprocessed waveform. No assumptions are made about the delay or signal.

Parameters:

Name Type Description Default
time FloatArray

The time values recorded by the lock-in amp during the scan.

required
signal FloatArray

The signal values recorded by the lock-in amp during the scan.

required

as_pulse()

Converts the current waveform to a Pulse object.

average(waveforms) classmethod

Computes the average of a list of UnprocessedWaveform objects.

Parameters:

Name Type Description Default
waveforms list[UnprocessedWaveform]

List of waveforms

required

from_dict(d) classmethod

Create an UnprocessedWaveform object from a dictionary.

Parameters:

Name Type Description Default
d dict[str, FloatArray | list[float] | None]

A dictionary containing the keys 'time', 'signal'.

required

from_polar_coords(time, radius, theta, rotation_angle=None) classmethod

Create an UnprocessedWaveform object from raw lock-in amp output.

Parameters:

Name Type Description Default
time FloatArray

The time values recorded by the lock-in amp during the scan.

required
radius FloatArray

The radius values recorded by the lock-in amp during the scan.

required
theta FloatArray

The theta values recorded by the lock-in amp during the scan (in degrees).

required
rotation_angle float | None

The angle to rotate lockin signal to align along x-axis. If not given, will use the angle at the maximum value of R.

None

from_triangular_waveform(ramp)

Picks out the pulse from a scan with fiberstretchers driven by a triangular waveform.

Parameters:

Name Type Description Default
ramp Literal['up', 'down']

Whether to pick out the pulse from the upgoing or downgoing ramp of the triangle wave

required

Raises:

Type Description
ValueError

If 'ramp' is neither 'up' or 'down'

Returns:

Type Description
UnprocessedWaveform

Raw waveform

reconstruct(method, times=None)

Reconstructs the waveform for a specified array of times using a specified method. If no delays are given, linearly spaced times between the maximum and the minimum of the delays will be used.

Parameters:

Name Type Description Default
method RecoMethod

Name of reconstruction method.

required
times FloatArray | None

Optional array of delay times.

None

Raises:

Type Description
ValueError

When an unknown reconstruction method is requested