tidy3d.fit.DispersionFit

class tidy3d.fit.DispersionFit(wavelengths, n_data, k_data=None)
__init__(wavelengths, n_data, k_data=None)

Creates a DispersionFit object from measured lambda, n, k data.

Parameters
  • wavelengths (array-like) – (micron) wavelengths of data.

  • n_data (array-like) – Real part of the refractive index at wavelengths.

  • k_data (array-like, optional) – Imaginary part of the refractive index at wavelengths (positive = lossy).

Methods

__init__(wavelengths, n_data[, k_data])

Creates a DispersionFit object from measured lambda, n, k data.

as_medium([name])

Returns a Medium representation of the fit, which can be used directly in a simulation.

fit([num_poles, num_tries, tolerance_rms, …])

Fits data a number of times and returns best results.

fit_single([num_poles, globalopt, bound])

Perform a single fit to the data and return optimization result.

model(wavelengths[, coeffs])

Returns the nk data at a set of wavelengths; if coeffs is not supplied, they are taken from last fit.

plot([wavelengths, ax, dot_sizes, …])

Make plot of model vs data, at a set of wavelengths (if supplied).

print_medium([name])

Prints a string representation of the fit so it can be copied and pasted into script.

save_poles([fname])

Saves poles as a txt file containing (num_poles, 2) array.