skrf.network.subnetwork
- skrf.network.subnetwork(ntwk, ports, offby=1)[source]
Return a subnetwork of a given Network from a list of port numbers.
A subnetwork is Network which S-parameters corresponds to selected ports, with all non-selected ports considered matched.
The resulting subNetwork is given a new Network.name property from the initial name and adding the kept ports indices (ex: ‘device’ -> ‘device13’). Such name should make easier the use of functions such as n_twoports_2_nport.
- Parameters:
ntwk (
Network
object) – Network to split into a subnetworkports (list of int) – List of ports to keep in the resultant Network. Indices are the Python indices (starts at 0)
offby (int) – starting value for s-parameters indexes in the sub-Network name parameter. A value of 1, assumes that a s21 = ntwk.s[:,1,0]. Default is 1.
- Returns:
subntwk – Resulting subnetwork from the given ports
- Return type:
Network
object
See also
Examples
>>> tee = rf.data.tee # 3 port Network >>> tee12 = rf.subnetwork(tee, [0, 1]) # 2 port Network from ports 1 & 2, port 3 matched >>> tee23 = rf.subnetwork(tee, [1, 2]) # 2 port Network from ports 2 & 3, port 1 matched >>> tee13 = rf.subnetwork(tee, [0, 2]) # 2 port Network from ports 1 & 3, port 2 matched