skrf.networkSet.NetworkSet

class skrf.networkSet.NetworkSet(ntwk_set, name=None)[source]

A set of Networks.

This class allows functions on sets of Networks, such as mean or standard deviation, to be calculated conveniently. The results are returned in Network objects, so that they may be plotted and saved in like Network objects.

This class also provides methods which can be used to plot uncertainty bounds for a set of Network.

The names of the NetworkSet properties are generated dynamically upon initialization, and thus documentation for individual properties and methods is not available. However, the properties do follow the convention:

>>> my_network_set.function_name_network_property_name

For example, the complex average (mean) Network for a NetworkSet is:

>>> my_network_set.mean_s

This accesses the property ‘s’, for each element in the set, and then calculates the ‘mean’ of the resultant set. The order of operations is important.

Results are returned as Network objects, so they may be plotted or saved in the same way as for Network objects:

>>> my_network_set.mean_s.plot_s_mag()
>>> my_network_set.mean_s.write_touchstone('mean_response')

If you are calculating functions that return scalar variables, then the result is accessible through the Network property .s_re. For example:

>>> std_s_deg = my_network_set.std_s_deg

This result would be plotted by:

>>> std_s_deg.plot_s_re()

The operators, properties, and methods of NetworkSet object are dynamically generated by private methods

  • __add_a_operator()

  • __add_a_func_on_property()

  • __add_a_element_wise_method()

  • __add_a_plot_uncertainty()

thus, documentation on the individual methods and properties are not available.

Parameters
  • ntwk_set (Union[list, dict]) –

  • name (str) –

Attributes

inv

Return the NetworkSet of inverted Networks (Network.inv()).

mean_s_db

Return Network of mean magnitude in dB.

std_s_db

Return the Network of the standard deviation magnitude in dB.

Methods

__init__

Initialize for NetworkSet.

add_polar_noise

param ntwk

animate

Animate a property of the networkset.

copy

Copie each network of the network set.

cov

Covariance matrix.

datetime_index

Create a datetime index from networks names.

element_wise_method

Call a given method of each element and returns the result as a new NetworkSet if the output is a Network.

filter

Filter NetworkSet based on a string in Network.name.

from_dir

Create a NetworkSet from a directory containing Networks.

from_s_dict

Create a NetworkSet from a dictionary of s-parameters

from_zip

Create a NetworkSet from a zipfile of touchstones.

interpolate_from_network

Interpolate a Network from a NetworkSet, as a multi-file N-port network.

ntwk_attr_2_df

Converts an attributes of the Networks within a NetworkSet to a Pandas DataFrame.

plot_logsigma

Plot the uncertainty for the set in units of log-sigma.

plot_minmax_bounds_component

plots mean value of the NetworkSet with +/- uncertainty bounds in an Network’s attribute.

plot_minmax_bounds_s_db

Call plot_uncertainty_bounds(attribute= 's_mag','ppf':mf.magnitude_2_db*args,**kwargs).

plot_minmax_bounds_s_db10

Call plot_uncertainty_bounds(attribute= 's_mag','ppf':mf.magnitude_2_db*args,**kwargs).

plot_minmax_bounds_s_time_db

Call plot_uncertainty_bounds(attribute= 's_mag','ppf':mf.magnitude_2_db*args,**kwargs).

plot_uncertainty_bounds_component

Plot mean value of a NetworkSet with +/- uncertainty bounds in an Network’s attribute.

plot_uncertainty_bounds_s

Plot complex uncertainty bounds plot on smith chart.

plot_uncertainty_bounds_s_db

Call plot_uncertainty_bounds(attribute='s_mag','ppf':mf.magnitude_2_db*args,**kwargs).

plot_uncertainty_bounds_s_time_db

Call plot_uncertainty_bounds(attribute= 's_mag','ppf':mf.magnitude_2_db*args,**kwargs).

plot_uncertainty_decomposition

Plot the total and component-wise uncertainty.

rand

Return n random samples from this NetworkSet.

scalar_mat

Return a scalar ndarray representing param data vs freq and element idx.

set_wise_function

Calls a function on a specific property of the Networks in this NetworkSet.

signature

Visualization of a NetworkSet.

sort

Sort this network set.

to_dict

Return a dictionary representation of the NetworkSet.

to_s_dict

Converts a NetworkSet to a dictionary of s-parameters.

uncertainty_ntwk_triplet

Return a 3-tuple of Network objects which contain the mean, upper_bound, and lower_bound for the given Network attribute.

write

Write the NetworkSet to disk using write()

write_spreadsheet

Write contents of network to a spreadsheet, for your boss to use.