Source code for rsrtx.Implementations.Calculate.Math.Fft.Magnitude.Scale

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ScaleCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, magnitude_scale: enums.FftMagnitudeScale, math=repcap.Math.Default) -> None: """ ``CALCulate:MATH<*>:FFT:MAGNitude:SCALe`` \n Snippet: ``driver.calculate.math.fft.magnitude.scale.set(magnitude_scale = enums.FftMagnitudeScale.DB, math = repcap.Math.Default)`` \n Defines the scaling of the y-axis for magnitude spectrums. The display values are valid for 50Ω termination impendance. Select the unit according to the vertical unit of the source waveform. :param magnitude_scale: LINear | DBM | DB | DBUV | DBMV | DBV | DBPS | DBNS | DBUS | DBMS | DBS | DBHZ | DBKHZ | DBKHz | DBMHZ | DBMHz | DBGHZ | DBGHz | DBA | DBMA | DBUA \n - LINear: Linear scaling; displays the RMS value. - DBM | DB | DBUV | DBMV | DBV: Basic FFT - DBPS | DBNS | DBUS | DBMS | DBS | DBHZ | DBKHZ | DBKHz | DBMHZ | DBMHz | DBGHZ | DBGHz: FFT on tracks of time or frequency measurements - DBA | DBMA | DBUA: FFT on current waveforms :param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math') """ param = Conversions.enum_scalar_to_str(magnitude_scale, enums.FftMagnitudeScale) math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math) self._core.io.write_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:MAGNitude:SCALe {param}')
# noinspection PyTypeChecker
[docs] def get(self, math=repcap.Math.Default) -> enums.FftMagnitudeScale: """ ``CALCulate:MATH<*>:FFT:MAGNitude:SCALe`` \n Snippet: ``value: enums.FftMagnitudeScale = driver.calculate.math.fft.magnitude.scale.get(math = repcap.Math.Default)`` \n Defines the scaling of the y-axis for magnitude spectrums. The display values are valid for 50Ω termination impendance. Select the unit according to the vertical unit of the source waveform. :param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math') :return: magnitude_scale: LINear | DBM | DB | DBUV | DBMV | DBV | DBPS | DBNS | DBUS | DBMS | DBS | DBHZ | DBKHZ | DBKHz | DBMHZ | DBMHz | DBGHZ | DBGHz | DBA | DBMA | DBUA \n - LINear: Linear scaling; displays the RMS value. - DBM | DB | DBUV | DBMV | DBV: Basic FFT - DBPS | DBNS | DBUS | DBMS | DBS | DBHZ | DBKHZ | DBKHz | DBMHZ | DBMHz | DBGHZ | DBGHz: FFT on tracks of time or frequency measurements - DBA | DBMA | DBUA: FFT on current waveforms """ math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math) response = self._core.io.query_str_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:MAGNitude:SCALe?') return Conversions.str_to_scalar_enum(response, enums.FftMagnitudeScale)