utils#

This package contains handy functions useful across simphony submodules and to the average user.

Functions

add_polar(c1, c2)

Adds two polar coordinates together.

dict_to_matrix(sdict)

Converts a dictionary of s-parameters to a matrix of s-parameters.

freq2wl(freq)

Convenience function for converting from frequency to wavelength.

interpolate(resampled, sampled, s_parameters)

Returns the result of a cubic interpolation for a given frequency range.

mat_add_polar(array1, array2)

Adds two polar matrixes together.

mat_mul_polar(array1, array2)

Multiplies two polar matrixes together.

mul_polar(c1, c2)

Multiplies two polar coordinates together.

polar(x)

Convert from rectangular to polar coordinates element-wise.

rect(r, phi)

Convert from polar to rectangular coordinates element-wise.

resample(x, xp, sdict)

Resample an s-dictionary to a new frequency grid.

str2float(num)

Converts a number represented as a string to a float.

validate_model(model)

Validates a model.

wl2freq(wl)

Convenience function for converting from wavelength to frequency.

wlum2freq(wl)

Convenience function for converting from wavelength in microns to frequency.

xpxp_to_xxpp(xpxp)

Converts a NxN matrix or N shaped vector in xpxp convention to xxpp convention.

xxpp_to_xpxp(xxpp)

Converts a NxN matrix or N shaped vector in xxpp convention to xpxp convention.