from ..Internal.Core import Core
from ..Internal.CommandsGroup import CommandsGroup
from ..Internal import Conversions
from .. import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class IqCls:
"""
| Commands in total: 7
| Subgroups: 0
| Direct child commands: 7
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("iq", core, parent)
[docs]
def get_state(self) -> bool:
"""
``IQ:STATe`` \n
Snippet: ``value: bool = driver.iq.get_state()`` \n
Activates the I/Q mode of the instrument.
:return: iq_mode: ON: I/Q mode OFF: normal oscilloscope mode
"""
response = self._core.io.query_str_with_opc('IQ:STATe?')
return Conversions.str_to_bool(response)
[docs]
def set_state(self, iq_mode: bool) -> None:
"""
``IQ:STATe`` \n
Snippet: ``driver.iq.set_state(iq_mode = False)`` \n
Activates the I/Q mode of the instrument.
:param iq_mode: ON: I/Q mode OFF: normal oscilloscope mode
"""
param = Conversions.bool_to_str(iq_mode)
self._core.io.write_with_opc(f'IQ:STATe {param}')
[docs]
def get_bandwidth(self) -> float:
"""
``IQ:BWIDth`` \n
Snippet: ``value: float = driver.iq.get_bandwidth()`` \n
Returns the filter bandwidth. See also: method ``RsRtx.iq.rbwidth()``
:return: abs_bw: 40 to 8E+9
"""
response = self._core.io.query_str_with_opc('IQ:BWIDth?')
return Conversions.str_to_float(response)
[docs]
def get_rbwidth(self) -> float:
"""
``IQ:RBWidth`` \n
Snippet: ``value: float = driver.iq.get_rbwidth()`` \n
Sets the bandwidth factor to define the filter bandwidth. Filter BW = Relative BW * Sample rate
:return: rel_bw: 0.04 to 0.8
"""
response = self._core.io.query_str_with_opc('IQ:RBWidth?')
return Conversions.str_to_float(response)
[docs]
def set_rbwidth(self, rel_bw: float) -> None:
"""
``IQ:RBWidth`` \n
Snippet: ``driver.iq.set_rbwidth(rel_bw = 1.0)`` \n
Sets the bandwidth factor to define the filter bandwidth. Filter BW = Relative BW * Sample rate
:param rel_bw: 0.04 to 0.8
"""
param = Conversions.decimal_value_to_str(rel_bw)
self._core.io.write_with_opc(f'IQ:RBWidth {param}')
[docs]
def get_symbol_rate(self) -> float:
"""
``IQ:SRATe`` \n
Snippet: ``value: float = driver.iq.get_symbol_rate()`` \n
Sets the required sample rate of the output I/Q data.
:return: sample_rate: 1000 | 400E+6 to 20E+9 | 40E+9 (for input sample rate 20 Gsample/s | 40 Gsample/s)
"""
response = self._core.io.query_str_with_opc('IQ:SRATe?')
return Conversions.str_to_float(response)
[docs]
def set_symbol_rate(self, sample_rate: float) -> None:
"""
``IQ:SRATe`` \n
Snippet: ``driver.iq.set_symbol_rate(sample_rate = 1.0)`` \n
Sets the required sample rate of the output I/Q data.
:param sample_rate: 1000 | 400E+6 to 20E+9 | 40E+9 (for input sample rate 20 Gsample/s | 40 Gsample/s)
"""
param = Conversions.decimal_value_to_str(sample_rate)
self._core.io.write_with_opc(f'IQ:SRATe {param}')
[docs]
def get_rlength(self) -> int:
"""
``IQ:RLENgth`` \n
Snippet: ``value: int = driver.iq.get_rlength()`` \n
Sets the required record length of the output I/Q data. The resulting acquisition time of the I/Q data is: Acquisition
time = Record length / Sample rate
:return: record_length: 1 to 10E+6
"""
response = self._core.io.query_str_with_opc('IQ:RLENgth?')
return Conversions.str_to_int(response)
[docs]
def set_rlength(self, record_length: int) -> None:
"""
``IQ:RLENgth`` \n
Snippet: ``driver.iq.set_rlength(record_length = 1)`` \n
Sets the required record length of the output I/Q data. The resulting acquisition time of the I/Q data is: Acquisition
time = Record length / Sample rate
:param record_length: 1 to 10E+6
"""
param = Conversions.decimal_value_to_str(record_length)
self._core.io.write_with_opc(f'IQ:RLENgth {param}')
# noinspection PyTypeChecker
[docs]
def get_ins_rate(self) -> enums.InputSmpRate:
"""
``IQ:INSRate`` \n
Snippet: ``value: enums.InputSmpRate = driver.iq.get_ins_rate()`` \n
Shows the sample rate of capturing the input data in I/Q mode: 20 Gsample/s. If you use R&S RTP134B or R&S RTP164B
instruments, you can change the sample rate to 40 Gsample/s. See also: 'Input sample rate'.
"""
response = self._core.io.query_str_with_opc('IQ:INSRate?')
return Conversions.str_to_scalar_enum(response, enums.InputSmpRate)
[docs]
def set_ins_rate(self, input_smp_rate: enums.InputSmpRate) -> None:
"""
``IQ:INSRate`` \n
Snippet: ``driver.iq.set_ins_rate(input_smp_rate = enums.InputSmpRate.SR10G)`` \n
Shows the sample rate of capturing the input data in I/Q mode: 20 Gsample/s. If you use R&S RTP134B or R&S RTP164B
instruments, you can change the sample rate to 40 Gsample/s. See also: 'Input sample rate'.
:param input_smp_rate: SR20G | SR40G
"""
param = Conversions.enum_scalar_to_str(input_smp_rate, enums.InputSmpRate)
self._core.io.write_with_opc(f'IQ:INSRate {param}')
# noinspection PyTypeChecker
[docs]
def get_pair(self) -> enums.ChannelPair:
"""
``IQ:PAIR`` \n
Snippet: ``value: enums.ChannelPair = driver.iq.get_pair()`` \n
Selects the channel combination. You can couple one of the channels C1 or C2 with one of the channels C4 or C4.
The command is valid at input sample rate 40 Gsample/s on R&S RTP134B or R&S RTP164B instruments.
:return: channel_pair: C1C3 | C1C4 | C2C3 | C2C4
"""
response = self._core.io.query_str_with_opc('IQ:PAIR?')
return Conversions.str_to_scalar_enum(response, enums.ChannelPair)
[docs]
def set_pair(self, channel_pair: enums.ChannelPair) -> None:
"""
``IQ:PAIR`` \n
Snippet: ``driver.iq.set_pair(channel_pair = enums.ChannelPair.C1C3)`` \n
Selects the channel combination. You can couple one of the channels C1 or C2 with one of the channels C4 or C4.
The command is valid at input sample rate 40 Gsample/s on R&S RTP134B or R&S RTP164B instruments.
:param channel_pair: C1C3 | C1C4 | C2C3 | C2C4
"""
param = Conversions.enum_scalar_to_str(channel_pair, enums.ChannelPair)
self._core.io.write_with_opc(f'IQ:PAIR {param}')