skrf.vi.vna.NanoVNAv2.get_snp_network

NanoVNAv2.get_snp_network(ports=(0, 1), **kwargs)[source]

Returns a \(N\)-port network containing the measured parameters at the positions specified in ports. The remaining responses will be 0. The rows and the column to be populated in the network are selected implicitly based on the position and the order of the entries in ports. See the parameter desciption for details. This function can be useful for sliced measurements of larger networks with an analyzer that does not have enough ports, for example when measuring a 3-port (e.g a balun) with the 1.5-port NanoVNA (example below).

Parameters
  • ports (tuple of int or None, optional) – Specifies the position and order of the measured responses in the returned N-port network. Valid entries are 0, 1, or None. The length of the tuple defines the size N of the network, the entries define the type (forward/reverse) and position (indices of the rows and the column to be populated). Number 0 refers to the source port (s11 from the NanoVNA), 1 refers to the receiver port (s21 from the NanoVNA), and None skips this position (required to increase N). For N>1, the colum index is determined by the position of the source port 0 in ports. See examples below.

  • kwargs (list) – Additional parameters will be ignored.

Return type

skrf.Network

Examples

To get the measured S-matrix of a 3-port from six individual measurements, the slices (s11, s21), (s11, s31), (s12, s22), (s22, s32), (s13, s33), and (s23, s33) can be obtained directly as (incomplete) 3-port networks with the results stored at the correct positions, which helps combining them afterwards.

>>> from skrf.vi import vna
>>> nanovna = vna.NanoVNAv2()

1st slice: connect VNA_P1=P1 and VNA_P2=P2 to measure s11 and s21:

>>> nw_s1 = nanovna.get_snp_network(ports=(0, 1, None))

This will return a 3-port network with [[s11_vna, 0, 0], [s21_vnas, 0, 0], [0, 0, 0]].

2nd slice: connect VNA_P1=P1 and VNA_P2=P3 to measure s11 and s31:

>>> nw_s2 = nanovna.get_snp_network(ports=(0, None, 1))

This will return a 3-port network with [[s11_vna, 0, 0], [0, 0, 0], [s21_vna, 0, 0]].

3rd slice: connect VNA_P1=P2 and VNA_P2=P1 to measure s22 and s12:

>>> nw_s3 = nanovna.get_snp_network(ports=(1, 0, None))

This will return a 3-port network with [[0, s21_vna, 0], [0, s11_vna, 0], [0, 0, 0]].

4th slice: connect VNA_P1=P2 and VNA_P2=P3 to measure s22 and s32:

>>> nw_s4 = nanovna.get_snp_network(ports=(None, 0, 1))

This will return a 3-port network with [[0, 0, 0], [0, s11_vna, 0], [0, s21_vna, 0]].

5th slice: connect VNA_P1=P3 and VNA_P2=P1 to measure s13 and s33:

>>> nw_s5 = nanovna.get_snp_network(ports=(1, None, 0))

This will return a 3-port network with [[0, 0, s21_vna], [0, 0, 0], [0, 0, s11_vna]].

6th slice: connect VNA_P1=P3 and VNA_P2=P2 to measure s23 and s33:

>>> nw_s6 = nanovna.get_snp_network(ports=(None, 1, 0))

This will return a 3-port network with [[0, 0, 0], [0, 0, s21_vna], [0, 0, s11_vna]].

Now, the six incomplete networks can simply be added to get to complete network of the 3-port:

>>> nw = nw_s1 + nw_s2 + nw_s3 + nw_s4 + nw_s5 + nw_s6

The reflection coefficients s11, s22, s33 have been measured twice, so the sum still needs to be divided by 2 to get the correct result:

>>> nw.s[:, 0, 0] = 0.5 * nw.s[:, 0, 0]
>>> nw.s[:, 1, 1] = 0.5 * nw.s[:, 1, 1]
>>> nw.s[:, 2, 2] = 0.5 * nw.s[:, 2, 2]

This gives the average, but you could also replace it with just one of the measurements.

This function can also be used for smaller networks:

Get a 1-port network with s11, i.e. [s11_meas]:

>>> nw = nanovna.get_snp_network(ports=(0, ))

Get a 1-port network with s21, i.e. [s21_meas]:

>>> nw = nanovna.get_snp_network(ports=(1, ))

Get a 2-port network (incomplete) with (s11, s21) = measurement, (s12, S22) = 0, i.e. [[s11_meas, 0], [s21_meas, 0]]:

>>> nw = nanovna.get_snp_network(ports=(0, 1))

Get a 2-port network (incomplete) with (s12, s22) = measurement, (s11, S21) = 0, i.e. [[0, s21_meas], [0, s11_meas]]:

>>> nw = nanovna.get_snp_network(ports=(1, 0))