Calibration

class mwavepy.Calibration(measured, ideals, type=None, frequency=None, is_reciprocal=False, switch_terms=None, name=None, **kwargs)

Represents a calibration instance, a class to hold sets of measurements, ideals, and calibration results.

see init for more information on usage.

note: all calibration algorithms are in calibrationAlgorithms.py, and are referenced by the dictionary in this object called ‘calibration_algorihtm_dict’

Ts

T-matricies used for de-embeding.

apply_cal(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(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.
coefs

coefs: a dictionary holding the calibration coefficients

for one port cal’s
‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s
TBD
error_ntwk

a Network type which represents the error network being calibrated out.

frequency
nports

the number of ports in the calibration

output_from_cal

a dictionary holding all of the output from the calibration algorithm

plot_coefs_db(ax=None, show_legend=True, **kwargs)

plot magnitude of the error coeficient dictionary

plot_residuals_db(ax=None, show_legend=True, **kwargs)
plot magnitude of the resdiues, if calibration is
overdetermined
residuals
from numpy.lstsq:
residues: the sum of the residues; squared euclidean norm for each column vector in b (given ax=b)
run()

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.

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

Previous topic

WorkingBand

This Page