Source code for nirfmxwcdma.sem_results

"""Provides methods to fetch and read the Sem measurement results."""

import functools

import nirfmxwcdma.attributes as attributes
import nirfmxwcdma.enums as enums
import nirfmxwcdma.errors as errors
import nirfmxwcdma.internal._helper as _helper


def _raise_if_disposed(f):
    """From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""

    @functools.wraps(f)
    def aux(*xs, **kws):
        meas_obj = xs[0]  # parameter 0 is 'self' which is the measurement object
        if meas_obj._signal_obj.is_disposed:
            raise Exception("Cannot access a disposed Wcdma signal configuration")
        return f(*xs, **kws)

    return aux


[docs] class SemResults(object): """Provides methods to fetch and read the Sem measurement results.""" def __init__(self, signal_obj): """Provides methods to fetch and read the Sem measurement results.""" self._signal_obj = signal_obj self._session_function_lock = signal_obj._session_function_lock self._interpreter = signal_obj._interpreter
[docs] @_raise_if_disposed def get_total_carrier_power(self, selector_string): r"""Gets the sum of all active carrier powers, where each carrier power corresponds to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_CARRIER_ABSOLUTE_INTEGRATED_POWER` attribute. For a single-carrier measurement, total carrier power is the same as carrier absolute power. This value is expressed in dBm. You do not need to use a selector string to read this result for the default signal and result instances. Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for information about the string syntax for named signals and named results. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the sum of all active carrier powers, where each carrier power corresponds to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_CARRIER_ABSOLUTE_INTEGRATED_POWER` attribute. For a single-carrier measurement, total carrier power is the same as carrier absolute power. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_measurement_status(self, selector_string): r"""Indicates the overall SEM measurement status, based on the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MEASUREMENT_STATUS` and the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MEASUREMENT_STATUS` attributes. You do not need to use a selector string to read this result for the default signal and result instances. Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for information about the string syntax for named signals and named results. +--------------+-------------------------------------------------------------------+ | Name (Value) | Description | +==============+===================================================================+ | Fail (0) | The measurement status of at least one offset segment has failed. | +--------------+-------------------------------------------------------------------+ | Pass (1) | The measurement status of all offset segments have passed. | +--------------+-------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.SemMeasurementStatus): Indicates the overall SEM measurement status, based on the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MEASUREMENT_STATUS` and the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MEASUREMENT_STATUS` attributes. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_i32( updated_selector_string, attributes.AttributeID.SEM_RESULTS_MEASUREMENT_STATUS.value ) attr_val = enums.SemMeasurementStatus(attr_val) except (KeyError, ValueError): raise errors.DriverTooNewError() # type: ignore finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_carrier_relative_integrated_power(self, selector_string): r"""Gets the carrier power relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER`. This value is expressed in dB. Use "carrier<*k*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the carrier power relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER`. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_CARRIER_RELATIVE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_carrier_absolute_integrated_power(self, selector_string): r"""Gets the carrier power. This value is expressed in dBm. The carrier power is the integrated power of the RRC-filtered signal. The RRC filter uses a bandwidth of 3.84 MHz with a roll-off factor of 0.22. The carrier is centered at a frequency determined by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.CENTER_FREQUENCY` and the :py:attr:`~nirfmxwcdma.attributes.AttributeID.CARRIER_FREQUENCY` attributes. Use "carrier<*k*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the carrier power. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_CARRIER_ABSOLUTE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_carrier_absolute_peak_power(self, selector_string): r"""Gets the peak power in the carrier channel. This value is expressed in dBm. Use "carrier<*k*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the peak power in the carrier channel. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_CARRIER_ABSOLUTE_PEAK_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_carrier_peak_frequency(self, selector_string): r"""Gets the frequency at which the peak power is observed in the carrier channel. This value is expressed in Hz. Use "carrier<*k*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the frequency at which the peak power is observed in the carrier channel. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_CARRIER_PEAK_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_measurement_status(self, selector_string): r"""Indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. Use "offset<*n*>" as the selector string to read this result. +--------------+------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+================================================================================================+ | Fail (0) | Indicates that the value of the SEM Results Lower Offset Margin attribute is positive. | +--------------+------------------------------------------------------------------------------------------------+ | Pass (1) | Indicates that the value of the SEM Results Lower Offset Margin attribute is zero or negative. | +--------------+------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.SemLowerOffsetMeasurementStatus): Indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_i32( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MEASUREMENT_STATUS.value, ) attr_val = enums.SemLowerOffsetMeasurementStatus(attr_val) except (KeyError, ValueError): raise errors.DriverTooNewError() # type: ignore finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_absolute_integrated_power(self, selector_string): r"""Gets the power measured in the lower, or negative, offset segment. This value is expressed in dBm. Use "offset<*n*>" as the selector string to configure or read this attribute. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power measured in the lower, or negative, offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_ABSOLUTE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_relative_integrated_power(self, selector_string): r"""Gets the power measured in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power measured in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_RELATIVE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_absolute_peak_power(self, selector_string): r"""Gets the peak power measured in the lower, or negative, offset segment. This value is expressed in dBm. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the peak power measured in the lower, or negative, offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_ABSOLUTE_PEAK_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_relative_peak_power(self, selector_string): r"""Gets the peak power measured in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the peak power measured in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_RELATIVE_PEAK_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_peak_frequency(self, selector_string): r"""Gets the frequency at which the peak power is observed in the lower offset segment. This value is expressed in Hz. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the frequency at which the peak power is observed in the lower offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_PEAK_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_margin(self, selector_string): r"""Gets the margin of the lower offset segment. This value is expressed in dB. In a single carrier SEM, the maximum value of the absolute spectrum trace with reference to the standard-defined absolute mask limit of the lower offset segment is measured. The maximum relative spectrum trace with reference to the standard-defined relative mask limit of the lower offset segment is also measured. The minimum of these two values is the margin. In a multicarrier SEM, the maximum value of the absolute spectrum trace with reference to the standard-defined absolute mask limit of the lower offset segment is the margin. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the margin of the lower offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_margin_absolute_power(self, selector_string): r"""Gets the power at the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. This value is expressed in dBm. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power at the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN_ABSOLUTE_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_margin_relative_power(self, selector_string): r"""Gets the power at the frequency corresponding to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute and relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power at the frequency corresponding to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute and relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN_RELATIVE_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_lower_offset_margin_frequency(self, selector_string): r"""Gets the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. This value is expressed in Hz. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_measurement_status(self, selector_string): r"""Indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. Use "offset<*n*>" as the selector string to read this result. +--------------+---------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+=================================================================================+ | Fail (0) | The value of the SEM Results Upper Offset Margin attribute is positive. | +--------------+---------------------------------------------------------------------------------+ | Pass (1) | The value of the SEM Results Upper Offset Margin attribute is zero or negative. | +--------------+---------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.SemUpperOffsetMeasurementStatus): Indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_i32( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MEASUREMENT_STATUS.value, ) attr_val = enums.SemUpperOffsetMeasurementStatus(attr_val) except (KeyError, ValueError): raise errors.DriverTooNewError() # type: ignore finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_absolute_integrated_power(self, selector_string): r"""Gets the power measured in the upper, or positive, offset segment. This value is expressed in dBm. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power measured in the upper, or positive, offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_ABSOLUTE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_relative_integrated_power(self, selector_string): r"""Gets the power measured in the upper, or positive, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power measured in the upper, or positive, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_RELATIVE_INTEGRATED_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_absolute_peak_power(self, selector_string): r"""Gets the peak power measured in the upper, or positive, offset segment. This value is expressed in dBm. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the peak power measured in the upper, or positive, offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_ABSOLUTE_PEAK_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_relative_peak_power(self, selector_string): r"""Gets the peak power measured in the upper, or positive, offset segment relative to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the peak power measured in the upper, or positive, offset segment relative to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_RELATIVE_PEAK_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_peak_frequency(self, selector_string): r"""Gets the frequency at which the peak power is observed in the upper offset segment. This value is expressed in Hz. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the frequency at which the peak power is observed in the upper offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_PEAK_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_margin(self, selector_string): r"""Gets the margin of the upper offset segment. This value is expressed in dB. In a single-carrier SEM, the maximum value of the absolute spectrum trace with reference to the standard-defined absolute mask limit of the upper offset segment is measured. The maximum relative spectrum trace with reference to the standard-defined relative mask limit of the upper offset segment is also measured. The minimum of these two values is the margin. In a multicarrier SEM, the maximum value of the absolute spectrum trace with reference to the standard-defined absolute mask limit of the upper offset segment is the margin. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the margin of the upper offset segment. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_margin_absolute_power(self, selector_string): r"""Gets the power at the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. This value is expressed in dBm. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power at the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN_ABSOLUTE_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_margin_relative_power(self, selector_string): r"""Gets the power at the frequency corresponding to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute relative to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the power at the frequency corresponding to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute relative to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN_RELATIVE_POWER.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def get_upper_offset_margin_frequency(self, selector_string): r"""Gets the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. This value is expressed in Hz. Use "offset<*n*>" as the selector string to read this result. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Returns the frequency corresponding to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. This value is expressed in Hz. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) attr_val, error_code = self._interpreter.get_attribute_f64( updated_selector_string, attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def fetch_carrier_measurement(self, selector_string, timeout): r"""Fetches the absolute integrated power and the relative integrated power of the carrier for the SEM measurement. The relative power is relative to the total carrier power. Use "carrier<*n*>" as the selector string to read results from this method. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name, and carrier number. Example: "carrier0" "result::r1/carrier0" You can use the :py:meth:`build_carrier_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, error_code): absolute_integrated_power (float): This parameter returns the carrier power. The carrier power is the integrated power of the RRC-filtered signal. The RRC filter uses a bandwidth of 3.84 MHz with a roll-off factor of 0.22. The carrier is centered at a frequency determined by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.CENTER_FREQUENCY` and :py:attr:`~nirfmxwcdma.attributes.AttributeID.CARRIER_FREQUENCY` attributes. This value is expressed in dBm. relative_integrated_power (float): This parameter returns the carrier power relative to the total carrier power attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) absolute_integrated_power, relative_integrated_power, error_code = ( self._interpreter.sem_fetch_carrier_measurement(updated_selector_string, timeout) ) finally: self._session_function_lock.exit_read_lock() return absolute_integrated_power, relative_integrated_power, error_code
[docs] @_raise_if_disposed def fetch_lower_offset_margin(self, selector_string, timeout): r"""Fetches the measurement status, margin, frequency at the margin, and the absolute and relative powers at the margin frequency for lower offset segments for the SEM measurement. The relative power is relative to the total carrier power. Use "offset<*n*>" as the selector string to read results from this method. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name, and offset number. Example: "offset0" "result::r1/offset0" You can use the :py:meth:`build_offset_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code): measurement_status (enums.SemLowerOffsetMeasurementStatus): This parameter indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MARGIN` attribute. margin (float): This parameter returns the margin of the lower offset segment. This value is expressed in dB. In a single carrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the lower offset segment is measured. The maximum of the relative spectrum trace with reference to the standard-defined relative mask limit in the lower offset segment is also measured. The higher value is the margin. In a multicarrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the lower offset segment is the margin. margin_frequency (float): This parameter returns the frequency at which the margin occurred in the lower, or negative, offset segment. This value is expressed in Hz. margin_absolute_power (float): This parameter returns the power at which the margin occurred in the lower, or negative, offset segment. This value is expressed in dBm. margin_relative_power (float): This parameter returns the power at which the margin occurred in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, ) = self._interpreter.sem_fetch_lower_offset_margin(updated_selector_string, timeout) finally: self._session_function_lock.exit_read_lock() return ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, )
[docs] @_raise_if_disposed def fetch_lower_offset_power(self, selector_string, timeout): r"""Fetches the integrated absolute and relative powers, absolute and relative peak powers, and the frequency at the absolute peak power of the lower offset segment for the SEM measurement. All relative powers are relative to the total carrier power. Use "offset<*n*>" as the selector string to read results from this method. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name, and offset number. Example: "offset0" "result::r1/offset0" You can use the :py:meth:`build_offset_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code): absolute_integrated_power (float): This parameter returns the power measured in the lower, or negative, offset segment. This value is expressed in dBm. relative_integrated_power (float): This parameter returns the power measured in the lower, or negative, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. absolute_peak_power (float): This parameter returns the peak power measured in the lower, or negative, offset segment. This value is expressed in dBm. peak_frequency (float): This parameter returns the frequency corresponding to the lower offset segment peak power. This value is expressed in Hz. relative_peak_power (float): This parameter returns the peak power measured in the lower, or negative, offset segment relative to the SEM Results Total Carrier Pwr attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, ) = self._interpreter.sem_fetch_lower_offset_power(updated_selector_string, timeout) finally: self._session_function_lock.exit_read_lock() return ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, )
[docs] @_raise_if_disposed def fetch_measurement_status(self, selector_string, timeout): r"""Fetches the overall SEM measurement status based on the measurement limits and failure criteria for each offset segment, as defined in sections 5.9 , 5.9A, 5.9B, 5.9C, and 5.9D of the *3GPP TS 34.121-1* specification, version 11.5.0, release 11. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (measurement_status, error_code): measurement_status (enums.SemMeasurementStatus): This parameter indicates the overall SEM measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_LOWER_OFFSET_MEASUREMENT_STATUS` and the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MEASUREMENT_STATUS` attributes. +--------------+-------------------------------------------------------------------+ | Name (Value) | Description | +==============+===================================================================+ | Fail (0) | The measurement status of at least one offset segment has failed. | +--------------+-------------------------------------------------------------------+ | Pass (1) | The measurement status of all offset segments have passed. | +--------------+-------------------------------------------------------------------+ error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) measurement_status, error_code = self._interpreter.sem_fetch_measurement_status( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return measurement_status, error_code
[docs] @_raise_if_disposed def fetch_total_carrier_power(self, selector_string, timeout): r"""Fetches the total carrier power for the SEM measurement. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (total_carrier_power, error_code): total_carrier_power (float): This parameter returns the sum of all active carrier powers, where each carrier power corresponds to the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_CARRIER_ABSOLUTE_INTEGRATED_POWER` attribute. This value is expressed in dBm. For a single-carrier measurement, total carrier power is the same as carrier absolute power. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) total_carrier_power, error_code = self._interpreter.sem_fetch_total_carrier_power( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return total_carrier_power, error_code
[docs] @_raise_if_disposed def fetch_upper_offset_margin(self, selector_string, timeout): r"""Fetches the measurement status, margin, frequency at the margin, and the absolute and relative powers at the margin frequency for upper offset segments for the SEM measurement. The relative power is relative to the total carrier power. Use "offset<*n*>" as the selector string to read results from this method. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name, and offset number. Example: "offset0" "result::r1/offset0" You can use the :py:meth:`build_offset_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code): measurement_status (enums.SemUpperOffsetMeasurementStatus): This parameter indicates the measurement status based on the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute. margin (float): This parameter returns the margin of the upper offset segment. In a single carrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the upper offset segment is measured. The maximum of the relative spectrum trace with reference to the standard-defined relative mask limit in the upper offset segment is also measured. The higher value is the margin. In a multicarrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the upper offset segment is the margin. This value is expressed in dB. margin_frequency (float): This parameter returns the frequency at which the margin occurred in the upper, or positive, segment. This value is expressed in Hz. margin_absolute_power (float): This parameter returns the power at which the margin occurred in the upper, or positive, offset segment This value is expressed in dBm. margin_relative_power (float): This parameter returns the power at which the margin occurred in the upper, or positive, offset segment relative to the SEM Results Total Carrier Pwr attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, ) = self._interpreter.sem_fetch_upper_offset_margin(updated_selector_string, timeout) finally: self._session_function_lock.exit_read_lock() return ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, )
[docs] @_raise_if_disposed def fetch_upper_offset_power(self, selector_string, timeout): r"""Fetches the integrated absolute and relative powers, absolute and relative peak powers, and the frequency at the absolute peak power of the upper offset segment for the SEM measurement. The relative power is relative to the total carrier power. Use "offset<*n*>" as the selector string to read results from this method. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name, and offset number. Example: "offset0" "result::r1/offset0" You can use the :py:meth:`build_offset_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code): absolute_integrated_power (float): This parameter returns the power measured in the upper, or positive, offset segment. This value is expressed in dBm. relative_integrated_power (float): This parameter returns the power measured in the upper, or positive, offset segment relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. absolute_peak_power (float): This parameter returns an array of peak power values measured in the lower, or negative, offset segments This value is expressed in dBm. peak_frequency (float): This parameter returns the frequency corresponding to the upper offset segment peak power. This value is expressed in Hz. relative_peak_power (float): This parameter returns the peak power measured in the upper, or positive, offset segment relative to the SEM Results Total Carrier Pwr attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, ) = self._interpreter.sem_fetch_upper_offset_power(updated_selector_string, timeout) finally: self._session_function_lock.exit_read_lock() return ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, )
[docs] @_raise_if_disposed def fetch_carrier_measurement_array(self, selector_string, timeout): r"""Fetches an array of absolute integrated powers and an array of the relative integrated powers of the carriers for the SEM measurement. The relative powers are relative to the total carrier power. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, error_code): absolute_integrated_power (float): This parameter returns an array of carrier power values relative to the total carrier power of all enabled carriers. This value is expressed in dB. relative_integrated_power (float): This parameter returns an array of carrier power values relative to the total carrier power of all enabled carriers. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) absolute_integrated_power, relative_integrated_power, error_code = ( self._interpreter.sem_fetch_carrier_measurement_array( updated_selector_string, timeout ) ) finally: self._session_function_lock.exit_read_lock() return absolute_integrated_power, relative_integrated_power, error_code
[docs] @_raise_if_disposed def fetch_lower_offset_margin_array(self, selector_string, timeout): r"""Fetches an array of measurement status values, an array of margins, an array of frequencies at the margins, an array of the absolute powers, and an array of the relative powers at the margin frequencies for lower offset segments for the SEM measurement. The relative power is relative to the total carrier power. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code): measurement_status (enums.SemLowerOffsetMeasurementStatus): This parameter indicates an array of measurement status values based on the values of the SEM Results Lower Offset Margin attribute corresponding to each lower offset segment. margin (float): This parameter returns an array of margins of the lower offset segments. This value is expressed in dB. In a single carrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the lower offset segment is measured. The maximum of the relative spectrum trace with reference to the standard-defined relative mask limit, in the lower offset segment is also measured. The higher value is the margin. In a multicarrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the lower offset segment is the margin. margin_frequency (float): This parameter returns an array of frequencies at which the margins occurred in the lower, or negative, offset segments This value is expressed in Hz. margin_absolute_power (float): This parameter returns an array of powers at which the margins occurred in the lower, or negative, offset segment. This value is expressed in dBm. margin_relative_power (float): This parameter returns an array of powers at which the margins occurred in the lower, or negative, offset segments relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, ) = self._interpreter.sem_fetch_lower_offset_margin_array( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, )
[docs] @_raise_if_disposed def fetch_lower_offset_power_array(self, selector_string, timeout): r"""Fetches an array of the absolute integrated powers, the relative integrated powers, the absolute peak powers, the relative peak powers, and frequencies at absolute peak powers of lower offset segments for the SEM measurement. The relative power is relative to the total carrier power. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code): absolute_integrated_power (float): This parameter returns an array of the powers measured in the lower, or negative, offset segments. This value is expressed in dBm. relative_integrated_power (float): This parameter returns an array of powers measured in the lower, or negative, offset segments relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. absolute_peak_power (float): This parameter returns an array of peak power values measured in the lower, or negative, offset segments. This value is expressed in dBm. peak_frequency (float): This parameter returns an array of frequencies corresponding to the lower offset segment peak power values. This value is expressed in Hz. relative_peak_power (float): This parameter returns an array of peak power values measured in the lower, or negative, offset segments relative to the SEM Results Total Carrier Pwr attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, ) = self._interpreter.sem_fetch_lower_offset_power_array( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, )
[docs] @_raise_if_disposed def fetch_spectrum(self, selector_string, timeout, spectrum, relative_mask, absolute_mask): r"""Fetches the spectrum used for the SEM measurement. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. spectrum (numpy.float32): This parameter returns an array of averaged powers measured at each frequency bin. The value is expressed in dBm. relative_mask (numpy.float32): This parameter returns an array of averaged powers measured at each frequency bin. The value is expressed in dBm. absolute_mask (numpy.float32): This parameter returns an array of averaged powers measured at each frequency bin. The value is expressed in dBm. Returns: Tuple (x0, dx, error_code): x0 (float): This parameter returns the start frequency. This value is expressed in Hz. dx (float): This parameter returns the frequency bin spacing. This value is expressed in Hz. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) x0, dx, error_code = self._interpreter.sem_fetch_spectrum( updated_selector_string, timeout, spectrum, relative_mask, absolute_mask ) finally: self._session_function_lock.exit_read_lock() return x0, dx, error_code
[docs] @_raise_if_disposed def fetch_upper_offset_margin_array(self, selector_string, timeout): r"""Fetches an array of measurement status values, an array of margin values, an array of frequencies at the margins, an array of the absolute power values, and an array of the relative power values at the margin frequencies for upper offset segments for the SEM measurement. The relative power is relative to the total carrier power. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code): measurement_status (enums.SemUpperOffsetMeasurementStatus): This parameter returns an array of measurement status values based on the values of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_UPPER_OFFSET_MARGIN` attribute corresponding to each upper offset segment. margin (float): This parameter returns an array of margins of the upper offset segments. In a single carrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the upper offset segment is measured. The maximum of the relative spectrum trace with reference to the standard-defined relative mask limit, in the upper offset segment, is also measured. The higher value is the margin. In a multicarrier SEM, the maximum of the absolute spectrum trace with reference to the standard-defined absolute mask limit in the upper offset segment is the margin. This value is expressed in dB. margin_frequency (float): This parameter returns an array of frequencies corresponding to the SEM Results Upper Offset Margin attribute. This value is expressed in Hz. margin_absolute_power (float): This parameter returns an array of powers at the frequency corresponding to the SEM Results Upper Offset Margin attribute. This value is expressed in dBm. margin_relative_power (float): This parameter returns an array of powers at the frequency corresponding to the SEM Results Upper Offset Margin attribute, relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, ) = self._interpreter.sem_fetch_upper_offset_margin_array( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return ( measurement_status, margin, margin_frequency, margin_absolute_power, margin_relative_power, error_code, )
[docs] @_raise_if_disposed def fetch_upper_offset_power_array(self, selector_string, timeout): r"""Returns an array of the absolute integrated powers and an array of the relative integrated powers, an array of the absolute peak powers and an array of the relative peak powers, and an array of the frequencies corresponding to peak absolute powers for upper offset segments for the SEM measurement. All relative powers are relative to the total carrier power. Args: selector_string (string): This parameter specifies a `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result name. Example: "result::r1" You can use the :py:meth:`build_result_string` method to build the selector string. timeout (float): This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10. Returns: Tuple (absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code): absolute_integrated_power (float): This parameter returns an array of the powers measured in the upper, or positive, offset segments. This value is expressed in dBm. relative_integrated_power (float): This parameter returns an array of powers measured in the upper, or positive, offset segments relative to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.SEM_RESULTS_TOTAL_CARRIER_POWER` attribute. This value is expressed in dB. absolute_peak_power (float): This parameter returns an array of peak power values measured in the upper, or positive, offset segments. This value is expressed in dBm. peak_frequency (float): This parameter returns an array of frequencies at which the peak power is observed in the upper, or positive, offset segments. This value is expressed in Hz. relative_peak_power (float): This parameter returns an array of peak power values measured in the upper, or positive, offset segments relative to the SEM Results Total Carrier Pwr attribute. This value is expressed in dB. error_code (int): Returns the status code of this method. The status code either indicates success or describes a warning condition. """ try: self._session_function_lock.enter_read_lock() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, ) = self._interpreter.sem_fetch_upper_offset_power_array( updated_selector_string, timeout ) finally: self._session_function_lock.exit_read_lock() return ( absolute_integrated_power, relative_integrated_power, absolute_peak_power, peak_frequency, relative_peak_power, error_code, )