"""Provides methods to fetch and read the Cda measurement results."""
import functools
import nirfmxwcdma.attributes as attributes
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 CdaResults(object):
"""Provides methods to fetch and read the Cda measurement results."""
def __init__(self, signal_obj):
"""Provides methods to fetch and read the Cda 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_rms_symbol_evm(self, selector_string):
r"""Gets the RMS EVM for the measurement channel. This value is expressed as a percentage.
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 RMS EVM for the measurement channel. This value is expressed as a percentage.
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.CDA_RESULTS_RMS_SYMBOL_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_symbol_evm(self, selector_string):
r"""Gets the peak EVM for the measurement channel. This value is expressed as a percentage.
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 peak EVM for the measurement channel. This value is expressed as a percentage.
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.CDA_RESULTS_PEAK_SYMBOL_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rms_symbol_magnitude_error(self, selector_string):
r"""Gets the RMS magnitude error for the measurement channel. This value is expressed as a percentage.
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 RMS magnitude error for the measurement channel. This value is expressed as a percentage.
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.CDA_RESULTS_RMS_SYMBOL_MAGNITUDE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rms_symbol_phase_error(self, selector_string):
r"""Gets the RMS phase error for the measurement channel. This value is expressed in degrees.
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 RMS phase error for the measurement channel. This value is expressed in degrees.
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.CDA_RESULTS_RMS_SYMBOL_PHASE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_symbol_power(self, selector_string):
r"""Gets the mean power of the symbols for the measurement channel. This value is expressed in dB or dBm. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to dBm, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute.
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 mean power of the symbols for the measurement channel. This value is expressed in dB or dBm. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to dBm, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_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.CDA_RESULTS_MEAN_SYMBOL_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_chip_rate_error(self, selector_string):
r"""Gets the chip rate error of the composite signal. This value is expressed in ppm.
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 chip rate error of the composite signal. This value is expressed in ppm.
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.CDA_RESULTS_CHIP_RATE_ERROR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_total_power(self, selector_string):
r"""Gets the mean power of the received signal, sampled at ideal inter-symbol-interference free points. 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 mean power of the received signal, sampled at ideal inter-symbol-interference free points. This value is
expressed in dBm.
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.CDA_RESULTS_TOTAL_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_total_active_power(self, selector_string):
r"""Gets the sum of all the active channel powers. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or
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 the active channel powers. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or
dBm.
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.CDA_RESULTS_TOTAL_ACTIVE_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_active_power(self, selector_string):
r"""Gets the average of all the active channel powers. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 average of all the active channel powers. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_MEAN_ACTIVE_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_active_power(self, selector_string):
r"""Gets the largest code power among the set of active channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 largest code power among the set of active channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_PEAK_ACTIVE_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_inactive_power(self, selector_string):
r"""Gets the average code power among the set of inactive channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 average code power among the set of inactive channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_MEAN_INACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_inactive_power(self, selector_string):
r"""Gets the largest code power among the set of inactive channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 largest code power among the set of inactive channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_PEAK_INACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_i_mean_active_power(self, selector_string):
r"""Gets the average code power among the set of active in-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 average code power among the set of active in-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_I_MEAN_ACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_q_mean_active_power(self, selector_string):
r"""Gets the average code power among the set of active quadrature-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 average code power among the set of active quadrature-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_Q_MEAN_ACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_i_peak_inactive_power(self, selector_string):
r"""Gets the largest code power among the set of inactive in-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 largest code power among the set of inactive in-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_I_PEAK_INACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_q_peak_inactive_power(self, selector_string):
r"""Gets the largest code power among the set of inactive quadrature-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or 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 largest code power among the set of inactive quadrature-phase channels in the code domain. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
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.CDA_RESULTS_Q_PEAK_INACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def fetch_symbol_evm(self, selector_string, timeout):
r"""Returns the root mean square and peak of symbol EVM, RMS of symbol magnitude error, RMS of symbol phase error, and mean
symbol power, corresponding to the measurement channel.
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 (rms_symbol_evm, peak_symbol_evm, rms_symbol_magnitude_error, rms_symbol_phase_error, mean_symbol_power, chip_rate_error, error_code):
rms_symbol_evm (float):
This parameter returns the RMS EVM for the measurement channel. This value is expressed as a percentage.
peak_symbol_evm (float):
This parameter returns the peak EVM for the measurement channel. This value is expressed as a percentage.
rms_symbol_magnitude_error (float):
This parameter returns the RMS magnitude error for the measurement channel. This value is expressed as a percentage.
rms_symbol_phase_error (float):
This parameter returns the RMS phase error for the measurement channel. This value is expressed in degrees.
mean_symbol_power (float):
This parameter returns the mean power of the symbols for the measurement channel. This value is expressed in dB or dBm.
If you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to dBm, the measurement returns
an absolute value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute.
chip_rate_error (float):
This parameter returns the chip rate error of the composite signal. This value is expressed in ppm.
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
)
(
rms_symbol_evm,
peak_symbol_evm,
rms_symbol_magnitude_error,
rms_symbol_phase_error,
mean_symbol_power,
chip_rate_error,
error_code,
) = self._interpreter.cda_fetch_symbol_evm(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
rms_symbol_evm,
peak_symbol_evm,
rms_symbol_magnitude_error,
rms_symbol_phase_error,
mean_symbol_power,
chip_rate_error,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_code_domain_power(self, selector_string, timeout):
r"""Fetches the Total Power , Total Active Power , Mean and Peak Active Powers, and Mean and Peak Inactive Powers.
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_power, total_active_power, mean_active_power, peak_active_power, mean_inactive_power, peak_inactive_power, error_code):
total_power (float):
This parameter returns the mean power of the received signal, sampled at ideal inter-symbol-interference free points.
This value is expressed in dBm.
total_active_power (float):
This parameter returns the sum of all the active channel powers. If you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an absolute
value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or
dBm.
mean_active_power (float):
This parameter returns the average of all the active channel powers. If you set the CDA Pwr Unit attribute to **dBm**,
the measurement returns an absolute value; otherwise, the measurement returns a value relative to the CDA Results Total
Pwr attribute. This value is expressed in dB or dBm.
peak_active_power (float):
This parameter returns the largest code power among the set of active channels in the code domain. If you set the CDA
Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement returns a value
relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
mean_inactive_power (float):
This parameter returns the average code power among the set of inactive channels in the code domain. If you set the CDA
Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement returns a value
relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
peak_inactive_power (float):
This parameter returns the largest code power among the set of inactive channels in the code domain. If you set the CDA
Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement returns a value
relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
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_power,
total_active_power,
mean_active_power,
peak_active_power,
mean_inactive_power,
peak_inactive_power,
error_code,
) = self._interpreter.cda_fetch_code_domain_power(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
total_power,
total_active_power,
mean_active_power,
peak_active_power,
mean_inactive_power,
peak_inactive_power,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_code_domain_i_and_q_power(self, selector_string, timeout):
r"""Fetches the I and Q mean active powers and I and Q peak inactive powers.
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 (i_mean_active_power, q_mean_active_power, i_peak_inactive_power, q_peak_inactive_power, error_code):
i_mean_active_power (float):
This parameter returns the average code power among the set of active in-phase channels in the code domain. If you set
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dBm**, the measurement returns an
absolute value; otherwise, the measurement returns a value relative to the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.CDA_RESULTS_TOTAL_POWER` attribute. This value is expressed in dB or dBm.
q_mean_active_power (float):
This parameter returns the average code power among the set of active quadrature-phase channels in the code domain. If
you set the CDA Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement
returns a value relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
i_peak_inactive_power (float):
This parameter returns the largest code power among the set of inactive in-phase channels in the code domain. If you
set the CDA Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement
returns a value relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
q_peak_inactive_power (float):
This parameter returns the largest code power among the set of inactive quadrature-phase channels in the code domain.
If you set the CDA Pwr Unit attribute to **dBm**, the measurement returns an absolute value; otherwise, the measurement
returns a value relative to the CDA Results Total Pwr attribute. This value is expressed in dB or dBm.
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
)
(
i_mean_active_power,
q_mean_active_power,
i_peak_inactive_power,
q_peak_inactive_power,
error_code,
) = self._interpreter.cda_fetch_code_domain_i_and_q_power(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return (
i_mean_active_power,
q_mean_active_power,
i_peak_inactive_power,
q_peak_inactive_power,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_symbol_evm_trace(self, selector_string, timeout):
r"""Fetches the root mean square EVM trace of the measurement channel.
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 (symbol_evm, error_code):
symbol_evm (float):
This parameter returns an array of RMS EVM values of the symbols of the measurement channel. This value is expressed as
a percentage.
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
)
symbol_evm, error_code = self._interpreter.cda_fetch_symbol_evm_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return symbol_evm, error_code
[docs]
@_raise_if_disposed
def fetch_symbol_magnitude_error_trace(self, selector_string, timeout):
r"""Fetches the magnitude error trace of the measurement channel.
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 (symbol_magnitude_error, error_code):
symbol_magnitude_error (float):
This parameter returns an array of magnitude errors of the symbols of the measurement 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
symbol_magnitude_error, error_code = (
self._interpreter.cda_fetch_symbol_magnitude_error_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return symbol_magnitude_error, error_code
[docs]
@_raise_if_disposed
def fetch_symbol_phase_error_trace(self, selector_string, timeout):
r"""Fetches the phase error trace of the measurement channel.
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 (symbol_phase_error, error_code):
symbol_phase_error (float):
This parameter returns an array of phase errors of the symbols of the measurement channel. This value is expressed in
degrees.
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
)
symbol_phase_error, error_code = self._interpreter.cda_fetch_symbol_phase_error_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return symbol_phase_error, error_code
[docs]
@_raise_if_disposed
def fetch_code_domain_power_trace(self, selector_string, timeout):
r"""Fetches the code domain power trace. The code domain power is obtained for all codes with spreading factor 256 for both
I and Q branches in an interleaved manner.
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 (code_domain_powers, error_code):
code_domain_powers (float):
This parameter returns an array of code domain powers for I and Q branches in an interleaved manner.
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
)
code_domain_powers, error_code = self._interpreter.cda_fetch_code_domain_power_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return code_domain_powers, error_code
[docs]
@_raise_if_disposed
def fetch_code_domain_i_and_q_power_trace(self, selector_string, timeout):
r"""Fetches the code domain power trace for I and Q branches. The code domain power is obtained for all codes with a
spreading factor of 256, for I and Q branches separately.
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 (i_code_domain_powers, q_code_domain_powers, error_code):
i_code_domain_powers (float):
This parameter returns an array of code domain powers for the in-phase component.
q_code_domain_powers (float):
This parameter returns an array of code domain powers for the quadrature-phase component.
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
)
i_code_domain_powers, q_code_domain_powers, error_code = (
self._interpreter.cda_fetch_code_domain_i_and_q_power_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return i_code_domain_powers, q_code_domain_powers, error_code
[docs]
@_raise_if_disposed
def fetch_symbol_power_trace(self, selector_string, timeout):
r"""Fetches the power versus time trace of the symbol corresponding to the measurement channel.
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 (symbol_powers, error_code):
symbol_powers (float):
This parameter returns the array of symbol powers of the measurement channel. This value is expressed in dBm.
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
)
symbol_powers, error_code = self._interpreter.cda_fetch_symbol_power_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return symbol_powers, error_code