Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel.read_s_parameter_group returns mixed-up data #10

Open
Terrabits opened this issue Oct 28, 2021 · 0 comments
Open

Channel.read_s_parameter_group returns mixed-up data #10

Terrabits opened this issue Oct 28, 2021 · 0 comments

Comments

@Terrabits
Copy link
Owner

The VNA returns S-Parameter data in this order:

S11(f1), S11(f2), S11(f3)... S12(f1), S12(f2), ...

In the Channel.read_s_parameter_group method, this data is reshaped into shape=(points, ports, ports), which mixes up everything.

See https://github.com/Terrabits/save_all_s4p/blob/main/save_all_s4p/vna_monkeypatch/read_s_parameter_group.py for a potential solution.

Here is an excerpt of the relevant array manipulations:

# reshape data according to VNA
    ports          = len(self.s_parameter_group)
    points         = self.points
    original_shape = (ports, ports, points)
    original_array =  numpy.reshape(result, original_shape)

    # switch axes to match scikit-rf [s] syntax
    desired_array = numpy.swapaxes(original_array, 1, 2)
    desired_array = numpy.swapaxes(desired_array,  0, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant