Scattering Parameter Data and the AirlineData Class

class permittivitycalc.AirlineData(L, airline, dataArray, file, name=None, date=None, freq_cutoff=100000000.0, nrw=False, shorted=False, corr=False, normalize_density=False, norm_eqn='LI', bulk_density=None, solid_dielec=None, solid_losstan=None, particle_diameter=None, particle_density=None, temperature=None, typeA_unc=True)[source]

Use S-parameter data from a METAS VNA Tools II output text file to calculate the complex relative permittivity of a sample in a coaxial transmission line

Parameters:
  • L (float) – Length of airline in cm.
  • airline ({'VAL', 'PAL', 'GAL', '7', 'custom'}) – Name of airline used for measurement.
  • dataArray (array) – Array containing raw measurement data.
  • file (str) – Input file path.
  • corr (array) – Default = False. If True, also correct S-parameter data and produce corrected arrays.
  • nrw (bool, optional) – Default = False. If True, use Nicolson, Rross, Weir (NRW) algorithm to calculate permittivity and magnetic permeability.
  • shorted (bool, optional) –

    Default = False. If True, automatically load Shorted S11 data. File name must have the following format and be in the same folder as original file: file_path/file_name_shorted.txt

    Example:
    • file_path/air_atm.txt
    • file_path/air_atm_shorted.txt
  • normalize_density (bool or float or int, optional) – Default = False. If True, use either Lichtenecker or Landau-Lifshitz-Looyenga equation to normalize the complex permittivity to a constant density of 1.60 g/cm^3. If float or int is given, normalize to the density provided in g/cm^3. Requires that bulk_density be given.
  • norm_eqn ({'LI','LLL'}, optional) – Default = ‘LI’. For use with normalize_density. Equation to be used for normalization. Options are ‘LI’ for the Lichtenecker equation and ‘LLL’ for the Landau-Lifshitz-Looyenga equation. LI used alpha = 1.92 (Olhoeft, 1985) and LLL uses alpha = 0.307 (Hickson et al., 2017, Lunar samples).
  • name (str, optional) – Name of measurement to be used in plots.
  • bulk_density (float, optional) – Bulk density of material.
  • solid_dielec (float, optional) – The solid dielectric constant of the material.
  • solid_losstan (float, optional) – The solid loss tangent of the material.
  • particle_diameter (float, optional) – The average particle diameter in the airline in cm.
  • particle_density (float, optional) – The average (solid) particle density of the material in g/cm^3.
  • temperature (str or float, optional) – Temperature of measurement.
  • date (str, optional) – Date measurement was made.
  • freq_cutoff (float, optional) – Default: 1e8. Starting frequency for forward and reverse difference calculations.
  • freq (array) – Frequency points.
  • s21, s12, s22 (s11,) – Mag and Phase S-Parameters.
  • forward_dielec, reverse_dielec (avg_dielec,) – Real part of the permittivity. Can be avg_dielec, forward_dielec, or reverse_dielec for average, forward (S11,S21), or reverse (S22,S12) permittivity.
  • forward_lossfac, reverse_lossfac (avg_lossfac,) – Imaginary part of the permittivity. Same as above.
  • forward_losstan, reverse_losstan (avg_losstan,) – Loss tangent. Same as above.
  • forward_mu_real, reverse_mu_real (avg_mu_real,) – Real part of the magnetic permeability. Same as above.
  • forward_mu_imag, reverse_mu_imag (avg_mu_imag,) – Imaginary part of the magnetic permeability. Same as above.
  • corr – De-embeded version of S-parameters or electromagnetic data. Only average S-parameters are used for EM calculations with corrected S-parameters. Examples: corr_s11, corr_avg_losstan, corr_avg_mu_real. Only created if corr = True.
  • norm (array) – Bulk density normalized permittivity data. Uses averaged permittivity data. Only created if normalize_density = True.
  • res_freq (array) – Resonant frequencies in the sample.
  • airline_dimensions (dict) – Dimensions of the airline in cm. D1 is the diameter of the inner conductor and D4 is the diameter of the outer conductor. D2 and D3 bound the sample-airline boundary regions if particle_diameter is provided. airline_dimensions is generated automatically for airlines VAL, PAL, and GAL. Empty otherwise.
  • bcorr (complex array) – Avg complex permittivity corrected for boundary effects. Computed automatically if solid_dielec, particle_diameter, particle_density, and bulk_density are present. solid_losstan is optional.
  • imag_part_diff_array (real_part_diff_array,) – Absolute difference of forward and reverse results for the real and imaginary parts of the permittivity.
  • max_imag_diff, min_real_diff, min_imag_diff (max_real_diff,) – Maximum and minimum differences of the forward and reverse results for the real and imaginary parts of the permittivity.
_absdiff()[source]

Calculate the absolute max and median differences in calculated forward (S11,S21) and reverse (S22,S12) permittivity. Use corrected S-parameters if present.

_air_gap_correction(D2, D3)[source]

Calculates air gap corrected complex permittivity for solid samples.

Follows Baker-Jarvis et al., 1993 and Rhode & Schwarz Application Note RAC0607-0019_1_4E

Parameters:
  • Ds2 (float) – The inner diameter (cm) of the solid toroid sample to be specified by user
  • Ds3 (float T) – The outer diameter (cm) of the solid toroid sample to be specified by user
Returns:

  • corr_dielec (array) – Corrected real part of measured permittivity
  • corr_lossfac (array) – Corrected imaginary part of measured permittivity
  • corr_losstan (array) – Corrected loss tangent

_boundary_correct()[source]

Correct calculated sprams for boundary effects in the airline after Hickson et al., 2017. Requires the effective solid permittivity of the material, the average particle size in the airline, and the average particle (solid) density to be supplied to the class instance. Uses the Looyenga mixing model to calculate the permittivity in the boundary region.

As of now, produces dubious results for the imaginary part.

_calc_uncertainties(s_param, nrows, sign, x, s_reflect, s_trans, gam, lam_og, new_t, mu_eff, ep_eff, lam_0, dielec, lossfac, losstan, corr)[source]

Calculates permittivity uncertainties from Boughriet et al.

Returns:
  • delta_dielec (array) – Uncertainty in real part.
  • delta_lossfac (array) – Uncertainty in imaginary part.
_calc_uncertainties_NRW(s_param, nrows, sign, x, s_reflect, s_trans, gam, lam_og, new_t, complex_mu, ep_r, lam_0, dielec, lossfac, losstan, corr)[source]

Calculates nrw uncertainties from Baker-Jarvis et al. (1993). Transmission/reflection and short-circuit line methods for measuring permittivity and permeability. NIST Technical Note 1355-R. Boulder, CO: National Institute of Standards and Technology. http://doi.org/10.6028/NIST.TN.1355r

Returns:
  • delta_dielec (array) – Uncertainty in real part.
  • delta_lossfac (array) – Uncertainty in imaginary part.
  • delta_mu (complex array) – Uncertainty in complex permeability.
_de_embed()[source]

Perform S-parameter de-embedding to remove influence of washers on measurement.

_freq_avg()[source]

Calculate an average dielectric constant and loss tangent across all measured frequencies from midpoint frequency values between resonant frequencies as described in Hickson et al., 2018

Returns:
  • freq_avg_dielec (uncertainties.core.AffineScalarFunc) – Average dielectric constant calculated from midpoint frequency values between resonant frequencies. Skips first two values due to large uncertainty.
  • freq_avg_dielec_std (float) – Standard deviation of freq_avg_dielec from above.
  • freq_avg_losstan (uncertainties.core.AffineScalarFunc) – Average loss tangent calculated from midpoint frequency values between resonant frequencies. Skips first two values due to large uncertainty.
  • freq_avg_losstan_std (float) – Standard deviation of freq_avg_losstan from above.
_permittivity_calc(s_param, corr=False)[source]

Return the complex permittivity and loss tangent from S-parameters and their uncertainties (if present).

Uses the New Non-iterative method described in Boughriet, A.H., Legrand, C. & Chapoton, A., 1997. Noniterative stable transmission/reflection method for low-loss material complex permittivity determination. IEEE Transactions on Microwave Theory and Techniques, 45(1), pp.52–57.

Assumes the magnetic permeability of the sample = 1 (i.e non-magnetic).

