The createFit() class

Overview

This is a very narrow-use class -- all it does is compute an interactive reflectance spectrum which allows the user to move sliders to change the parameters of the calculation such that the computed spectrum visually matches a provided experimental spectrum. I wanted it to be general use, but it's hard to imagine what a general fitting test case is. In any case, one should be able to modify the source code and construct similar functions to fit whatever type of data one desires.

The fitting functions work well, but they expect a very particular file name. The experimental data files should be in a folder titled "fitting_test_cases" and this folder should be situated in the same directory as the python script that is running. Within this folder should be two directories named "s" and "p". Within each of those directories should be a directory named whatever material name that you want to fit. The data files should go in this directory. The data file names should have the format <thickness>_<angle>.csv   where <thickness> is the integer value of the material thickness in nm, and <angle> is the integer value of the AOI in degrees. You will also need a file titled au<angle>.csv   containing the single beam of your reference spectrum (probably a gold mirror, hence the file name.) The program automatically calculates external reflectivity using the single beams of the angle given, but if you already have calculated the reflectivity, simply prepend the file name with "r". For example: r25_50.csv   would indicate a reflectivity spectrum for a 25 nm thick layer of material at an AOI of 50 degrees. If you provide reflectivity data, obviously no reference single beam data is needed.

The program uses the same parameters as the file name to avoid user error. This is less general than simply giving the program a file name and path, but I found I often made errors by not calculating the same system as the system for which the experimental data is provided.

Creating a createFit() object

createFit(pol, aoi, thickness, material, spectrum, [cutoff])

Methods

Back to main page.