optoanalysis.LeCroy package

optoanalysis.LeCroy.LeCroy module

class optoanalysis.LeCroy.LeCroy.HDO6104(address='152.78.194.16')[source]

Bases: object

Class for communicating with the Teledyne LeCroy Oscilloscope.

data(channel=1)[source]

Reads the raw input from the scope and interprets it returning the header information, time, voltage and raw integers read with the ADC.

Parameters:
channel : int

channel number of read

Returns:
WAVEDESC : dict

dictionary containing some properties of the time trace and oscilloscope settings extracted from the header file.

x : ndarray

The array of time values recorded by the oscilloscope

y : ndarray

The array of voltage values recorded by the oscilloscope

integers : ndarray

The array of raw integers recorded from the ADC and stored in the binary file

opc()[source]

Asks the oscilloscope if it is done processing data.

Returns:
IsDoneProcessing : bool

returns False if oscilloscope is still busy, True is oscilloscope is done processing last commands.

raw(channel=1)[source]

Reads the raw input from the oscilloscope.

Parameters:
channel : int

channel number of read

Returns:
rawData : bytes

raw binary data read from the oscilloscope

waitOPC()[source]

Waits for a response from the oscilloscope indicating that processing is complete and it is ready to receive more commands. Function sleeps until the oscilloscope is ready.

optoanalysis.LeCroy.LeCroy.InterpretWaveform(raw, integersOnly=False, headersOnly=False, noTimeArray=False)[source]

Take the raw binary from a file saved from the LeCroy, read from a file using the 2 lines: with open(filename, “rb”) as file: raw = file.read() And extracts various properties of the saved time trace.

Parameters:
raw : bytes

Bytes object containing the binary contents of the saved raw/trc file

integersOnly : bool, optional

If True, only returns the unprocessed integers (read from the ADC) rather than the signal in volts. Defaults to False.

headersOnly : bool, optional

If True, only returns the file header. Defaults to False.

noTimeArray : bool, optional

If true returns timeStart, timeStop and timeStep and doesn’t create the time array

Returns:
WAVEDESC : dict

dictionary containing some properties of the time trace and oscilloscope settings extracted from the header file.

x : ndarray / tuple

The array of time values recorded by the oscilloscope or, if noTimeArray is True, returns a tuplef of (timeStart, timeStop, timeStep)

y : ndarray

The array of voltage values recorded by the oscilloscope

integers : ndarray

The array of raw integers recorded from the ADC and stored in the binary file

MissingData : bool

bool stating if any data was missing