Hi all,
Today I realized that I was using an earlier version of skrf (0.16.0) and updated to the latest version. Some things broke after this update. I can no longer use NISTMultilineTRL in my code.
I am trying to run a TRL calibration with multiple lines. Below is the list of structures that I input to the NISTMultilineTRL class:
[2-Port Network: 'D001.3.7_ms_to_ms_100um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'Reflect', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'D001.3.7_ms_to_ms_200um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'D001.3.7_ms_to_ms_250um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'D001.3.7_ms_to_ms_300um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'D001.3.7_ms_to_ms_400um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j],
2-Port Network: 'D001.3.7_ms_to_ms_600um', 1.0-170.0 GHz, 1691 pts, z0=[50.+0.j 50.+0.j]]
I also have the line lengths as a numpy array of the following format:
array([1.0e-04, 2.0e-04, 2.5e-04, 3.0e-04, 4.0e-04, 6.0e-04])
And I create the cal object using the following code:
cal = skrf.calibration.NISTMultilineTRL(measured, Grefls = [-1], l=l, er_est=7)
I do not use switch terms because this TRL is a secondary calibration therefore switch terms are already accounted for.
When I try to access the error network I get the following exception:
cal.error_ntwk[0].plot_s_db(1,0)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\skrf\calibration\calibration.py:515, in Calibration.coefs(self)
514 try:
--> 515 return self._coefs
516 except(AttributeError):
AttributeError: 'NISTMultilineTRL' object has no attribute '_coefs'
During handling of the above exception, another exception occurred:
IndexError Traceback (most recent call last)
Input In [48], in <cell line: 1>()
----> 1 cal.error_ntwk[0].plot_s_db(1,0)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\skrf\calibration\calibration.py:906, in Calibration.error_ntwk(self)
893 @property
894 def error_ntwk(self):
895 """
896 The calculated error Network or Network[s].
897
(...)
903
904 """
905 return error_dict_2_network(
--> 906 self.coefs,
907 frequency = self.frequency,
908 is_reciprocal= self.is_reciprocal)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\skrf\calibration\calibration.py:517, in Calibration.coefs(self)
515 return self._coefs
516 except(AttributeError):
--> 517 self.run()
518 return self._coefs
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\skrf\calibration\calibration.py:3133, in NISTMultilineTRL.run(self)
3131 if self.ref_plane != 0:
3132 try:
-> 3133 shift1 = exp(-2*gamma[m]*self.ref_plane[0])
3134 shift2 = exp(-2*gamma[m]*self.ref_plane[1])
3135 except TypeError:
IndexError: invalid index to scalar variable.
I would appreciate any help regarding this issue. This happened right after I updated the skrf package so I am assuming during a recent release something got broken.
Best,
Serhat