mpylab.device.spectrumanalyzer module¶
mpylab.device.spectrumanalyzer module.
- class mpylab.device.spectrumanalyzer.SPECTRUMANALYZER(SearchPaths=None)
Bases:
DRIVERBase class for spectrum-analyzer drivers.
The parent class is
mpylab.device.driver.DRIVER.- Parameters:
SearchPaths (sequence of path-like, optional) – Directories searched for device INI files and referenced data files.
- ATTMODES = ('NORMAL', 'LOWNOISE', 'LOWDIST')
- DETECTORS = ('AUTOSELECT', 'AUTOPEAK', 'MAXPEAK', 'MINPEAK', 'SAMPLE', 'RMS', 'AVERAGE', 'DET_QPEAK')
- GetAtt()
Read the analyzer att setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetAttMode()
Read the analyzer attmode setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetCenterFreq()
Read the analyzer cfreq setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetDetector()
Read the analyzer det setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetPreAmp()
Read the analyzer preamp setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetRBW()
Read the analyzer rbw setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetRefLevel()
Read the analyzer reflevel setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetSpan()
Read the analyzer span setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetSpectrum()
Acquire one spectrum trace.
- Returns:
(status, (frequencies, levels)). Frequencies are numeric values in hertz and levels use the configured analyzer level unit.- Return type:
tuple
- GetSpectrumNB()
Acquire a spectrum through the non-blocking-compatible API.
The generic fallback is synchronous and delegates to
GetSpectrum(). Hardware drivers may override it when they offer genuinely asynchronous acquisition.
- GetStartFreq()
Read the analyzer stfreq setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetStopFreq()
Read the analyzer spfreq setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetSweepCount()
Read the analyzer scount setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetSweepPoints()
Read the analyzer spoints setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetSweepTime()
Read the analyzer stime setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetTrace()
Read the analyzer trace setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetTraceMode()
Read the analyzer tmode setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetTriggerDelay()
Read the analyzer tdelay setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetTriggerMode()
Read the analyzer trgmode setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- GetVBW()
Read the analyzer vbw setting.
- Returns:
(status, value)with the current setting.- Return type:
tuple
- SetAtt(value)
Set and read back the analyzer att setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetAttAuto()
Enable automatic input attenuation.
- Returns:
(status, attenuation)with the read-back setting.- Return type:
tuple
- SetAttMode(value)
Set and read back the analyzer attmode setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetCenterFreq(value)
Set and read back the analyzer cfreq setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetDetector(value)
Set and read back the analyzer det setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetPreAmp(value)
Set and read back the analyzer preamp setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetRBW(value)
Set and read back the analyzer rbw setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetRefLevel(value)
Set and read back the analyzer reflevel setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetSpan(value)
Set and read back the analyzer span setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetStartFreq(value)
Set and read back the analyzer stfreq setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetStopFreq(value)
Set and read back the analyzer spfreq setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetSweepCount(value)
Set and read back the analyzer scount setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetSweepPoints(value)
Set and read back the analyzer spoints setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetSweepTime(value)
Set and read back the analyzer stime setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetTrace(value)
Set and read back the analyzer trace setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetTraceMode(value)
Set and read back the analyzer tmode setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetTriggerDelay(value)
Set and read back the analyzer tdelay setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetTriggerMode(value)
Set and read back the analyzer trgmode setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- SetVBW(value)
Set and read back the analyzer vbw setting.
- Parameters:
value (object) – Requested setting. Numeric units follow the corresponding analyzer method name and configuration field.
- Returns:
(status, value)with the read-back setting.- Return type:
tuple
- TRACEMODES = ('WRITE', 'VIEW', 'AVERAGE', 'BLANK', 'MAXHOLD', 'MINHOLD')
- TRIGGERMODES = ('FREE', 'VIDEO', 'EXTERNAL')
- conftmpl = {'channel_%d': {'attenuation': <class 'str'>, 'attmode': <class 'str'>, 'detector': <class 'str'>, 'rbw': <class 'str'>, 'reflevel': <class 'float'>, 'span': <class 'float'>, 'sweepcount': <class 'int'>, 'sweeppoints': <class 'int'>, 'sweeptime': <class 'float'>, 'trace': <class 'int'>, 'tracemode': <class 'str'>, 'triggermode': <class 'str'>, 'unit': <class 'str'>, 'vbw': <class 'float'>}, 'description': {'description': <class 'str'>, 'deviceid': <class 'str'>, 'driver': <class 'str'>, 'serialnr': <class 'str'>, 'type': <class 'str'>, 'vendor': <class 'str'>}, 'init_value': {'fstart': <class 'float'>, 'fstep': <class 'float'>, 'fstop': <class 'float'>, 'gpib': <class 'int'>, 'nr_of_channels': <class 'int'>, 'virtual': <function strbool>}}