Source code for nirfmxnr.chp_component_carrier_configuration

""""""

import functools

import nirfmxnr.attributes as attributes
import nirfmxnr.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 NR signal configuration")
        return f(*xs, **kws)

    return aux


[docs] class ChpComponentCarrierConfiguration(object): """""" def __init__(self, signal_obj): """""" 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_integration_bandwidth(self, selector_string): r"""Gets the integration bandwidth of a component carrier (CC). This value is expressed in Hz. Use "carrier<*k*>" or "subblock<*n*>" or "subblock<*n*>/carrier<*k*>" as the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to read this result. The default value is 9 MHz. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the integration bandwidth of a component carrier (CC). 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.CHP_COMPONENT_CARRIER_INTEGRATION_BANDWIDTH.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code