Tools designed to extract Resonant Frequency & Coupling Quality Factor for Microwave Kinetic Inductance Detector Simulations using a Sonnet .csv data file.
The scripts in this repository allow the extraction of Resonant Frqeuency & Qc from a .csv data file exported from the EM Simulation Software Sonnet. The main purpose of these scripts is to automate the extraction of data from large Sonnet data sets and thus the scripts provided here will automate the extraction of Resonant Frequency and Qc for any number of parameter sweeps.
Please Note: These Scripts will only work with 1 single resonant dip to correctly extract f0 & Qc.
Resonant Frequency (f0) is extracted by finding the minimum S21 value for a given frequency range.
Please note: Ensure the data exported from Sonnet is in the form of S-Paramter, Mag and Phase for accurate values. For outputting simulation data from Sonnet to a .csv file, please refer to the Sonnet manual.
https://www.sonnetsoftware.com/support/manuals.asp
For the Python Script, simply enter the file directory of the .csv data file to line 44 (with open(file directory, "r") as csvfile). The script will output all Parameter names, Resonant Frequencies and Qc Factor for all Parameters into the Python console.
If you wish to plot data, each frequency range is stored in the "b" variable and S-paramter data is stored in S11_Mag, S11_Phase, S21_Mag & S21_Phase variables respectively.
All Parameter names are stored in title All f0 values are stored in ac_res_freq All Qc values are stored in Qual_Fac
For the Matlab Script, make sure the data file is on the correct path. Then use the function "ResExtract(filename)". For Example: [ResonantFrequencies, QFactors]=ResExtract(filename).