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

Apply 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)

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

  • attr (string) – Name of the parameter to operate on. Ex: ‘s’, ‘z’, etc. Default is ‘s’.

  • *args – passed to the func

  • **kwargs – passed to the func


ntwk – Resulting renumbered Network

Return type:

Network object


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