Parameters:s_param (str) – Calculates complex permittivity using either the forward (‘f’) (S11,S21), or the reverse (‘r’) (S22 S12) S-Parameters.
Returns:
  • f_0 (array) – Array of measured frequency values.
  • dielec (array) – Real part of the complex relative permittivity.
  • lossfac (array) – Imaginary part of the complex permittivity.
  • losstan (array) – Loss tangent. Defined as the ratio of the imaginary and the real part of the complex permittivity.
_resonant_freq()[source]

Calculate and return array of resonant frequencies from complex permittivity and/or permeability measurement.

Follows David Stillman PhD Thesis

difference_plot()[source]

Plot the absolute difference between both ε′ and ε′′ calculated from forward (S11,S21) and reverse (S22,S12) S-Paramaters.

draw_plots(default_settings=True, publish=False, log_y_axis=False, xticks=None, yticks=None, corr=False, normalized=False, **kwargs)[source]

Plots permittivity data using make_plot from permittivity_plot.

If freq_cutoff exists, all frequency points lower than freq_cutoff will not be plotted.

Parameters:
  • default_settings (bool) – Default: True. If True, plots average real part of the permittivity, imaginary part of the permittivity and loss tangent. If corrected or normalized data exist, it will be used in the plot. If False prompts user to determine whether to plot, Average, Forward, Reverse, or All results.
  • publish (bool) – Default: False. If True, save figures.
  • log_y_axis (bool) – Default: False. If True, plot log y-axis. yticks must be provided if True.
  • xticks (list, optional) – Use to manually set y-axis tick make locations. Must be a list containing tick mark locations.
  • yticks (list of lists, optional) – Use to manually set y-axis tick make locations. Must be a list of lists containing tick mark locations for each individual plot in the following order: real part, imaginary part, loss tangent. If nrw=True, must additionaly provide: real part of mu, imaginary part of mu. Required if log_y_axis=True.
  • corr (bool, optional) – Can be used when default_settings is False. Can be used with any of the plot types. If True, use corrected sparam data, otheriwse use uncorrected data.
  • normalized (bool, optional) – Can be used when default_settings is False. Can only be used with Average plots. If True, use normalized permittivity data. Supersedes corr if True.
s_param_plot(corr=False)[source]

Plot raw S-Parameter data using make_sparam_plot from permittivity_plot

get_METAS_data

permittivitycalc.get_METAS_data(airline=None, file_path=None)[source]

Return data arrays from METAS VNA Tools II text file based on user input Frequencies must be in Hz. Recomeneded precision in VNA Tools II is f9.

Returns the first four arguments required by the AirlineData class.

Parameters:
  • airline (str) – Airline used for measurement. Options are: ‘VAL’, ‘PAL’, ‘GAL’, ‘7’. If not provided, will prompt user. Prompt will allow user to input a custom airline length.
  • file_path (str) – If a path is not given, will prompt user for file. Default: None
Returns:

  • L (float) – Length of airline in cm.
  • airline (str) – Name of the airline used.
  • dataArray (array) – S-parameters and their uncertainties (if present).
  • file (str) – File path.

run_default

permittivitycalc.run_default(airline_name='VAL', file_path=None, **kwargs)[source]

Run AirlineData on get_METAS_data with all the prompts and return the instance. Optional AirlineData kwargs can be provided (Example: shorted=True).

multiple_meas

permittivitycalc.multiple_meas(file_path=None, airline_name=None)[source]

Generate an instance of AirlineData for every file in a directory. Store the intances in a list, and plot them all using perm_compare.

Parameters:
  • file_path (str, optional) – Full path of any file in the source directory. Will produce file dialog box if not provided.
  • airlne (str, optional) – Name of airline used. Every measurement must have been made in the same airline. Will prompt if not provided.
Returns:

class_list – List of generated class instances of AirlineData.

Return type:

lst

perm_compare

permittivitycalc.perm_compare(classlist, allplots=False, **kwargs)[source]

Given a list of AirlineData instances, plot their permittivity results together using permittivity_plot. Fot each item in the list, will plot the first available data type out of: normalized data, corrected (de-embeded) data, uncorrected data.

Will use the smallest freq_cutoff value in the list (if avaialbe) for plotting.

Can provide permittivity_plot.make_plot kwargs.

Parameters:
  • classlist – List of instances of AirlineData.
  • allplots (bool) – Default: False. If True plot all of real and imaginary parts of the permittivity and the loss tangent. If Flase plot only the real part and the loss tangent.