Calrep Example

An example of using the pyMez function Calrep to create uncertainties for one-port and two-port raw files generated by the HP Basic program measLP. MeasLP will be replaced with a python routine.

In [1]:
from pyMez import *
from pyMez.Code.Analysis.SParameter import *
Importing pyMez, this should take roughly 30 seconds
Importing Code.DataHandlers.GeneralModels
It took 3.26 s to import Code.DataHandlers.GeneralModels
Importing Code.DataHandlers.HTMLModels
It took 0.816 s to import Code.DataHandlers.HTMLModels
Importing Code.DataHandlers.NISTModels
It took 10.652 s to import Code.DataHandlers.NISTModels
Importing Code.DataHandlers.TouchstoneModels
It took 0.014 s to import Code.DataHandlers.TouchstoneModels
Importing Code.DataHandlers.XMLModels
It took 0.483 s to import Code.DataHandlers.XMLModels
Importing Code.DataHandlers.ZipModels
It took 0.082 s to import Code.DataHandlers.ZipModels
Importing Code.InstrumentControl.Experiments
It took 2.229 s to import Code.InstrumentControl.Experiments
Importing Code.InstrumentControl.Instruments
It took 0.022 s to import Code.InstrumentControl.Instruments
Importing Code.Utils.Names
It took 0.02 s to import Code.Utils.Names
It took 17.58 s to import all of the active modules
In [2]:
# open a raw file in the TESTS_DIRECTORY
file_path=os.path.join(TESTS_DIRECTORY,"CTN208.A1_011613")
raw_measurement=TwoPortRawModel(file_path)
In [3]:
%matplotlib inline
# check the data 
raw_measurement.show();
In [4]:
# now to calrep we just use the calrep function
calrep_measurement=calrep(raw_measurement)
In [5]:
# use the plot_calrep 
plot_calrep(calrep_measurement);

Comparison of the text versions

