skrf.networkSet.NetworkSet.interpolate_from_params
- NetworkSet.interpolate_from_params(param, x, sub_params=None, interp_kind='linear')[source]
Interpolate a Network from given parameters of NetworkSet’s Networks.
- Parameters:
param (string) – Name of the parameter to interpolate the NetworkSet with
x (float) – Point to evaluate the interpolated network at
sub_params (dict, optional) – Dictionnary of parameter/values to filter the NetworkSet, if necessary to avoid an ambiguity. Default is empty dict.
interp_kind (str) – Specifies the kind of interpolation as a string: ‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’. Cf
scipy.interpolate.interp1d
for detailed description. Default is ‘linear’.
- Returns:
ntw – Network interpolated at x
- Return type:
class:~skrf.network.Network
:raises ValueError : if the interpolating param/value are incorrect or ambiguous:
Example
Creating a dummy example:
>>> params = [ {'a':0, 'X':10, 'c':'A'}, {'a':1, 'X':10, 'c':'A'}, {'a':2, 'X':10, 'c':'A'}, {'a':1, 'X':20, 'c':'A'}, {'a':0, 'X':20, 'c':'A'}, ] >>> freq1 = rf.Frequency(75, 110, 101, 'ghz') >>> ntwks_params = [rf.Network(frequency=freq1, s=np.random.rand(len(freq1),2,2), name=f'ntwk_{m}', comment=f'ntwk_{m}', params=params) for (m, params) in enumerate(params) ] >>> ns = rf.NetworkSet(ntwks_params)
Interpolated Network for a=1.2 within X=10 Networks:
>>> ns.interpolate_from_params('a', 1.2, {'X': 10})