skrf.network.Network.func_on_parameter

Network.func_on_parameter(func, attr='s', *args, **kwargs)[source]

Applies a function parameter matrix, one frequency slice at a time

This is useful for functions that can only operate on 2d arrays, like numpy.linalg.inv. This loops over f and calls func(ntwkA.s[f,:,:], *args, **kwargs)

Parameters:
  • func (func) – function to apply to s-parameters, on a single-freqency slice. (ie func(ntwkA.s[0,:,:], *args, **kwargs)
  • **kwargs (*args,) – passed to the func

Examples

>>> from numpy.linalg import inv
>>> ntwk.func_on_parameter(inv)