Provides high-level Calibration class as well as calibration algorithms and parametric standards
Contains the Calibration class, and supporting functions
Bases: object
Represents a Calibration object, which can run a calibration algorithm, store results, and apply calibration to measurements.
see init for more information on usage.
T-matricies used for de-embeding, a two-port calibration.
apply the current calibration to a measurement.
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.
dir: directory of measurements (string) contains: will only load measurements who’s filename contains
this string.
estimate of biased error for overdetermined calibration with multiple connections of each standard
coefs: a dictionary holding the calibration coefficients
a Network type which represents the error network being calibrated out.
frequency object for the calibration
the number of ports in the calibration
number of ideal/measurement pairs in calibration
a dictionary holding all of the output from the calibration algorithm
plot magnitude of the error coeficient dictionary
plot calibration error metrics for an over-determined calibration.
see biased_error, unbiased_error, and total_error for more info
plots a component of the residual errors on the Calibration-plane.
note: the residuals are calculated by:
(self.apply_cal(self.measured[k])-self.ideals[k])
see plot_residuals
see plot_residuals
see plot_residuals
see uncertainty_per_standard
returns a the residuals for each calibration standard in the form of a list of Network types.
these residuals are calculated in the ‘calibrated domain’, meaning they are
r = (E.inv ** m - i)
This way the units of the residual networks are meaningful
so, if you want to re-calculate the residual networks then you delete the property ‘_residual_ntwks’.
if calibration is overdeteremined, this holds the residuals in the form of a vector.
also available are the complex residuals in the form of mwavepy.Network’s, see the property ‘residual_ntwks’
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.
estimate of total error for overdetermined calibration with multiple connections of each standard. This is the combined effects of both biased and un-biased errors
r: complex residual errors std_cs: standard deviation taken accross connections
and standards
string representing what type of calibration is to be performed. supported types at the moment are:
‘two port’: two port calibration based on the error-box model
note: algorithms referenced by calibration_algorithm_dict, are stored in calibrationAlgorithms.py
estimate of unbiased error for overdetermined calibration with multiple connections of each standard
given that you have repeat-connections of single standard, this calculates the complex standard deviation (distance) for each standard in the calibration across connection #.
convert a dictionary holding standard error terms to a Network object.
takes:
returns:
rand(d0, d1, ..., dn)
Random values in a given shape.
Create an array of the given shape and propagate it with random samples from a uniform distribution over [0, 1).
random
This is a convenience function. If you want an interface that takes a shape-tuple as the first argument, refer to random.
>>> np.random.rand(3,2)
array([[ 0.14022471, 0.96360618], #random
[ 0.37601032, 0.25528411], #random
[ 0.49313049, 0.94909878]]) #random
Contains calibrations algorithms, used in the Calibration class,
converts an abc ndarry to a dictionarry containing the error coefficients.
guess length of physical length of a Delay Short given by aNtwk
standard algorithm for a one port calibration. If more than three standards are supplied then a least square algorithm is applied.
‘error coeffcients’: dictionary containing standard error coefficients ‘residuals’: a matrix of residuals from the least squared
calculation. see numpy.linalg.lstsq() for more info
uses numpy.linalg.lstsq() for least squares calculation
see one_port_nls for a non-linear least square implementation
one port non-linear least squares.
‘error coeffcients’: dictionary containing standard error coefficients ‘residuals’: a matrix of residuals from the least squared
calculation. see numpy.linalg.lstsq() for more info
‘cov_x’: covariance matrix
An iterative, general self-calibration routine which can take any mixture of parameterized standards. The correct parameter values are defined as the ones which minimize the mean residual error.
a dictionary holding: ‘error_coefficients’: dictionary of error coefficients ‘residuals’: residual matrix (shape depends on #stds) ‘parameter_vector_final’: final results for parameter vector ‘mean_residual_list’: the mean, magnitude of the residuals at each
iteration of calibration. this is the variable being minimized.
see parametricStandard sub-module for more info on them
An iterative, general self-calibration routine which can take any mixture of parameterized standards. The correct parameter values are defined as the ones which minimize the mean residual error.
a dictionary holding: ‘error_coefficients’: dictionary of error coefficients ‘residuals’: residual matrix (shape depends on #stds) ‘parameter_vector_final’: final results for parameter vector ‘mean_residual_list’: the mean, magnitude of the residuals at each
iteration of calibration. this is the variable being minimized.
see ParameterizedStandard for more info on them
An iterative, general self-calibration routine which can take any mixture of parametric standards. The correct parameter values are defined as the ones which minimize the mean residual error.
a dictionary holding: ‘error_coefficients’: dictionary of error coefficients ‘residuals’: residual matrix (shape depends on #stds) ‘parameter_vector_final’: final results for parameter vector ‘mean_residual_list’: the mean, magnitude of the residuals at each
iteration of calibration. this is the variable being minimized.
see ParametricStandard for more info on them
rand(d0, d1, ..., dn)
Random values in a given shape.
Create an array of the given shape and propagate it with random samples from a uniform distribution over [0, 1).
random
This is a convenience function. If you want an interface that takes a shape-tuple as the first argument, refer to random.
>>> np.random.rand(3,2)
array([[ 0.14022471, 0.96360618], #random
[ 0.37601032, 0.25528411], #random
[ 0.49313049, 0.94909878]]) #random
two port calibration based on the 8-term error model. takes two ordered lists of measured and ideal responses. optionally, switch terms can be taken into account by passing a tuple containing the forward and reverse switch terms as 1-port Networks
references
Doug Rytting ” Network Analyzer Error Models and Calibration Methods” RF 8 Microwave. Measurements for Wireless Applications (ARFTG/NIST)
Short Course ...
Speciale, R.A.; , “A Generalization of the TSD Network-Analyzer Calibration Procedure, Covering n-Port Scattering-Parameter Measurements, Affected by Leakage Errors,” Microwave Theory and Techniques, IEEE Transactions on , vol.25, no.12, pp. 1100- 1115, Dec 1977
unterminates switch terms from raw measurements.