nqrduck_spectrometer_limenqr.controller#

Controller module for the Lime NQR spectrometer.

Classes

LimeNQRController(*args,Β **kwargs)

Controller class for the Lime NQR spectrometer.

class nqrduck_spectrometer_limenqr.controller.LimeNQRController(*args: Any, **kwargs: Any)#

Controller class for the Lime NQR spectrometer.

calculate_and_set_offsets(lime: PyLimeConfig, pulse_shape, events, current_event, pulse_amplitude) list#

This method calculates and sets the offsets for the limr object.

Parameters:
  • lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

  • pulse_shape (Function) – The pulse shape

  • events (list) – The pulse sequence events

  • current_event (Event) – The current event

  • pulse_amplitude (float) – The pulse amplitude

Returns:

The offsets for the limr object

Return type:

list

calculate_measurement_data(lime: PyLimeConfig, rx_begin: float, rx_stop: float) Measurement#

Calculates the measurement data from the limr object.

Parameters:
  • lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

  • rx_begin (float) – The start time of the RX event in Β΅s

  • rx_stop (float) – The stop time of the RX event in Β΅s

Returns:

The measurement data

Return type:

Measurement

calculate_offset(lime: PyLimeConfig) float#

This method calculates the offset for the RX event.

Parameters:

lime (limr) – The limr object that is used to communicate with the pulseN driver

Returns:

The offset for the RX event

Return type:

float

calculate_previous_events_duration(events, rx_event)#

This method calculates the duration of the previous events.

Parameters:
  • events (list) – The pulse sequence events

  • rx_event (Event) – The RX event

Returns:

The duration of the previous events

Return type:

float

emit_measurement_data(measurement_data: Measurement) None#

Emits the measurement data to the GUI.

Parameters:

measurement_data (Measurement) – The measurement data

emit_measurement_error(error_message: str) None#

Emits a measurement error to the GUI.

Parameters:

error_message (str) – The error message

emit_status_message(message: str) None#

Emits a status message to the GUI.

Parameters:

message (str) – The status message

extend_pulse_lists(pulse_amplitude, pulse_shape, modulated_phase)#

This method extends the pulse lists of the limr object.

Parameters:
  • pulse_amplitude (float) – The pulse amplitude

  • pulse_shape (PulseShape) – The pulse shape

  • modulated_phase (float) – The modulated phase

Returns:

A tuple containing the extended pulse lists (frequency, duration, amplitude, phase)

Return type:

tuple

extract_measurement_data(lime: PyLimeConfig, hdf: HDF, indices: list) tuple#

Extracts the measurement data from the PyLimeConfig object.

Parameters:
  • lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

  • hdf (HDF) – The HDF object that is used to read the measurement data

  • indices (list) – The indices of the evaluation range in the measurement data

Returns:

A tuple containing the time vector and the measurement data

Return type:

tuple

fetch_pulse_sequence_events() list#

Fetches the pulse sequence events from the pulse programmer module.

Returns:

The pulse sequence events

Return type:

list

find_evaluation_range_indices(hdf: HDF, rx_begin: float, rx_stop: float) list#

Finds the indices of the evaluation range in the measurement data.

Parameters:
  • hdf (HDF) – The HDF object that is used to read the measurement data

  • rx_begin (float) – The start time of the RX event in Β΅s

  • rx_stop (float) – The stop time of the RX event in Β΅s

Returns:

The indices of the evaluation range in the measurement data

Return type:

list

find_rx_event(events)#

This method finds the RX event in the pulse sequence.

Parameters:

events (list) – The pulse sequence events

Returns:

The RX event

Return type:

Event

get_blank_durations_before_event(events, current_event) list#

This method returns the blank durations before the current event.

Parameters:
  • events (list) – The pulse sequence events

  • current_event (Event) – The current event

Returns:

The blank durations before the current event

Return type:

list

get_fft_shift() int#

Rreturns the FFT shift value from the settings.

Returns:

The FFT shift value

Return type:

int

