Creating a Checkstandard Report

A check standard report is a summary of one of the devices used in the NIST check standard program. Reports can be either a comparison of a one or two port measurement file that has multiple connect measurements, with the metadata Connector_Type_Measurement and with the historical database or just a summary of a device with respect to time. The metadata normally attached with the device measurement is

keys=["System_Id","System_Letter","Connector_Type_Calibration","Connector_Type_Measurement",
              "Measurement_Type","Measurement_Date","Measurement_Time","Program_Used","Program_Revision","Operator",
              "Calibration_Name","Calibration_Date","Port_Used","Number_Connects","Number_Repeats","Nbs",
              "Number_Frequencies","Start_Frequency",
              "Device_Description","Device_Id"]

Report_1 (CTN202)

Report_2 (C07208)

Importing the reports module

In [1]:
from pyMez.Code.Analysis.Reports import *
Importing pyMez, this should take roughly 30 seconds
Importing Code.DataHandlers.GeneralModels
It took 4.497 s to import Code.DataHandlers.GeneralModels
Importing Code.DataHandlers.HTMLModels
It took 0.694 s to import Code.DataHandlers.HTMLModels
Importing Code.DataHandlers.NISTModels
It took 10.054 s to import Code.DataHandlers.NISTModels
Importing Code.DataHandlers.TouchstoneModels
It took 0.007 s to import Code.DataHandlers.TouchstoneModels
Importing Code.DataHandlers.XMLModels
It took 0.261 s to import Code.DataHandlers.XMLModels
Importing Code.DataHandlers.ZipModels
It took 0.023 s to import Code.DataHandlers.ZipModels
Importing Code.InstrumentControl.Experiments
It took 1.325 s to import Code.InstrumentControl.Experiments
Importing Code.InstrumentControl.Instruments
It took 0.01 s to import Code.InstrumentControl.Instruments
Importing Code.Utils.Names
It took 0.008 s to import Code.Utils.Names
It took 16.879 s to import all of the active modules

History of a device

In [5]:
report_1=CheckStandardReport(Device_Id="CTNP14")
measurement_type is P
Body tag was not present adding it
Head tag was not present adding it
In [3]:
# This displays the report in a browser
report_1.show()
file://c:/users/sandersa/appdata/local/temp/1/tmpmtebwj.html
In [4]:
# This is the default path
report_1.path
Out[4]:
'HTML_Document_20181204_001.html'
In [5]:
# This saves the report as an html file under a different name
report_1.path=os.path.join(os.getcwd(),"CheckStandard_Files/CheckStandard_Report_CTN202.html")
report_1.save()
Out[5]:
'C:\\ProgramData\\Anaconda2\\Lib\\site-packages\\pyMez\\Documentation\\Examples\\jupyter\\CheckStandard_Files/CheckStandard_Report_CTN202.html'

Comparison of a measurement with the data base

By just passing a file path of a measurement with the proper metadata it automatically compares the file with the database values and creates the html report.

In [6]:
measurement_path=os.path.join(os.getcwd(),"CheckStandard_Files/C07208.L6_041304")
report_2=CheckStandardReport(file_path=measurement_path)
Body tag was not present adding it
Head tag was not present adding it
In [7]:
# This displays the report in a browser
report_2.show()
file://c:/users/sandersa/appdata/local/temp/1/tmpul_1i0.html
In [8]:
# This saves the file
report_2.path=os.path.join(os.getcwd(),"CheckStandard_Files/CheckStandard_Report_C07208.html")
report_2.save()
Out[8]:
'C:\\ProgramData\\Anaconda2\\Lib\\site-packages\\pyMez\\Documentation\\Examples\\jupyter\\CheckStandard_Files/CheckStandard_Report_C07208.html'

The database is not distributed with the pyMez package, it is too big.

The constants in the module pyMez.Code.Analysis.Reports define the location of the data base.

TWO_PORT_NR_CHKSTD_CSV=r"C:\Share\Converted_Check_Standard\Two_Port_NR_Check_Standard.csv"
COMBINED_ONE_PORT_CHKSTD_CSV=r"C:\Share\Converted_Check_Standard\Combined_One_Port_Check_Standard.csv"
COMBINED_TWO_PORT_CHKSTD_CSV=r"C:\Share\Converted_Check_Standard\Combined_Two_Port_Check_Standard.csv"
COMBINED_POWER_CHKSTD_CSV=r"C:\Share\Converted_Check_Standard\Combined_Power_Check_Standard.csv"
ONE_PORT_CALREP_CSV=r"C:\Share\Converted_DUT\One_Port_DUT.csv"
TWO_PORT_CALREP_CSV=r"C:\Share\Converted_DUT\Two_Port_DUT.csv"
POWER_3TERM_CALREP_CSV=r"C:\Share\Converted_DUT\Power_3Term_DUT.csv"
POWER_4TERM_CALREP_CSV=r"C:\Share\Converted_DUT\Power_4Term_DUT.csv"