Skip to content

analysis

Analysis

A series of convenience functions for processing raw data.

AnalysisResult (tuple)

A named tuple for storing analysis results.

Attributes:

Name Type Description
wl ndarray

Wavelength values.

data ndarray

Corresponding data values.

data_hash: str property readonly

The hash of the raw data.

wavelength_hash: str property readonly

The hash of the wavelength data.

__getnewargs__(self) special

Return self as a plain tuple. Used by copy and pickle.

__new__(_cls, wl, data) special staticmethod

Create new instance of AnalysisResult(wl, data)

__repr__(self) special

Return a nicely formatted representation string

WavelengthAnalyzer

Uses a trigger signal to convert datasets from time-domain to wavelength.

Correlates a trigger signal, typically output from a laser, to a dataset. The laser logs the current wavelength each time the trigger is high. The trigger signal is expected to be a single channel of data as acquired by a data acquisition device. The wavelength sweep rate may not be constant or linear in time. After receiving trigger data and the corresponding wavelengths, a curve is fit to the wavelength as a function of time. Wavelengths for the raw data is then calculated by sampling the curve at the same time points as the raw data.

Parameters:

Name Type Description Default
sample_rate float

The sample rate of the acquired data. Sample rate of the trigger signal should be the same as the sample rate of the raw data.

required
trigger_data ndarray

The collected trigger signal. A peak finding algorithm is used to correlate time points to the wavelength log.

required
wavelength_log ndarray

Log of wavelengths for each time the trigger signal was high.

required

process_data(self, raw_data)

Converts raw data to wavelength by interpolating against wavelength logs.

Parameters:

Name Type Description Default
raw_data ndarray

The raw data to convert.

required

Returns:

Type Description
AnalysisResult

A dictionary of processed data. Has the keys "wavelengths", "data", "wavelength_hash", and "data_hash".

Back to top