nirfmxspecan 25.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nirfmxspecan/__init__.py +105 -0
- nirfmxspecan/acp.py +31 -0
- nirfmxspecan/acp_configuration.py +5496 -0
- nirfmxspecan/acp_results.py +1238 -0
- nirfmxspecan/ampm.py +31 -0
- nirfmxspecan/ampm_configuration.py +3664 -0
- nirfmxspecan/ampm_results.py +1180 -0
- nirfmxspecan/attributes.py +10380 -0
- nirfmxspecan/ccdf.py +31 -0
- nirfmxspecan/ccdf_configuration.py +1053 -0
- nirfmxspecan/ccdf_results.py +688 -0
- nirfmxspecan/chp.py +31 -0
- nirfmxspecan/chp_configuration.py +3079 -0
- nirfmxspecan/chp_results.py +471 -0
- nirfmxspecan/dpd.py +35 -0
- nirfmxspecan/dpd_apply_dpd.py +2608 -0
- nirfmxspecan/dpd_configuration.py +4945 -0
- nirfmxspecan/dpd_pre_dpd.py +1130 -0
- nirfmxspecan/dpd_results.py +451 -0
- nirfmxspecan/enums.py +3722 -0
- nirfmxspecan/errors.py +80 -0
- nirfmxspecan/examples/nirfmxspecan_acp.py +235 -0
- nirfmxspecan/examples/nirfmxspecan_chp.py +147 -0
- nirfmxspecan/examples/nirfmxspecan_spectrum.py +187 -0
- nirfmxspecan/fcnt.py +31 -0
- nirfmxspecan/fcnt_configuration.py +1279 -0
- nirfmxspecan/fcnt_results.py +474 -0
- nirfmxspecan/harm.py +31 -0
- nirfmxspecan/harm_configuration.py +1934 -0
- nirfmxspecan/harm_results.py +555 -0
- nirfmxspecan/idpd.py +31 -0
- nirfmxspecan/idpd_configuration.py +1848 -0
- nirfmxspecan/idpd_results.py +335 -0
- nirfmxspecan/im.py +31 -0
- nirfmxspecan/im_configuration.py +3227 -0
- nirfmxspecan/im_results.py +905 -0
- nirfmxspecan/internal/_custom_types.py +13 -0
- nirfmxspecan/internal/_helper.py +293 -0
- nirfmxspecan/internal/_library.py +10100 -0
- nirfmxspecan/internal/_library_interpreter.py +9273 -0
- nirfmxspecan/internal/_library_singleton.py +53 -0
- nirfmxspecan/iq.py +31 -0
- nirfmxspecan/iq_configuration.py +796 -0
- nirfmxspecan/iq_results.py +130 -0
- nirfmxspecan/marker.py +31 -0
- nirfmxspecan/marker_configuration.py +469 -0
- nirfmxspecan/marker_results.py +210 -0
- nirfmxspecan/nf.py +31 -0
- nirfmxspecan/nf_configuration.py +5466 -0
- nirfmxspecan/nf_results.py +642 -0
- nirfmxspecan/obw.py +31 -0
- nirfmxspecan/obw_configuration.py +1896 -0
- nirfmxspecan/obw_results.py +401 -0
- nirfmxspecan/pavt.py +31 -0
- nirfmxspecan/pavt_configuration.py +1695 -0
- nirfmxspecan/pavt_results.py +475 -0
- nirfmxspecan/phase_noise.py +31 -0
- nirfmxspecan/phase_noise_configuration.py +2474 -0
- nirfmxspecan/phase_noise_results.py +586 -0
- nirfmxspecan/power_list.py +31 -0
- nirfmxspecan/power_list_configuration.py +1004 -0
- nirfmxspecan/power_list_results.py +276 -0
- nirfmxspecan/sem.py +31 -0
- nirfmxspecan/sem_configuration.py +5025 -0
- nirfmxspecan/sem_results.py +2471 -0
- nirfmxspecan/specan.py +3229 -0
- nirfmxspecan/spectrum.py +31 -0
- nirfmxspecan/spectrum_configuration.py +3668 -0
- nirfmxspecan/spectrum_results.py +355 -0
- nirfmxspecan/spur.py +31 -0
- nirfmxspecan/spur_configuration.py +3840 -0
- nirfmxspecan/spur_results.py +758 -0
- nirfmxspecan/txp.py +31 -0
- nirfmxspecan/txp_configuration.py +1564 -0
- nirfmxspecan/txp_results.py +346 -0
- nirfmxspecan-25.5.0.dist-info/LICENSE +30 -0
- nirfmxspecan-25.5.0.dist-info/METADATA +184 -0
- nirfmxspecan-25.5.0.dist-info/RECORD +79 -0
- nirfmxspecan-25.5.0.dist-info/WHEEL +4 -0
nirfmxspecan/__init__.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""nirfmxspecan package."""
|
|
2
|
+
|
|
3
|
+
__version__ = "25.5.0"
|
|
4
|
+
|
|
5
|
+
from nirfmxspecan.attributes import * # noqa: F403
|
|
6
|
+
from nirfmxspecan.enums import * # noqa: F403
|
|
7
|
+
from nirfmxspecan.specan import SpecAn, _SpecAnSignalConfiguration
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_diagnostic_information():
|
|
11
|
+
"""Get diagnostic information about the system state that is suitable for printing or logging.
|
|
12
|
+
returns: dict
|
|
13
|
+
note: Python bitness may be incorrect when running in a virtual environment.
|
|
14
|
+
"""
|
|
15
|
+
import importlib.metadata
|
|
16
|
+
import os
|
|
17
|
+
import platform
|
|
18
|
+
import struct
|
|
19
|
+
import sys
|
|
20
|
+
|
|
21
|
+
def is_python_64bit():
|
|
22
|
+
return struct.calcsize("P") == 8
|
|
23
|
+
|
|
24
|
+
def is_os_64bit():
|
|
25
|
+
return platform.machine().endswith("64")
|
|
26
|
+
|
|
27
|
+
def is_venv():
|
|
28
|
+
return "VIRTUAL_ENV" in os.environ
|
|
29
|
+
|
|
30
|
+
info = {} # type: ignore
|
|
31
|
+
info["os"] = {}
|
|
32
|
+
info["python"] = {}
|
|
33
|
+
info["driver"] = {}
|
|
34
|
+
info["module"] = {}
|
|
35
|
+
if platform.system() == "Windows":
|
|
36
|
+
try:
|
|
37
|
+
import winreg as winreg
|
|
38
|
+
except ImportError:
|
|
39
|
+
import _winreg as winreg # type: ignore
|
|
40
|
+
|
|
41
|
+
os_name = "Windows"
|
|
42
|
+
try:
|
|
43
|
+
driver_version_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\National Instruments\RFmx\SpecAn\C Runtime Support") # type: ignore
|
|
44
|
+
driver_version = winreg.QueryValueEx(driver_version_key, "Version")[0] # type: ignore
|
|
45
|
+
except WindowsError: # type: ignore
|
|
46
|
+
driver_version = "Unknown"
|
|
47
|
+
else:
|
|
48
|
+
raise SystemError("Unsupported platform: {}".format(platform.system()))
|
|
49
|
+
|
|
50
|
+
if sys.version_info[1] >= 10:
|
|
51
|
+
installed_packages_names = [
|
|
52
|
+
name
|
|
53
|
+
for name_list in importlib.metadata.packages_distributions().values()
|
|
54
|
+
for name in name_list
|
|
55
|
+
]
|
|
56
|
+
installed_packages_names = set(installed_packages_names)
|
|
57
|
+
installed_packages_list = [
|
|
58
|
+
{"name": name, "version": importlib.metadata.distribution(name).version}
|
|
59
|
+
for name in sorted(installed_packages_names)
|
|
60
|
+
]
|
|
61
|
+
else:
|
|
62
|
+
import pkg_resources
|
|
63
|
+
|
|
64
|
+
installed_packages = pkg_resources.working_set
|
|
65
|
+
installed_packages_list = [
|
|
66
|
+
{
|
|
67
|
+
"name": i.key,
|
|
68
|
+
"version": i.version,
|
|
69
|
+
}
|
|
70
|
+
for i in installed_packages
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
info["os"]["name"] = os_name
|
|
74
|
+
info["os"]["version"] = platform.version()
|
|
75
|
+
info["os"]["bits"] = "64" if is_os_64bit() else "32" # type: ignore
|
|
76
|
+
info["driver"]["name"] = "NI-RFmxSpecAn"
|
|
77
|
+
info["driver"]["version"] = driver_version
|
|
78
|
+
info["module"]["name"] = "nirfmxspecan"
|
|
79
|
+
info["module"]["version"] = "25.5.0b0"
|
|
80
|
+
info["python"]["version"] = sys.version
|
|
81
|
+
info["python"]["bits"] = "64" if is_python_64bit() else "32" # type: ignore
|
|
82
|
+
info["python"]["is_venv"] = is_venv() # type: ignore
|
|
83
|
+
info["python"]["packages"] = installed_packages_list
|
|
84
|
+
|
|
85
|
+
return info
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def print_diagnostic_information():
|
|
89
|
+
"""Print diagnostic information in a format suitable for issue report.
|
|
90
|
+
note: Python bitness may be incorrect when running in a virtual environment.
|
|
91
|
+
"""
|
|
92
|
+
info = get_diagnostic_information() # type: ignore
|
|
93
|
+
|
|
94
|
+
row_format = " {:<10"
|
|
95
|
+
for type in ["OS", "Driver", "Module", "Python"]:
|
|
96
|
+
typename = type.lower()
|
|
97
|
+
print(type + ":")
|
|
98
|
+
for item in info[typename]:
|
|
99
|
+
if item != "packages":
|
|
100
|
+
print(row_format.format(item.title() + ":", info[typename][item]))
|
|
101
|
+
print(" Installed Packages:")
|
|
102
|
+
for p in info["python"]["packages"]:
|
|
103
|
+
print((" " * 8) + p["name"] + "==" + p["version"])
|
|
104
|
+
|
|
105
|
+
return info
|
nirfmxspecan/acp.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Represents the Acp measurement."""
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
|
|
5
|
+
import nirfmxspecan.acp_configuration as configuration
|
|
6
|
+
import nirfmxspecan.acp_results as results
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _raise_if_disposed(f):
|
|
10
|
+
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
|
|
11
|
+
|
|
12
|
+
@functools.wraps(f)
|
|
13
|
+
def aux(*xs, **kws):
|
|
14
|
+
meas_obj = xs[0] # parameter 0 is 'self' which is the measurement object
|
|
15
|
+
if meas_obj._signal_obj.is_disposed:
|
|
16
|
+
raise Exception("Cannot access a disposed SpecAn signal configuration")
|
|
17
|
+
return f(*xs, **kws)
|
|
18
|
+
|
|
19
|
+
return aux
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Acp(object):
|
|
23
|
+
"""Represents the Acp measurement."""
|
|
24
|
+
|
|
25
|
+
def __init__(self, signal_obj):
|
|
26
|
+
"""Represents the Acp measurement."""
|
|
27
|
+
self._signal_obj = signal_obj
|
|
28
|
+
self._session_function_lock = signal_obj._session_function_lock
|
|
29
|
+
self._interpreter = signal_obj._interpreter
|
|
30
|
+
self.configuration = configuration.AcpConfiguration(signal_obj) # type: ignore
|
|
31
|
+
self.results = results.AcpResults(signal_obj) # type: ignore
|