get_number_of_pulses() int#

Calculates the number of pulses in the pulse sequence before the LimeDriverBinding is initialized.

This makes sure it”s initialized with the correct size of the pulse lists.

Returns:

The number of pulses in the pulse sequence

Return type:

int

get_previous_events_without_tx_pulse(events, current_event) list#

This method returns the previous events without a transmit pulse.

Parameters:
  • events (list) – The pulse sequence events

  • current_event (Event) – The current event

Returns:

The previous events without a transmit pulse

Return type:

list

initialize_lime() PyLimeConfig#

Initializes the limr object that is used to communicate with the pulseN driver.

Returns:

The PyLimeConfig object that is used to communicate with the pulseN driver

Return type:

PyLimeConfig

initialize_pulse_lists(lime: PyLimeConfig, pulse_amplitude: array, pulse_shape, modulated_phase: array) tuple#

This method initializes the pulse lists of the limr object.

Parameters:
  • lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

  • pulse_amplitude (np.array) – The pulse amplitude

  • pulse_shape (Function) – The pulse shape

  • modulated_phase (np.array) – The modulated phase

is_translatable_tx_parameter(parameter)#

Checks if a parameter a pulse with a transmit pulse shape (amplitude nonzero).

Parameters:

parameter (Parameter) – The parameter to check

log_event_details(event) None#

Logs the details of an event.

log_lime_parameters(lime: PyLimeConfig) None#

Logs the parameters of the limr object.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

log_parameter_details(parameter) None#

Logs the details of a parameter.

log_start_message() None#

Logs a message when the measurement is started.

modulate_pulse_amplitude(pulse_amplitude: float, event, lime: PyLimeConfig) tuple#

Modulates the pulse amplitude for the limr object. We need to do this to have the pulse at IF frequency instead of LO frequency.

Parameters:
  • pulse_amplitude (float) – The pulse amplitude

  • event (Event) – The event that contains the parameter

  • lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

Returns:

A tuple containing the modulated pulse amplitude and the modulated phase

Return type:

tuple

perform_measurement(lime: PyLimeConfig) bool#

Executes the measurement procedure.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

Returns:

True if the measurement was successful, False otherwise

Return type:

bool

prepare_pulse_amplitude(event, parameter)#

Prepares the pulse amplitude for the limr object.

Parameters:
  • event (Event) – The event that contains the parameter

  • parameter (Parameter) – The parameter that contains the pulse shape and amplitude

Returns: tuple: A tuple containing the pulse shape and the pulse amplitude

process_measurement_results(lime: PyLimeConfig) Measurement#

Processes the measurement results and returns a Measurement object.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

Returns:

The measurement data

Return type:

Measurement

set_averages(value: int) None#

This method sets the number of averages for the spectrometer.

Args: value (int): The number of averages

set_frequency(value: float) None#

This method sets the target frequency of the spectrometer.

Parameters:

value (float) – The target frequency in MHz

setup_lime_parameters(lime: PyLimeConfig) None#

Sets the parameters of the lime config according to the settings set in the spectrometer module.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

setup_temporary_storage(lime: PyLimeConfig) None#

Sets up the temporary storage for the measurement data.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

start_measurement()#

Starts the measurement procedure.

translate_pulse_sequence(lime: PyLimeConfig) PyLimeConfig#

Ttranslates the pulse sequence to the limr object.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

translate_rx_event(lime: PyLimeConfig) tuple#

This method translates the RX event of the pulse sequence to the limr object.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

Returns:

A tuple containing the start and stop time of the RX event in Β΅s

Return type:

tuple

unwrap_phase(phase: float) float#

This method unwraps the phase of the pulse.

Parameters:

phase (float) – The phase of the pulse

update_settings(lime: PyLimeConfig) PyLimeConfig#

Sets the parameters of the limr object according to the settings set in the spectrometer module.

Parameters:

lime (PyLimeConfig) – The PyLimeConfig object that is used to communicate with the pulseN driver

Returns:

The updated limr object

Return type:

lime