TransformMixin
- class pysmithchart.transforms.TransformMixin[source]
Bases:
objectMixin class providing transform-related methods for SmithAxes.
Methods Summary
get_xaxis_text1_transform(pad_points)Get the transformation for text on the first x-axis.
get_xaxis_transform([which])Get the transformation for the x-axis.
get_yaxis_text1_transform(pad_points)Get the transformation for text on the first y-axis.
get_yaxis_transform([which])Get the transformation for the y-axis.
imag_interp1d(y, steps)Interpolate a vector of imaginary values with evenly spaced points.
moebius_inv_z(*args[, normalize])Apply the inverse Möbius transformation to reflection coefficients.
moebius_z(*args[, normalize])Apply the Möbius transformation to impedance values.
real_interp1d(x, steps)Interpolate a vector of real values with evenly spaced points.
Methods Documentation
- get_xaxis_text1_transform(pad_points)[source]
Get the transformation for text on the first x-axis.
- Parameters:
pad_points (float) – Padding in points.
- Returns:
tuple – A tuple containing the transformation and text alignment information.
- get_xaxis_transform(which='grid')[source]
Get the transformation for the x-axis.
- Parameters:
which (str) – Specifies which gridlines the transformation is for. Defaults to “grid”.
- Returns:
Transform – The transformation object for the x-axis.
- get_yaxis_text1_transform(pad_points)[source]
Get the transformation for text on the first y-axis.
- Parameters:
pad_points (float) – Padding in points.
- Returns:
tuple – A tuple containing the transformation and text alignment information.
- get_yaxis_transform(which='grid')[source]
Get the transformation for the y-axis.
- Parameters:
which (str) – Specifies which gridlines the transformation is for. Defaults to “grid”.
- Returns:
Transform – The transformation object for the y-axis.
- imag_interp1d(y, steps)[source]
Interpolate a vector of imaginary values with evenly spaced points.
This method interpolates the given imaginary values such that, after applying a Möbius transformation with a real part of 0, the resulting points are evenly spaced.
The result is mapped back to the original space using the inverse Möbius transformation.
- Parameters:
y (iterable) – Imaginary values to interpolate.
steps (int) – Interpolation steps between two points.
Returns: Interpolated imaginary values.
- moebius_inv_z(*args, normalize=None)[source]
Apply the inverse Möbius transformation to reflection coefficients.
Converts reflection coefficients (S-parameters) back to impedance values (Z-parameters) using the inverse Möbius transformation. Handles both single values and arrays.
- Parameters:
*args – Either a single complex number/array or separate real and imaginary parts.
normalize (bool, optional) – Whether to apply normalization. If None, uses the axes’ normalization setting.
- Returns:
complex or ndarray – The transformed value(s) in Z-parameter space.
Examples
>>> s = 0.2 + 0.3j # Reflection coefficient >>> z = ax.moebius_inv_z(s) # Convert to impedance
- moebius_z(*args, normalize=None)[source]
Apply the Möbius transformation to impedance values.
Converts impedance values (Z-parameters) to reflection coefficients (S-parameters) using the Möbius transformation. Handles both single values and arrays.
- Parameters:
*args – Either a single complex number/array or separate real and imaginary parts.
normalize (bool, optional) – Whether to apply normalization. If None, uses the axes’ normalization setting.
- Returns:
complex or ndarray – The transformed value(s) in S-parameter space.
Examples
>>> z = 50 + 50j # Impedance >>> s = ax.moebius_z(z) # Convert to S-parameter
- real_interp1d(x, steps)[source]
Interpolate a vector of real values with evenly spaced points.
This method interpolates the given real values such that, after applying a Möbius transformation with an imaginary part of 0, the resulting points are evenly spaced.
The result is mapped back to the original space using the inverse Möbius transformation.
- Parameters:
x (iterable) – Real values to interpolate.
steps (int) – Interpolation steps between two points.
Returns: Interpolated real values.