Python driver and CLI for the Keysight N1914A RF power meter, used for RF power measurement in radio astronomy receiver systems.
- Full driver for the Keysight N1914A power meter over TCP/IP (VISA).
- Sensor zeroing, reference calibration factor, and channel offset support.
- Configurable measurement rate (
NORM/FAST/DOUB) and auto-filtering. - Layered configuration: CLI arguments ->
config.ini-> built-in defaults. - Interactive shell for bench use (
n1914a-cli shell) - avoids VISA reconnection overhead between commands. - Context manager support (
with N1914A(...) as pm:). - Mock-based test suite - no hardware required to run tests.
git clone https://github.com/PatrickADz/n1914a-python.git
cd n1914a-python
pip install -e .
# Optional: for the live-plotting example
pip install -e ".[plot]"A VISA backend is required (NI-VISA, or the pure-Python pyvisa-py,
installable with pip install pyvisa-py).
from n1914a import N1914A
with N1914A("TCPIP::192.168.0.4::INSTR") as pm:
pm.set_unit("DBM")
pm.zero() # remove RF power from the sensor first
print(pm.get_power())Or via the CLI:
n1914a-cli --address TCPIP::192.168.0.4::INSTR read
n1914a-cli --address TCPIP::192.168.0.4::INSTR shellCopy config.example.ini to config.ini to avoid passing --address every
time (real config.ini files are git-ignored).
n1914a/
__init__.py - public package API
driver.py - N1914A driver class
config.py - layered configuration loader
cli.py - CLI + interactive shell
exceptions.py - custom exception hierarchy
tests/
test_driver.py - mock-based test suite
examples/
basic_read.py - connect, zero, single reading
continuous_plot.py - live matplotlib plot of power readings
config.example.ini
pyproject.toml
LICENSE
pip install -e ".[dev]"
pytestAll tests run against a FakeInstrument/FakeResourceManager pair - no
physical power meter is required.
Developed for RF power measurement.
MIT - see LICENSE.