Source code for rsrtx.Implementations.Acquire

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AcquireCls:
	"""
	| Commands in total: 25
	| Subgroups: 3
	| Direct child commands: 11
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("acquire", core, parent)

	@property
	def points(self):
		"""
		| Commands in total: 7
		| Subgroups: 0
		| Direct child commands: 7
		"""
		if not hasattr(self, '_points'):
			from .Points import PointsCls
			self._points = PointsCls(self._core, self._cmd_group)
		return self._points

	@property
	def segmented(self):
		"""
		| Commands in total: 3
		| Subgroups: 0
		| Direct child commands: 3
		"""
		if not hasattr(self, '_segmented'):
			from .Segmented import SegmentedCls
			self._segmented = SegmentedCls(self._core, self._cmd_group)
		return self._segmented

	@property
	def areset(self):
		"""
		| Commands in total: 4
		| Subgroups: 1
		| Direct child commands: 3
		"""
		if not hasattr(self, '_areset'):
			from .Areset import AresetCls
			self._areset = AresetCls(self._core, self._cmd_group)
		return self._areset

[docs] def get_available(self) -> int: """ ``ACQuire:AVAilable`` \n Snippet: ``value: int = driver.acquire.get_available()`` \n Returns the number of acquisitions that is saved in the memory. This number of acquisitions is available for history viewing. It is also the number of acquisitions in a fast segmentation acquisition series. :return: acq_cnt: 0 to 4294967295 """ response = self._core.io.query_str_with_opc('ACQuire:AVAilable?') return Conversions.str_to_int(response)
[docs] def get_count(self) -> int: """ ``ACQuire:COUNt`` \n Snippet: ``value: int = driver.acquire.get_count()`` \n The acquisition and average count has a double effect: \n - It sets the number of waveforms acquired with method ``RsRtx.run.single()`` . - It defines the number of waveforms used to calculate the average waveform. :return: max_acq_cnt: 1 to 16.7772E+6 """ response = self._core.io.query_str_with_opc('ACQuire:COUNt?') return Conversions.str_to_int(response)
[docs] def set_count(self, max_acq_cnt: int) -> None: """ ``ACQuire:COUNt`` \n Snippet: ``driver.acquire.set_count(max_acq_cnt = 1)`` \n The acquisition and average count has a double effect: \n - It sets the number of waveforms acquired with method ``RsRtx.run.single()`` . - It defines the number of waveforms used to calculate the average waveform. :param max_acq_cnt: 1 to 16.7772E+6 """ param = Conversions.decimal_value_to_str(max_acq_cnt) self._core.io.write_with_opc(f'ACQuire:COUNt {param}')
[docs] def get_current(self) -> int: """ ``ACQuire:CURRent`` \n Snippet: ``value: int = driver.acquire.get_current()`` \n Shows the current number of acquisitions that have been acquired. :return: curr_acq_cnt: 0 to 4.29497E+9 """ response = self._core.io.query_str_with_opc('ACQuire:CURRent?') return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs] def get_interpolate(self) -> enums.AcqIntpolationMode: """ ``ACQuire:INTerpolate`` \n Snippet: ``value: enums.AcqIntpolationMode = driver.acquire.get_interpolate()`` \n Selects the interpolation method. :return: intpol_md: LINear | SINX | SMHD \n - LINear: Linear interpolation between two adjacent sample points - SINX: Interpolation by means of a sin(x) /x curve. - SMHD: Sample/Hold causes a histogram-like interpolation. """ response = self._core.io.query_str_with_opc('ACQuire:INTerpolate?') return Conversions.str_to_scalar_enum(response, enums.AcqIntpolationMode)
[docs] def set_interpolate(self, intpol_md: enums.AcqIntpolationMode) -> None: """ ``ACQuire:INTerpolate`` \n Snippet: ``driver.acquire.set_interpolate(intpol_md = enums.AcqIntpolationMode.LINear)`` \n Selects the interpolation method. :param intpol_md: LINear | SINX | SMHD \n - LINear: Linear interpolation between two adjacent sample points - SINX: Interpolation by means of a sin(x) /x curve. - SMHD: Sample/Hold causes a histogram-like interpolation. """ param = Conversions.enum_scalar_to_str(intpol_md, enums.AcqIntpolationMode) self._core.io.write_with_opc(f'ACQuire:INTerpolate {param}')
[docs] def get_resolution(self) -> float: """ ``ACQuire:RESolution`` \n Snippet: ``value: float = driver.acquire.get_resolution()`` \n Indicates the time between two waveform points in the record. :return: resolution: A fine resolution with low values produces a more precise waveform record. """ response = self._core.io.query_str_with_opc('ACQuire:RESolution?') return Conversions.str_to_float(response)
[docs] def set_resolution(self, resolution: float) -> None: """ ``ACQuire:RESolution`` \n Snippet: ``driver.acquire.set_resolution(resolution = 1.0)`` \n Indicates the time between two waveform points in the record. :param resolution: A fine resolution with low values produces a more precise waveform record. """ param = Conversions.decimal_value_to_str(resolution) self._core.io.write_with_opc(f'ACQuire:RESolution {param}')
[docs] def get_dresolution(self) -> float: """ ``ACQuire:DRESolution`` \n Snippet: ``value: float = driver.acquire.get_dresolution()`` \n Returns the current digital resolution of the digital channels. """ response = self._core.io.query_str_with_opc('ACQuire:DRESolution?') return Conversions.str_to_float(response)
[docs] def get_zresolution(self) -> float: """ ``ACQuire:ZRESolution`` \n Snippet: ``value: float = driver.acquire.get_zresolution()`` \n Returns the current resolution of the R&S RT-ZVCmulti-channel power probe channel. :return: zui_resolution: 1E-15 to 0.5 """ response = self._core.io.query_str_with_opc('ACQuire:ZRESolution?') return Conversions.str_to_float(response)
[docs] def get_symbol_rate(self) -> float: """ ``ACQuire:SRATe`` \n Snippet: ``value: float = driver.acquire.get_symbol_rate()`` \n Defines the sample rate, that is the number of recorded waveform samples per second. :return: sample_rate: 20 Gsample/s, R&S RTP with serial number ≥ 103000 in interleaved mode (2 channels) : 40 Gsample/s """ response = self._core.io.query_str_with_opc('ACQuire:SRATe?') return Conversions.str_to_float(response)
[docs] def set_symbol_rate(self, sample_rate: float) -> None: """ ``ACQuire:SRATe`` \n Snippet: ``driver.acquire.set_symbol_rate(sample_rate = 1.0)`` \n Defines the sample rate, that is the number of recorded waveform samples per second. :param sample_rate: 20 Gsample/s, R&S RTP with serial number ≥ 103000 in interleaved mode (2 channels) : 40 Gsample/s """ param = Conversions.decimal_value_to_str(sample_rate) self._core.io.write_with_opc(f'ACQuire:SRATe {param}')
[docs] def get_sr_real(self) -> float: """ ``ACQuire:SRReal`` \n Snippet: ``value: float = driver.acquire.get_sr_real()`` \n Sets the number of captured waveform points per second. It considers the samples of the ADC, and the reduction of waveform points by decimation. If interpolation is not active, the sample rate is the reciprocal value of the resolution and thus also depends on the acquisition time and the record length. If interpolation is active, the sample rate is limited to the ADC sample rate. :return: real_sample_rate: 20 Gsample/s, R&S RTP with serial number ≥ 103000 in interleaved mode (2 channels) : 40 Gsample/s """ response = self._core.io.query_str_with_opc('ACQuire:SRReal?') return Conversions.str_to_float(response)
[docs] def set_sr_real(self, real_sample_rate: float) -> None: """ ``ACQuire:SRReal`` \n Snippet: ``driver.acquire.set_sr_real(real_sample_rate = 1.0)`` \n Sets the number of captured waveform points per second. It considers the samples of the ADC, and the reduction of waveform points by decimation. If interpolation is not active, the sample rate is the reciprocal value of the resolution and thus also depends on the acquisition time and the record length. If interpolation is active, the sample rate is limited to the ADC sample rate. :param real_sample_rate: 20 Gsample/s, R&S RTP with serial number ≥ 103000 in interleaved mode (2 channels) : 40 Gsample/s """ param = Conversions.decimal_value_to_str(real_sample_rate) self._core.io.write_with_opc(f'ACQuire:SRReal {param}')
[docs] def get_mu_waveform(self) -> bool: """ ``ACQuire:MUWaveform`` \n Snippet: ``value: bool = driver.acquire.get_mu_waveform()`` \n For each channel, up to three waveforms can be shown and analyzed. The decimation mode and the waveform arithmetic are specific for each waveform. So you can analyze several aspects of the signal: For example, waveform1 shows the peaks, and waveform2 shows the average of the signal. :return: multi_waveform: OFF | ON """ response = self._core.io.query_str_with_opc('ACQuire:MUWaveform?') return Conversions.str_to_bool(response)
[docs] def set_mu_waveform(self, multi_waveform: bool) -> None: """ ``ACQuire:MUWaveform`` \n Snippet: ``driver.acquire.set_mu_waveform(multi_waveform = False)`` \n For each channel, up to three waveforms can be shown and analyzed. The decimation mode and the waveform arithmetic are specific for each waveform. So you can analyze several aspects of the signal: For example, waveform1 shows the peaks, and waveform2 shows the average of the signal. :param multi_waveform: OFF | ON """ param = Conversions.bool_to_str(multi_waveform) self._core.io.write_with_opc(f'ACQuire:MUWaveform {param}')
[docs] def get_cdta(self) -> bool: """ ``ACQuire:CDTA`` \n Snippet: ``value: bool = driver.acquire.get_cdta()`` \n Sets the acquisition mode and the waveform arithmetic of all channels to the last set value. If the acquisition settings are coupled, method ``RsRtx.acquire.mu_waveform()`` is not relevant, only one waveform per channel can be used. """ response = self._core.io.query_str_with_opc('ACQuire:CDTA?') return Conversions.str_to_bool(response)
[docs] def set_cdta(self, cpl_dec_md_tr_artm: bool) -> None: """ ``ACQuire:CDTA`` \n Snippet: ``driver.acquire.set_cdta(cpl_dec_md_tr_artm = False)`` \n Sets the acquisition mode and the waveform arithmetic of all channels to the last set value. If the acquisition settings are coupled, method ``RsRtx.acquire.mu_waveform()`` is not relevant, only one waveform per channel can be used. :param cpl_dec_md_tr_artm: OFF | ON """ param = Conversions.bool_to_str(cpl_dec_md_tr_artm) self._core.io.write_with_opc(f'ACQuire:CDTA {param}')
def clone(self) -> 'AcquireCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = AcquireCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group