edmundsj / rcwa

Rigorous Coupled Wave Analysis for the calculation of Photonic Crystal R/T spectra
MIT License
93 stars 29 forks source link

n/k interpolation gives staircase-like plots #19

Closed edmundsj closed 3 years ago

edmundsj commented 3 years ago

For some reason, when interpolating the refractive index from an n/k table, the plots of reflection spectra do not look interpolated at all:

si_dispersive_issue

This uses Schinke's Si data and plots every 1nm, but the data only exists in increments of 10nm. This does not happen when the data source has more finely-spaced points, but suggests an issue with how we are interpolating the data.

edmundsj commented 3 years ago

The discontinuities are, in fact, due to the interpolation function. It appears to be occuring about halfway between actual data points (for data points located at 0.49 and 0.50, the discontinuity happens from 0.495 to 0.496 with a chosen spacing of 1nm). However, these aren't currently being caught by the test suite, which does test for this. Very strange.