capn-freako/PyBERT

Trouble Importing Touchstone File into PyBert Version 4.4.1

denzchoe opened this issue · 1 comments

I am having trouble importing a .s4p Touchstone file on PyBert recently (v4.4.1).
running Python version 3.8.11

Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\site-packages\pybert\pybert_view.py", line 45, in run my_run_sweeps(self.the_pybert) File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\site-packages\pybert\pybert_cntrl.py", line 96, in my_run_sweeps my_run_simulation(self) File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\site-packages\pybert\pybert_cntrl.py", line 188, in my_run_simulation chnl_h = self.calc_chnl_h() File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\site-packages\pybert\pybert.py", line 1608, in calc_chnl_h chnl_H = 2.0 * calc_G(H, Rs, Cs, Zref, RL, Cp, CL, f*2*pi) # Compensating for nominal /2 divider action. File "C:\Users\Denz\anaconda3\envs\PYBERT_Env\lib\site-packages\pybert\pybert_util.py", line 599, in calc_G G = A * H * (1 + R1) / (1 - R1 * R2 * H ** 2) ValueError: operands could not be broadcast together with shapes (127999,) (128000,)

image

Fix recommended by David, at file pybert.py at the following location;

chnl_H = 2.0 * calc_G(H, Rs, Cs, Zref, RL, Cp, CL, f*2*pi) # Compensating for nominal /2 divider action.

chnl_H2 = 2.0 * calc_G(H2, Rs, Cs, Zref, RL, Cp, CL, f2*2*pi) # Compensating for nominal /2 divider action.

with

        chnl_H  = 2.0 * calc_G(H[:len(f)],  Rs, Cs, Zref, RL, Cp, CL, f*2*pi)   # Compensating for nominal /2 divider action.
        chnl_H2 = 2.0 * calc_G(H2[:len(f)], Rs, Cs, Zref, RL, Cp, CL, f2*2*pi)  # Compensating for nominal /2 divider action.

After edit, Touchstone files can import again