"""Provides methods to fetch and read the Cda measurement results."""
import functools
import nirfmxtdscdma.attributes as attributes
import nirfmxtdscdma.errors as errors
import nirfmxtdscdma.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 Tdscdma 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_mean_symbol_power(self, selector_string):
r"""Gets the mean symbol power for the selected time slot and channel. This value is expressed in dB if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm if you set the CDA Pwr
Unit attribute to **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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean symbol power for the selected time slot and channel. This value is expressed in dB if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm if you set the CDA Pwr
Unit attribute to **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_SYMBOL_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_rms_symbol_evm(self, selector_string):
r"""Gets the RMS symbol EVM for the selected time slot and channel, averaged over all averaging iterations. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS symbol EVM for the selected time slot and channel, averaged over all averaging iterations. 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_MEAN_RMS_SYMBOL_EVM.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_peak_symbol_evm(self, selector_string):
r"""Gets the maximum value of the peak symbol EVMs, among all averaging iterations for the selected time slot and
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the peak symbol EVMs, among all averaging iterations for the selected time slot and
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_MAXIMUM_PEAK_SYMBOL_EVM.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_rms_symbol_magnitude_error(self, selector_string):
r"""Gets the RMS symbol magnitude error for the selected time slot and channel, averaged over all averaging iterations.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS symbol magnitude error for the selected time slot and channel, averaged over all averaging iterations.
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_MEAN_RMS_SYMBOL_MAGNITUDE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_rms_symbol_phase_error(self, selector_string):
r"""Gets the RMS symbol phase error for the selected time slot and channel, averaged over all averaging iterations. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS symbol phase error for the selected time slot and channel, averaged over all averaging iterations. 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_MEAN_RMS_SYMBOL_PHASE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_origin_offset(self, selector_string):
r"""Gets the I/Q origin offset of the composite signal, averaged over all measured slots. This value is expressed in dB.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q origin offset of the composite signal, averaged over all measured slots. 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.CDA_RESULTS_IQ_ORIGIN_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_gain_imbalance(self, selector_string):
r"""Gets the I/Q gain imbalance of the composite signal, averaged over all measured slots. This value is expressed in
dB.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q gain imbalance of the composite signal, averaged over all measured slots. 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.CDA_RESULTS_IQ_GAIN_IMBALANCE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_quadrature_error(self, selector_string):
r"""Gets the I/Q quadrature error of the composite signal, averaged over all measured slots. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q quadrature error of the composite signal, averaged over all measured slots. 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_IQ_QUADRATURE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_frequency_error(self, selector_string):
r"""Gets the frequency error averaged over all measured slots. This value is expressed in Hz.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the frequency error averaged over all measured slots. 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.CDA_RESULTS_FREQUENCY_ERROR.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. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the chip rate error. 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_mean_total_power(self, selector_string):
r"""Gets the total power measured in the code domain of the base spreading factor, averaged over all averaging
iterations. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the total power measured in the code domain of the base spreading factor, averaged over all averaging
iterations. 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_MEAN_TOTAL_POWER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_total_power(self, selector_string):
r"""Gets the maximum value of the power measured in the code domain of the base spreading factor among all averaging
iterations. 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the power measured in the code domain of the base spreading factor among all averaging
iterations. 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_MAXIMUM_TOTAL_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_total_active_power(self, selector_string):
r"""Gets the total active code power measured in the code domain of the base spreading factor, normalized to the total
code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **dBm**. The total active code power is averaged over all averaging iterations.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the total active code power measured in the code domain of the base spreading factor, normalized to the total
code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **dBm**. The total active code power is averaged over all averaging iterations.
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_TOTAL_ACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_total_active_power(self, selector_string):
r"""Gets the maximum value, among all averaging iterations, of total power measured in the code domain of the base
spreading factor normalized to the total code domain power. This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **dBm**.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value, among all averaging iterations, of total power measured in the code domain of the base
spreading factor normalized to the total code domain power. This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **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_MAXIMUM_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 the active code power measured in the code domain of the base spreading factor, normalized to
the total code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the average of the active code power measured in the code domain of the base spreading factor, normalized to
the total code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **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_maximum_peak_active_power(self, selector_string):
r"""Gets the maximum value among all averaging iterations of the maximum active code power measured in the code domain
of the base spreading factor, normalized to the total code domain power (CDP). This value is expressed in dB, if you
set the :py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the
CDA Pwr Unit attribute to **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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value among all averaging iterations of the maximum active code power measured in the code domain
of the base spreading factor, normalized to the total code domain power (CDP). This value is expressed in dB, if you
set the :py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the
CDA Pwr Unit attribute to **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_MAXIMUM_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 measured among the set of inactive channels in the code domain of the base spreading
factor, normalized to the total code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the average code power measured among the set of inactive channels in the code domain of the base spreading
factor, normalized to the total code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **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_maximum_peak_inactive_power(self, selector_string):
r"""Gets the maximum value among all averaging iterations of the highest measured code power among the set of inactive
channels in the code domain of the base spreading factor, normalized to the total code domain power (CDP). This value
is expressed in dB, if you set the :py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**,
or in dBm, if you set the CDA Pwr Unit attribute to **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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value among all averaging iterations of the highest measured code power among the set of inactive
channels in the code domain of the base spreading factor, normalized to the total code domain power (CDP). This value
is expressed in dB, if you set the :py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**,
or in dBm, if you set the CDA Pwr Unit attribute to **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_MAXIMUM_PEAK_INACTIVE_POWER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def fetch_iq_impairments(self, selector_string, timeout):
r"""Returns the I/Q origin offset, I/Q gain imbalance, and I/Q quadrature error.
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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code):
iq_origin_offset (float):
This parameter returns the I/Q origin offset of the composite signal, averaged over all measured slots. This value is
expressed in dB.
iq_gain_imbalance (float):
This parameter returns the I/Q gain imbalance of the composite signal, averaged over all measured slots. This value is
expressed in dB.
iq_quadrature_error (float):
This parameter returns the I/Q quadrature error of the composite signal, averaged over all measured slots. 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
)
iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code = (
self._interpreter.cda_fetch_iq_impairments(updated_selector_string, timeout)
)
finally:
self._session_function_lock.exit_read_lock()
return iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code
[docs]
@_raise_if_disposed
def fetch_code_domain_power(self, selector_string, timeout):
r"""Fetches the scalar code domain measurement results.
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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_total_power, mean_total_active_power, mean_active_power, maximum_peak_active_power, mean_inactive_power, maximum_peak_inactive_power, error_code):
mean_total_power (float):
This parameter returns the total power measured in the code domain of the base spreading factor, averaged over all
averaging iterations. This value is expressed in dBm.
mean_total_active_power (float):
This parameter returns the total active code power measured in the code domain of the base spreading factor, normalized
to the total code domain power (CDP). This value is expressed in dB, if you set the
:py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, or in dBm, if you set the CDA Pwr
Unit attribute to **dBm**.
mean_active_power (float):
This parameter returns the average of the active code power measured in the code domain of the base spreading factor,
normalized to the total CDP. This value is expressed in dB, if you set the CDA Pwr Unit attribute to **dB**, or in dBm,
if you set the CDA Pwr Unit attribute to **dBm**.
maximum_peak_active_power (float):
This parameter returns the maximum value among all averaging iterations of the maximum active code power measured in
the code domain of the base spreading factor, normalized to the total CDP. This value is expressed in dB, if you set
the CDA Pwr Unit attribute to **dB**, or in dBm, if you set the CDA Pwr Unit attribute to **dBm**.
mean_inactive_power (float):
This parameter returns the average of the code power measured among the set of inactive channels in the code domain of
the base spreading factor, normalized to the total CDP. This value is expressed in dB, if you set the CDA Pwr Unit
attribute to **dB**, or in dBm, if you set the CDA Pwr Unit attribute to **dBm**.
maximum_peak_inactive_power (float):
This parameter returns the maximum value among all averaging iterations of the highest measured code power among the
set of inactive channels in the code domain of the base spreading factor, normalized to the total CDP. This value is
expressed in dB, if you set the CDA Pwr Unit attribute to **dB**, or in dBm, if you set the CDA Pwr Unit attribute to
**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
)
(
mean_total_power,
mean_total_active_power,
mean_active_power,
maximum_peak_active_power,
mean_inactive_power,
maximum_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 (
mean_total_power,
mean_total_active_power,
mean_active_power,
maximum_peak_active_power,
mean_inactive_power,
maximum_peak_inactive_power,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_symbol_evm(self, selector_string, timeout):
r"""Fetches the ModAcc related measurements for the configured 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_rms_symbol_evm, maximum_peak_symbol_evm, frequency_error, chip_rate_error, mean_rms_symbol_magnitude_error, mean_rms_symbol_phase_error, mean_symbol_power, error_code):
mean_rms_symbol_evm (float):
This parameter returns the RMS symbol EVM for the selected time slot and channel, averaged over all averaging
iterations. This value is expressed as a percentage.
maximum_peak_symbol_evm (float):
This parameter returns the maximum value of the peak symbol EVMs, among all averaging iterations for the selected time
slot and channel. This value is expressed as a percentage.
frequency_error (float):
This parameter returns the frequency error averaged over all measured slots. This value is expressed in Hz.
chip_rate_error (float):
This parameter returns the chip rate error. This value is expressed in ppm.
mean_rms_symbol_magnitude_error (float):
This parameter returns the RMS symbol magnitude error for the selected time slot and channel, averaged over all
averaging iterations. This value is expressed as a percentage.
mean_rms_symbol_phase_error (float):
This parameter returns the RMS symbol phase error for the selected time slot and channel, averaged over all averaging
iterations. This value is expressed in degrees.
mean_symbol_power (float):
This parameter returns the mean symbol power for the selected time slot and channel. This value is expressed in dB if
you set the :py:attr:`~nirfmxtdscdma.attributes.AttributeID.CDA_POWER_UNIT` attribute to **dB**, and in dBm if you set
the CDA Pwr Unit attribute to **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
)
(
mean_rms_symbol_evm,
maximum_peak_symbol_evm,
frequency_error,
chip_rate_error,
mean_rms_symbol_magnitude_error,
mean_rms_symbol_phase_error,
mean_symbol_power,
error_code,
) = self._interpreter.cda_fetch_symbol_evm(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
mean_rms_symbol_evm,
maximum_peak_symbol_evm,
frequency_error,
chip_rate_error,
mean_rms_symbol_magnitude_error,
mean_rms_symbol_phase_error,
mean_symbol_power,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_mean_symbol_evm_trace(self, selector_string, timeout):
r"""Fetches the averaged symbol EVM trace of the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_symbol_evm, error_code):
mean_symbol_evm (float):
This parameter returns an array of the averaged symbol EVM traces for the configured 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
)
mean_symbol_evm, error_code = self._interpreter.cda_fetch_mean_symbol_evm_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return mean_symbol_evm, error_code
[docs]
@_raise_if_disposed
def fetch_mean_symbol_magnitude_error_trace(self, selector_string, timeout):
r"""Fetches the averaged symbol magnitude error trace for the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_symbol_magnitude_error, error_code):
mean_symbol_magnitude_error (float):
This parameter returns an array of the averaged symbol magnitude error traces for the configured 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
)
mean_symbol_magnitude_error, error_code = (
self._interpreter.cda_fetch_mean_symbol_magnitude_error_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return mean_symbol_magnitude_error, error_code
[docs]
@_raise_if_disposed
def fetch_mean_symbol_phase_error_trace(self, selector_string, timeout):
r"""Fetches the averaged symbol phase error trace for the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_symbol_phase_error, error_code):
mean_symbol_phase_error (float):
This parameter returns an array of the averaged symbol phase error traces for the configured 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
)
mean_symbol_phase_error, error_code = (
self._interpreter.cda_fetch_mean_symbol_phase_error_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return mean_symbol_phase_error, error_code
[docs]
@_raise_if_disposed
def fetch_symbol_constellation_trace(self, selector_string, timeout, symbol_constellation):
r"""Fetches the symbol constellation trace of the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
symbol_constellation (numpy.complex64):
This parameter returns an array of the symbol constellation traces of the configured measurement channel.
Returns:
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
)
error_code = self._interpreter.cda_fetch_symbol_constellation_trace(
updated_selector_string, timeout, symbol_constellation
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def fetch_mean_code_domain_power_trace(self, selector_string, timeout):
r"""Fetches the averaged trace value of the code powers measured in the code domain of the base spreading factor.
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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_code_domain_powers, error_code):
mean_code_domain_powers (float):
This parameter returns an array of the averaged code power traces measured in the code domain of the base spreading
factor. 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
)
mean_code_domain_powers, error_code = (
self._interpreter.cda_fetch_mean_code_domain_power_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return mean_code_domain_powers, error_code
[docs]
@_raise_if_disposed
def fetch_maximum_symbol_evm_trace(self, selector_string, timeout):
r"""Fetches the maximum hold trace of the symbol EVM for the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (maximum_symbol_evm, error_code):
maximum_symbol_evm (float):
This parameter returns an array of the maximum hold traces of the symbol EVM for the CDA measurement. 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
)
maximum_symbol_evm, error_code = self._interpreter.cda_fetch_maximum_symbol_evm_trace(
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_symbol_evm, error_code
[docs]
@_raise_if_disposed
def fetch_maximum_symbol_magnitude_error_trace(self, selector_string, timeout):
r"""Returns the maximum hold trace of the symbol magnitude error for the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (maximum_symbol_magnitude_error, error_code):
maximum_symbol_magnitude_error (float):
This parameter returns an array of the maximum hold traces of the symbol magnitude error for the CDA measurement. 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
)
maximum_symbol_magnitude_error, error_code = (
self._interpreter.cda_fetch_maximum_symbol_magnitude_error_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_symbol_magnitude_error, error_code
[docs]
@_raise_if_disposed
def fetch_maximum_symbol_phase_error_trace(self, selector_string, timeout):
r"""Fetches the maximum hold trace of the symbol phase error for the code domain analysis (CDA) 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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (maximum_symbol_phase_error, error_code):
maximum_symbol_phase_error (float):
This parameter returns an array of the maximum hold traces of the symbol phase error for the CDA measurement. 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
)
maximum_symbol_phase_error, error_code = (
self._interpreter.cda_fetch_maximum_symbol_phase_error_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_symbol_phase_error, error_code
[docs]
@_raise_if_disposed
def fetch_maximum_code_domain_power_trace(self, selector_string, timeout):
r"""Fetches the maximum hold trace of the power measured in the code domain of the base spreading factor.
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. **Examples:**
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (maximum_code_domain_powers, error_code):
maximum_code_domain_powers (float):
This parameter returns an array of the max hold traces of the code powers measured in the code domain of the base
spreading factor. 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
)
maximum_code_domain_powers, error_code = (
self._interpreter.cda_fetch_maximum_code_domain_power_trace(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_code_domain_powers, error_code