Skip to main content

Communication with Anritsu Lightning VNA

Project description

Build Status PyPI

anritsu_lightning

Python interface to the Anritsu Lightning 37xxxD VNA

Installation

> pip install anritsu_lightning

Usage

>>> from anritsu_lightning import CommChannel
>>> with CommChannel(address=6) as vna:
...     vna.ch3.parameter = "S21"
...     s21 = vna.read(channel=3, data_status="corrected")
>>> 

It is also possible to read the S-parameters in Touchstone SnP format.

>>> from anritsu_lightning import CommChannel
>>> with CommChannel(address=6) as vna:
...     vna.measurement_setup.start = 40e6  # Hz
...     vna.measurement_setup.stop = 20e9  # Hz
...     vna.measurement_setup.data_points = 401
...     vna.ch1.parameter = "S11"
...     vna.ch1.graph_type = "log magnitude"
...     vna.ch1.graph_scale = 20.0  # dB/div
...     vna.ch2.parameter = "S12"
...     vna.ch3.parameter = "S21"
...     vna.ch3.graph_type = "log magnitude"
...     vna.ch3.graph_scale = 2.0  # dB/div
...     vna.ch4.parameter = "S22"
...     vna.display_mode = "dual channels 1 & 3"
...     with open(<file>, "wt") as f:
...         f.write(vna.get_s2p(previous=False))
>>>

It is also possible to use the markers to find the -3 dB point of a filter. In this example, the VNA measured the -3 dB bandwidth of a Mini-Circuits VLF-1000+ low pass filter with nominal specification of 1.3 GHz. The VNA was already setup to measure S21 on channel 3 between 40 MHz and 5 GHz.

In [1]: from anritsu_lightning import CommChannel
In [2]: cc = CommChannel(address=6)
In [3]: vna = cc.get_instrument()
In [4]: vna.markers.mode = "normal"
In [5]: vna.markers.enable([1, 2])
In [6]: vna.markers.set_active(1)
In [7]: vna.markers.set_xaxis_location(1, "40 MHz")
In [8]: vna.markers.delta_reference = 1
In [9]: vna.markers.set_active(2)
In [10]: bw = vna.markers.search("-3 dB", reference="delta reference", timeout=5000)
In [11]: print(f"{bw/1e9:.2f} GHz")
1.26 GHz

Supported features:

  • Measurement setup: frequency sweep, data points, etc.
  • Channel setup: parameter (S11, S12, ...), graph type, etc.
  • Graph setup: scale, reference, offset
  • Data transfer: channel data, screen bitmap, S2P file
  • Markers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anritsu_lightning-0.1.7.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

anritsu_lightning-0.1.7-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page