This repository fit the refractive index of substrate and thickness and refractive index of a single layer coating Method based on the Particle swarm optimization(PSO) through the reference of transmittance of substrates and single layer coatings. The Cauchy formula is used in the refractive index model. single_layer_fitting.py is the main function psomain.py is the main function of PSO meritFunc.py calculates the merit function of PSO main.py calculates the transmittance of substrates and single layer coatings substrate.csv and singleLayer.csv are the transmission spectrums data of substrate and single layer coating