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

#       calibration.py
#       
#       
#       Copyright 2010 alex arsenovic <arsenovic@virginia.edu>
#       
#
#       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 versionpy.
#       
#       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, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

 
Modules
       
mwavepy.mathFunctions
numpy
os
pylab
mwavepy.touchstone

 
Classes
       
__builtin__.object
Calibration

 
class Calibration(__builtin__.object)
    Represents a calibration instance, a generic class to hold sets
of measurements, ideals, and calibration results.
 
all calibration algorithms are in calibrationAlgorithms.py, and are
referenced by the dictionary in this object called
'calibration_algorihtm_dict'
 
  Methods defined here:
__init__(self, frequency, type, name=None, is_reciprocal=False, **kwargs)
Calibration initializer
 
takes:
        frequency: a Frequency object over which the calibration
                is defined
 
        type: string representing what type of calibration is to be
                performed. supported types at the moment are:
 
                'one port':     standard one-port cal. if more than
                        2 measurement/ideal pairs are given it will
                        calculate the least squares solution.
 
                'one port xds': self-calibration of a unknown-length
                        delay-shorts.
 
        **kwargs: key-word arguments passed to teh calibration
                algorithm.
 
        name: name of calibration, just a handy identifing string
        is_reciprocal: enables the reciprocity assumption on 
                calculated error network
apply_cal(self, input_ntwk)
apply the current calibration to a measurement.
 
takes:
        input_ntwk: the measurement to apply the calibration to, a
                Network type.
returns:
        caled: the calibrated measurement, a Network type.
apply_cal_to_all_in_dir(self, dir, contains=None, f_unit='ghz')
convience function to apply calibration to an entire directory
of measurements, and return a dictionary of the calibrated
results, optionally the user can 'grep' the direction
by using the contains switch.
 
takes:
        dir: directory of measurements (string)
        contains: will only load measurements who's filename contains
                this string.
        f_unit: frequency unit, to use for all networks. see
                frequency.Frequency.unit for info.
returns:
        ntwkDict: a dictionary of calibrated measurements, the keys
                are the filenames.
run(self)
runs the calibration algorihtm.
 
 this is automatically called the
first time      any dependent property is referenced (like error_ntwk)
, but only the first time. if you change something and want to
re-run the calibration use this.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
coefs
coefs: a dictionary holding the calibration coefficients
 
for one port cal's
        'directivity':e00
        'reflection tracking':e01e10
        'source match':e11
error_ntwk
a Network type which represents the error network being
calibrated out.
output_from_cal
a dictionary holding all of the output from the calibration
algorithm
type
string representing what type of calibration is to be
performed. supported types at the moment are:
 
'one port':     standard one-port cal. if more than
        2 measurement/ideal pairs are given it will
        calculate the least squares solution.
 
'one port xds': self-calibration of a unknown-length
        delay-shorts.
 
note:
algorithms referenced by  calibration_algorithm_dict

Data and other attributes defined here:
calibration_algorithm_dict = {'one port': <function one_port>, 'one port xds': <function xds>, 'one port xds_xdl': <function xds_xdl>}

 
Functions
       
error_dict_2_network(coefs, frequency=None, is_reciprocal=False, **kwargs)
convert a dictionary holding standard error terms to a Network
object
 
takes:
 
returns: