nqrduck_spectrometer_limenqr.controller#
Controller module for the Lime NQR spectrometer.
Classes
|
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:
- 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:
- 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:
- 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:
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:
- 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