mwavepy.touchstone
index
/home/alex/docs/python/path/mwavepy/touchstone.py

#     Copyright (C) 2008 Werner Hoch
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

 
Modules
       
numpy

 
Classes
       
touchstone

 
class touchstone
    class to read touchstone s-parameter files
The reference for writing this class is the draft of the
Touchstone(R) File Format Specification Rev 2.0
http://www.eda-stds.org/ibis/adhoc/interconnect/touchstone_spec2_draft.pdf
 
  Methods defined here:
__init__(self, filename)
get_format(self, format='ri')
returns the file format string used for the given format.
This is usefull to get some informations.
get_noise_data(self)
TODO: NIY
get_noise_names(self)
TODO: NIY
get_sparameter_arrays(self)
returns the sparameters as a tuple of arrays, where the first element is
the frequency vector (in Hz) and the s-parameters are a 3d numpy array.
The values of the sparameters are complex number.
usage:
  f,a = sgetparameter_arrays()
  s11 = a[:,0,0]
get_sparameter_data(self, format='ri')
get the data of the sparameter with the given format.
supported formats are:
  orig:  unmodified s-parameter data
  ri:    data in real/imaginary
  ma:    data in magnitude and angle (degree)
  db:    data in log magnitute and angle (degree)
Returns a list of numpy.arrays
get_sparameter_names(self, format='ri')
generate a list of column names for the s-parameter data
The names are different for each format.
posible format parameters:
  ri, ma, db, orig  (where orig refers to one of the three others)
returns a list of strings.
load_file(self, filename)
Load the touchstone file into the interal data structures