Correct error when asking db/ma from ri file
@@ -397,11 +397,11 @@ class Touchstone:
values[:,1::2] = numpy.real(v_complex)
values[:,2::2] = numpy.imag(v_complex)
elif (self.format == 'ri') and (format == 'ma'):
- v_complex = numpy.absolute(values[:,1::2] + 1j* self.sparameters[:,2::2])
+ v_complex = values[:,1::2] + 1j* values[:,2::2]
values[:,1::2] = numpy.absolute(v_complex)
values[:,2::2] = numpy.angle(v_complex)*(180/numpy.pi)
elif (self.format == 'ri') and (format == 'db'):
- v_complex = numpy.absolute(values[:,1::2] + 1j* self.sparameters[:,2::2])
+ v_complex = values[:,1::2] + 1j* values[:,2::2]
values[:,1::2] = 20*numpy.log10(numpy.absolute(v_complex))
values[:,2::2] = numpy.angle(v_complex)*(180/numpy.pi)
