{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a id=\"top\"></a>\n",
    "# Data Acquistion and Analysis with PNA Grabber and MUF\n",
    "\n",
    "This document is  a guide to data acquistion with PNAGrabber.exe and error correction with the MUF for a short-open-load-thru (SOLT) calibration method using a E8361A PNA, and commerical 2.4mm calibration kit. \n",
    "\n",
    "## Table of Contents\n",
    "<hr style=\"border-top: 3px double #8c8b8b;\"/>\n",
    "\n",
    "<ol>\n",
    "<li> <h3><a href=\"#overview\" style=\"color:black\">Overview</a> </h3></li>\n",
    "<li> <h3><a href=\"#measurement-setup\" style=\"color:black\">Measurement Setup</a> </h3></li>\n",
    "<li> <h3><a href=\"#PNAGrabber\" style=\"color:black\">Acquiring Calibration Data With PNAGrabber</a> </h3></li>\n",
    "<li> <h3><a href=\"#PNAGrabber-DUT\" style=\"color:black\">Acquiring DUT Data With PNAGrabber</a> </h3></li>\n",
    "<li> <h3><a href=\"#MUF\" style=\"color:black\">Correcting Data With the MUF</a> </h3></li>\n",
    "<li> <h3><a href=\"#Notes\" style=\"color:black\">Notes</a> </h3></li>\n",
    "</ol>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " <table>\n",
    " <td>\n",
    " <a href=\"#top\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#overview\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"overview\" style=\"color:black\">Overview</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The measurement process starts with the cleaning of the connectors of the calibration kit. Cleaning the connectors should remove any particulates in the threads of the connector or on the mating faces of the connector. After the connectors are clean, then the thru, a male-to-male adapter, is connected between port one and a cable attached to port two. The PNA is then setup by using the front panel of the PNA itself. The sweep parameters (sweep start, sweep stop and number of points) and the before measurement settling time are all set on the front pannel. The measurement is continued on a remote computer using PNAGrabber which sets the IF-Bandwidth. The calibration kit is measured starting with the thru, then progressing to the shorts, opens and loads. Each measurement is performed with two calibration standards, one on the male end of the thru and one on the female end of the cable. After the measurement the files are generated by PNAGrabber they are then analyzed by the MUF, which returns the s-parameters corrected and uncertainities. The MUF requires the calibration algorithm, standard definitions, stadard types and standard measurements along with DUT measurements to be entered.  \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " <table>\n",
    " <td>\n",
    " <a href=\"#overview\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#measurement-setup\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"measurement-setup\" style=\"color:black\">Measurement Setup</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<ol style=\"list-style-type: upper-roman\">\n",
    "<li> Clean all connectors and mating faces on the calibration standards and DUT's </li>\n",
    "<li> Gauge all calibration standards and the DUT </li>\n",
    "<li> Setup sweep parameters on the front panel of the instrument Channel->Start/Stop (10MHz,50GHz), Sweep-> Number of Points (201) </li>\n",
    "<li> Setup sweep settle parameters on the front panel of the instrument Sweep->Sweep Setup-> Dwelltime (10$\\mu$ s)  </li>\n",
    "<li> Insure the instrument is communicating on the proper interface (in this example GPIB::16 ) </li>\n",
    "<li> Connect the thru (male to male) </li>\n",
    "<li> Open PNAGrabber.exe and check com settings and IFBW settings </li>\n",
    "<li> Measure with <a href=\"#PNAGrabber\"> PNAGrabber </a>  </li>\n",
    "</ol>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "  <table>\n",
    " <td>\n",
    " <a href=\"#measurement-setup\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#PNAGrabber\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"PNAGrabber\" style=\"color:black\">Acquiring Calibration Data With PNAGrabber</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Set the Working Directory\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_Set_Working_Directory.png\" alt=\"PNAGrabber\" height=\"800\" width=\"400\"/>\n",
    "\n",
    "#### Set the Type and File Name for the Thru Measurement and the Switch Terms\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_Set_Thru.png\" alt=\"PNAGrabber\" height=\"800\" width=\"400\"/>\n",
    "\n",
    "#### Measure the Thru and Thru Switch Terms\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_Measure_Thru.png\" alt=\"PNAGrabber\" height=\"800\" width=\"400\"/>\n",
    "\n",
    "#### Repeat the Process for Short, Open and Load Standards (No Switch Terms ) \n",
    "Each time, start by setting the type of measurement (normal), then set the file name, and finally measure the standard after it has been connected to the PNA.  \n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_Set_Measure_Short.png\" alt=\"PNAGrabber\" height=\"800\" width=\"400\"/>\n",
    "Keep repeating this until all the standards are measured. \n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_Full_Menu.png\" alt=\"PNAGrabber\" height=\"800\" width=\"400\"/>\n",
    "\n",
    "#### Save the completed menu, so that you can repeat the process (a second calibration)\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_SAve.png\" alt=\"PNAGrabber\" height=\"800\" width=\"1000\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " <table>\n",
    " <td>\n",
    " <a href=\"#PNAGrabber\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#PNAGrabber-DUT\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"PNAGrabber-DUT\" style=\"color:black\">Acquiring DUT Data With PNAGrabber</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### After saving the menu for the calibration standards, change the working directory to the DUT data directory and edit the files for the new measurements, then measure as before. \n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/PNAGrabber_DUT_Measurements.PNG\" alt=\"PNAGrabber\" height=\"800\" />\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " <table>\n",
    " <td>\n",
    " <a href=\"#PNAGrabber-DUT\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#MUF\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"MUF\" style=\"color:black\">Correcting Data With the MUF</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once the experiment is finished and the data has been collected,  it is time to correct the DUT data. Several standard definition files have been collected at [`\\\\jake.nist.gov\\MUF$`][muf-jake], and each calibration standard entered into the MUF will require at least 3 inputs; a definition file, a standard type and a measurement file. In this case we used the definitions at ```\\\\jake.nist.gov\\MUF$\\2_4mm\\OSLT_jaj```\n",
    "\n",
    "[muf-jake]:\\\\jake.nist.gov\\MUF$\n",
    "[defs]:\\\\jake.nist.gov\\MUF$\\2_4mm\\OSLT_jaj"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Start with selecting the calibration algrithm (SOLT)\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_SOLT.png\" alt=\"MUF\" width=\"500\" />\n",
    "#### Define the main calibration, by first selecting definition files and dragging them to the screen\n",
    "Here we have used the predefined definition files in ```\\\\jake.nist.gov\\MUF$\\2_4mm\\OSLT_jaj```\n",
    "\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Main_Calibration.PNG\" alt=\"MUF\" width=\"800\" />\n",
    "#### Set the type of the definition by right clicking the definition name\n",
    "The standard types are thru, switch terms, and termination (S12=S21=0)\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Select_Std_Type.png\" alt=\"MUF\" width=\"800\" />\n",
    "#### Drag and drop the measurement files\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Main_Measurement.png\" alt=\"MUF\" width=\"800\" />\n",
    "#### Now the menu should look something like this, with Definition, Standard Type and Measurement defined for each.\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/Finished_Calibration_Menu.PNG\" alt=\"MUF\" width=\"800\" />\n",
    "#### Now select the DUT tab and drag and drop all the DUT's, it is a good idea to use the calibration standards as DUT's to check that everything is working properly.\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_DUTs.PNG\" alt=\"MUF\" width=\"800\" />\n",
    "#### Now set the number of monte carlo files and if you want a repeat calibration on the options menu. After this you can run it (run->calibrate), if there are some files it cannot find it will tell you in the status bar\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Options.png\" alt=\"MUF\" width=\"800\" />\n",
    "#### If you can't run it look at the status bar\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Status_Bar.PNG\" alt=\"MUF\" width=\"800\" />\n",
    "#### Finally run the calibration Run->Calibrate\n",
    "<img src=\"./PNAGrabber_MUF_Example_Files/MUF_Calibrate.png\" alt=\"MUF\" width=\"800\" />"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Examples of corrected and uncorrected data, smith plots of S11\n",
    "\n",
    "<table>\n",
    "<tr>\n",
    "<th> Uncorrected </th>\n",
    "<th> Corrected </th>\n",
    "</tr>\n",
    "<tr>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/UncorrectedLoad.png\" alt=\"PNAGrabber\" width=\"475\" /> Uncorrected Load</td>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/CorrectedLoad.png\" alt=\"PNAGrabber\" width=\"475\" />Corrected Load</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/UncorrectedThru.png\" alt=\"PNAGrabber\" width=\"475\"  />\n",
    "Uncorrected Thru</td>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/CorrectedThru.png\" alt=\"PNAGrabber\" width=\"475\"  />Corrected Thru</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/UncorrectedShort.png\" alt=\"PNAGrabber\" width=\"475\"  /> Uncorrected Short</td>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/CorrectedShort.png\" alt=\"PNAGrabber\" width=\"475\"  />Corrected Short</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/UncorrectedOpen.png\" alt=\"PNAGrabber\" width=\"475\" />Uncorrected Open</td>\n",
    "<td><img src=\"./PNAGrabber_MUF_Example_Files/CorrectedOpen.png\" alt=\"PNAGrabber\" width=\"475\"  /> Corrected Open</td>\n",
    "</tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " <table>\n",
    " <td>\n",
    " <a href=\"#MUF\"><img src=\"./PNAGrabber_MUF_Example_Files/previous.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#Notes\"><img src=\"./PNAGrabber_MUF_Example_Files/next.png\" /></a>\n",
    " </td><td>\n",
    " <a href=\"#top\"> <em>back to top</em></a>\n",
    " </td>\n",
    " </table>\n",
    " <hr style=\"border-top: 2px double #8c8b8b;\"/>\n",
    " <h3><a id=\"Notes\" style=\"color:black\">Notes:</a> </h3>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<ol>\n",
    "<li> Moving files around is difficult, one issue is that the menu files that the MUF / PNAGrabber uses are just pointers to the data in different formats. This causes problems if the data files are moved. The menu files can be made into archives. </li>\n",
    "<li> There is a lot of back and forth for the measurement so having the control computer close to the actual setup is handy.</li>\n",
    "<li> Sweep parameters are set on the instrument, but IFBW is set on PNAGrabber </li>\n",
    "<li> The main source of contamination on connectors seems to be the foam in the cal-kit box </li>\n",
    "\n",
    "</ol>\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