In [6]:
print(raw_measurement)
#System I    
#A 
#Type N Fem
#Type N 
#2-port         
#16 Jan 2013    
#13:39:20  
#MEAS95    
#100202.1  
#br        
#C121207.A5     
# 7 Dec 2012    
# 1
# 3
# 1
#  4
#  19
#  7
#20 dB CHECK STANDARD                                        
#CTN208              
Frequency,Direction,Connect,magS11,argS11,magS21,argS21,magS22,argS22
0.01000,1,1,0.0147,172.85,0.1040,-0.74,0.0054,173.86
0.01000,1,2,0.0147,172.87,0.1040,-0.75,0.0054,174.03
0.01000,1,3,0.0148,172.97,0.1040,-0.75,0.0054,173.68
0.02000,1,1,0.0151,173.52,0.1039,-1.46,0.0057,164.19
0.02000,1,2,0.0151,173.61,0.1039,-1.46,0.0057,164.32
0.02000,1,3,0.0152,173.48,0.1039,-1.47,0.0057,164.16
0.03000,1,1,0.0166,172.71,0.1039,-2.18,0.0027,103.05
0.03000,1,2,0.0167,172.80,0.1039,-2.18,0.0027,103.11
0.03000,1,3,0.0167,172.70,0.1039,-2.17,0.0027,103.13
0.04000,1,1,0.0152,172.46,0.1039,-2.88,0.0030,143.14
0.04000,1,2,0.0152,172.54,0.1039,-2.89,0.0030,143.67
0.04000,1,3,0.0152,172.44,0.1039,-2.88,0.0030,143.33
0.05000,1,1,0.0141,176.50,0.1039,-3.60,0.0041,154.47
0.05000,1,2,0.0142,176.65,0.1039,-3.61,0.0040,154.75
0.05000,1,3,0.0142,176.51,0.1039,-3.61,0.0041,154.41
0.06000,1,1,0.0140,175.10,0.1039,-4.31,0.0049,146.44
0.06000,1,2,0.0141,175.25,0.1039,-4.31,0.0048,146.51
0.06000,1,3,0.0141,175.09,0.1039,-4.32,0.0049,146.47
0.07000,1,1,0.0134,171.38,0.1039,-5.03,0.0050,161.57
0.07000,1,2,0.0134,171.50,0.1039,-5.03,0.0050,161.89
0.07000,1,3,0.0135,171.26,0.1039,-5.04,0.0050,161.55
0.08000,1,1,0.0143,168.91,0.1039,-5.75,0.0047,154.65
0.08000,1,2,0.0143,169.21,0.1039,-5.75,0.0047,154.99
0.08000,1,3,0.0144,168.95,0.1039,-5.75,0.0048,154.67
0.09000,1,1,0.0153,168.33,0.1039,-6.47,0.0049,145.08
0.09000,1,2,0.0153,168.50,0.1039,-6.46,0.0049,145.11
0.09000,1,3,0.0154,168.39,0.1039,-6.47,0.0049,145.24
0.10000,1,1,0.0152,168.56,0.1039,-7.17,0.0052,139.97
0.10000,1,2,0.0152,168.70,0.1039,-7.18,0.0051,139.98
0.10000,1,3,0.0153,168.58,0.1039,-7.18,0.0052,140.28
0.20000,1,1,0.0150,159.44,0.1038,-14.31,0.0054,123.99
0.20000,1,2,0.0150,159.43,0.1038,-14.31,0.0054,124.12
0.20000,1,3,0.0150,159.33,0.1038,-14.31,0.0054,123.79
0.30000,1,1,0.0152,151.47,0.1037,-21.45,0.0060,110.41
0.30000,1,2,0.0152,151.50,0.1038,-21.45,0.0060,110.28
0.30000,1,3,0.0153,151.59,0.1038,-21.45,0.0060,110.45
0.40000,1,1,0.0152,143.08,0.1037,-28.57,0.0076,97.06
0.40000,1,2,0.0152,143.11,0.1037,-28.57,0.0076,96.92
0.40000,1,3,0.0152,142.88,0.1037,-28.57,0.0076,96.59
0.50000,1,1,0.0156,134.22,0.1037,-35.69,0.0084,82.16
0.50000,1,2,0.0155,134.30,0.1037,-35.70,0.0084,82.32
0.50000,1,3,0.0156,134.28,0.1037,-35.70,0.0084,82.60
0.60000,1,1,0.0164,127.23,0.1036,-42.82,0.0097,77.55
0.60000,1,2,0.0165,127.27,0.1036,-42.81,0.0097,77.47
0.60000,1,3,0.0165,127.19,0.1036,-42.81,0.0097,77.29
0.70000,1,1,0.0169,121.43,0.1036,-49.93,0.0114,63.04
0.70000,1,2,0.0169,121.48,0.1036,-49.93,0.0113,62.98
0.70000,1,3,0.0169,121.41,0.1036,-49.92,0.0113,63.16
0.80000,1,1,0.0174,115.30,0.1036,-57.05,0.0116,64.53
0.80000,1,2,0.0174,115.36,0.1036,-57.05,0.0116,64.47
0.80000,1,3,0.0174,115.29,0.1036,-57.05,0.0116,64.34
0.90000,1,1,0.0178,107.91,0.1035,-64.16,0.0137,48.29
0.90000,1,2,0.0178,107.94,0.1035,-64.15,0.0137,48.19
0.90000,1,3,0.0178,107.95,0.1035,-64.15,0.0137,48.05
1.00000,1,1,0.0190,101.81,0.1035,-71.24,0.0133,46.27
1.00000,1,2,0.0190,101.87,0.1035,-71.24,0.0134,46.32
1.00000,1,3,0.0189,101.78,0.1035,-71.24,0.0134,46.27
In [7]:
print(calrep_measurement)
Calibration_Date = 7 Dec 2012
Calibration_Name = C121207.A5
Connector_Type_Calibration = Type N Fem
Connector_Type_Measurement = Type N
Device_Description = 20 dB CHECK STANDARD
Device_Id = CTN208
Measurement_Date = 16 Jan 2013
Measurement_Time = 13:39:20
Measurement_Type = 2-port
Nbs = 4
Number_Connects = 3
Number_Frequencies = 19
Number_Repeats = 1
Operator = br
Port_Used = 1
Program_Revision = 100202.1
Program_Used = MEAS95
Start_Frequency = 7
System_Id = System I
System_Letter = A
Frequency,magS11,uMbS11,uMaS11,uMdS11,uMgS11,argS11,uAbS11,uAaS11,uAdS11,uAgS11,magS21,uMbS21,uMaS21,uMdS21,uMgS21,argS21,uAbS21,uAaS21,uAdS21,uAgS21,magS22,uMbS22,uMaS22,uMdS22,uMgS22,argS22,uAbS22,uAaS22,uAdS22,uAgS22
0.01,0.01474,0.00649289403454,0.000471476444751,3.74165738677e-05,0.013020194005,172.894333333,0.000177391744793,0.000471476409816,0.0541869192907,0.108378521489,0.103986748864,8.18029795762e-06,8.09848334318e-05,3.47937586939e-06,0.000162942524555,-0.746333333333,0.03,0.10017,0.00410960933531,0.209293265911,0.00542333333333,0.00649289403454,0.000471476444751,4.71404520791e-06,0.0130199823662,173.856333333,0.000177347870083,0.000471476409816,0.14492833478,0.289858420368
0.02,0.0151333333333,0.00379621262241,0.000471976092046,3.3993463424e-05,0.00765118219926,173.533666667,0.000347431505392,0.000471976057,0.0533312499593,0.106668940039,0.103943339727,8.50126504736e-06,8.09957739687e-05,1.43048214723e-06,0.000162906515368,-1.46266666667,0.03,0.10034,0.00249443825785,0.209516947498,0.00567333333333,0.00379621262241,0.000471976092046,4.71404520791e-06,0.00765088594301,164.223666667,0.000347511793739,0.000471976057,0.0706745278646,0.14135391632
0.03,0.0166566666667,0.00295294807762,0.000472476268843,3.29983164554e-05,0.0059813794605,172.735333333,0.000520394052586,0.000472476233685,0.0453308822867,0.0906726625318,0.103932330845,8.77826827548e-06,8.10319630639e-05,4.79557203831e-06,0.000163294023688,-2.17666666667,0.03,0.10051,0.00124721912892,0.209798147328,0.00273333333333,0.00295294807762,0.000472476268843,1.6996731712e-05,0.0059811119577,103.095333333,0.000520901232798,0.000472476233685,0.0362613966759,0.0725364311439
0.04,0.0151933333333,0.00255777868763,0.000472976975702,3.3993463424e-05,0.0052027279729,172.480666667,0.0006936427886,0.000472976940432,0.0442894519672,0.0885948170732,0.103914463767,9.02870256794e-06,8.10628173961e-05,6.49208880802e-06,0.000163644065598,-2.88566666667,0.03,0.10068,0.0016996731712,0.210136634492,0.00301666666667,0.00255777868763,0.000472976975702,1.6996731712e-05,0.00520239480368,143.381,0.00069371364746,0.000472976940432,0.220119664425,0.440242531396
0.05,0.0141733333333,0.002334509601,0.000473478213185,2.05480466766e-05,0.00476425814487,176.550666667,0.000866956166442,0.000473478177803,0.066854734728,0.133724064403,0.103904454743,9.26208045288e-06,8.1099814472e-05,7.03816280601e-06,0.000163859717776,-3.607,0.03,0.10085,0.00454606056566,0.210631328787,0.00406,0.002334509601,0.000473478213185,8.16496580928e-06,0.00476410888296,154.542333333,0.000866986924793,0.000473478177803,0.150833977899,0.301674425411
0.06,0.0140733333333,0.00219348516074,0.000473979981855,2.05480466766e-05,0.00448841013982,175.145333333,0.00104030177827,0.000473979946361,0.0742308710862,0.148479346806,0.103905611137,9.48313837136e-06,8.11455473624e-05,7.29887881296e-06,0.000164046376395,-4.31566666667,0.03,0.10102,0.00377123616633,0.210895828524,0.00485,0.00219348516074,0.000473979981855,8.16496580928e-06,0.00448825170428,146.470333333,0.00104033417384,0.000473979946361,0.0294089933335,0.0588624104526
0.07,0.01345,0.00209747581235,0.000474482282274,2.82842712475e-05,0.00430131989956,171.378,0.00121365917061,0.000474482246667,0.0996226212598,0.199262287136,0.103907406266,9.693656678e-06,8.11918051307e-05,1.42961507656e-05,0.00016601754277,-5.03466666667,0.03,0.10119,0.00385861230093,0.211227886311,0.00502333333333,0.00209747581235,0.000474482282274,2.05480466766e-05,0.0043011442393,161.672,0.00121366679961,0.000474482246667,0.157283184098,0.314577164591
0.08,0.0143333333333,0.00202848059085,0.000474985115007,3.29983164554e-05,0.00416722125922,169.025,0.00138702044717,0.000474985079286,0.134494113874,0.269004208913,0.103900467745,9.89455993201e-06,8.12312611193e-05,1.15735220226e-05,0.000165292062862,-5.74733333333,0.03,0.10136,0.00205480466766,0.211452801563,0.00472,0.00202848059085,0.000474985115007,3.74165738677e-05,0.00416737057,154.768333333,0.00138703044812,0.000474985079286,0.156207838756,0.312429437494
0.09,0.0153233333333,0.00197682909649,0.000475488480616,4.71404520791e-05,0.0040675126523,168.405,0.0015603837502,0.000475488444782,0.0703183238329,0.140674483164,0.103905531515,1.00891139202e-05,8.12801247141e-05,8.94251797782e-06,0.000164781279532,-6.46566666667,0.03,0.10153,0.00188561808316,0.21177248599,0.00488,0.00197682909649,0.000475488480616,2.94392028878e-05,0.00406684606967,145.140333333,0.00156039903086,0.000475488444782,0.0700682207249,0.140174412643
0.1,0.01523,0.00193690491677,0.000475992379667,3.74165738677e-05,0.00398977162359,168.612,0.00173374872136,0.000475992343719,0.0615954543777,0.123243376347,0.103894766214,1.02756104317e-05,8.13166283699e-05,1.3174490226e-05,0.000166030712965,-7.17833333333,0.03,0.1017,0.00286744175568,0.212142520228,0.00516,0.00193690491677,0.000475992379667,2.94392028878e-05,0.00398950426433,140.073666667,0.0017337657968,0.000475992343719,0.14596879423,0.29195973285
0.2,0.0149766666667,0.00177622598343,0.000481060834148,2.35702260396e-05,0.00368073570142,159.399,0.00346743925712,0.000481060797039,0.0495042085753,0.0992556541696,0.103831549426,1.19010995426e-05,8.17174917491e-05,8.5893770325e-06,0.000166050137319,-14.311,0.03,0.1034,0.00294392028878,0.215408696822,0.00542666666667,0.00177622598343,0.000481060834148,9.42809041582e-06,0.00368048212019,123.965333333,0.00346745093801,0.000481060797039,0.1369728278,0.274035108634
0.3,0.0152566666667,0.00173224053794,0.000486183258465,1.6996731712e-05,0.00359851098704,151.522,0.00520114460247,0.000486183220158,0.0524277280327,0.105374663861,0.10375248358,1.3252493743e-05,8.21077581624e-05,8.48511664672e-06,0.000167204183505,-21.449,0.03,0.1051,0.000816496580927,0.218601707831,0.00603666666667,0.00173224053794,0.000486183258465,1.24721912892e-05,0.00359843688156,110.38,0.00520115568711,0.000486183220158,0.0733757453114,0.147122919963
0.4,0.0152266666667,0.00171344985636,0.000491360227299,9.42809041582e-06,0.00356507176484,143.022666667,0.0069348530723,0.000491360187755,0.0994663538869,0.199418045096,0.103745236924,1.44505033209e-05,8.25569918099e-05,2.82030378437e-06,0.000167719146866,-28.5703333333,0.03,0.1068,0.00235702260395,0.221917061584,0.00758666666667,0.00171344985636,0.000491360227299,2.05480466766e-05,0.00356525875945,96.858,0.00693486524698,0.000491360187755,0.199526105226,0.399294379913
0.5,0.0155666666667,0.00170391328637,0.00049659232145,1.24721912892e-05,0.00354969293137,134.266666667,0.00866856269832,0.00049659228063,0.0341207007874,0.0704162709995,0.103690626923,1.55287837219e-05,8.29707839045e-05,3.66396876283e-06,0.000168981877995,-35.695,0.03,0.1085,0.00163299316186,0.22516586479,0.00839666666667,0.00170391328637,0.00049659232145,9.42809041582e-06,0.00354965536924,82.36,0.00866857803248,0.00049659228063,0.182586965581,0.365586601773
0.6,0.01646,0.00169872054818,0.000501880127903,1.41421356237e-05,0.00354273067766,127.230333333,0.0104022726627,0.000501880085765,0.0347403064018,0.0725354547531,0.103616440016,1.65181439457e-05,8.33708750935e-05,4.12596037213e-06,0.000170183141847,-42.8156666667,0.03,0.1102,0.00329983164554,0.228516335424,0.00971,0.00169872054818,0.000501880127903,1.41421356237e-05,0.00354273067766,77.4373333333,0.010402287151,0.000501880085765,0.111086552842,0.223147320699
0.7,0.0169133333333,0.00169588094225,0.000507224239893,1.24721912892e-05,0.00354030741906,121.438333333,0.0121359828144,0.000507224196394,0.0290440278811,0.0629633198239,0.103600138074,1.7448907134e-05,8.3819685552e-05,6.61103204215e-06,0.000171742945018,-49.926,0.03,0.1119,0.000816496580929,0.231709099231,0.0113433333333,0.00169588094225,0.000507224239893,2.05480466766e-05,0.00354045806191,63.0593333333,0.0121360044487,0.000507224196394,0.0736764699359,0.149342051715
0.8,0.0174066666667,0.0016944417312,0.00051262525697,1.24721912892e-05,0.00354066264424,115.318,0.0138696932473,0.000512625212067,0.0271784228142,0.0610343458078,0.103577597533,1.83234935957e-05,8.4265834577e-05,1.82761235669e-06,0.000172508799328,-57.0503333333,0.03,0.1136,0.00410960933531,0.235132719024,0.0115766666667,0.0016944417312,0.00051262525697,9.42809041582e-06,0.00354062498631,64.448,0.0138697102672,0.000512625212067,0.0786044952065,0.159640825783
0.9,0.01781,0.00169389289933,0.000518083785072,1.41421356237e-05,0.00354281467918,107.934666667,0.0156034040384,0.000518083738719,0.0177451088723,0.0472704354638,0.103508893761,1.91432135836e-05,8.4676589979e-05,4.8302439901e-06,0.000173895586762,-64.1523333333,0.03,0.1153,0.00286744175568,0.238346908704,0.0136633333333,0.00169389289933,0.000518083785072,4.71404520791e-06,0.00354271431813,48.178,0.0156034355159,0.000518083738719,0.0984784240329,0.19941650494
1.0,0.01897,0.00169393842052,0.000523600436586,3.26598632371e-05,0.00354663302662,101.819333333,0.0173371148106,0.000523600388736,0.0357801931552,0.0795253903994,0.103458537263,1.99261090362e-05,8.51044024919e-05,5.25569718611e-06,0.000175127741923,-71.239,0.03,0.117,0.00244948974278,0.241619535634,0.0133533333333,0.00169393842052,0.000523600436586,1.24721912892e-05,0.00354611920007,46.2886666667,0.0173371451908,0.000523600388736,0.0250377492776,0.0609176378276
In [8]:
# A plot comparing the two files
plot_calrep_results_comparison(calrep_model=calrep_measurement,results_model=raw_measurement);