revamp test_refl_angular.py to validate results against theory rather than hard-coded values #2017
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently,
test_refl_angular.py
involves computing the reflectance of a 1d interface for the S polarization at normal incidence and validating the results against hard-coded values. The filename is therefore a misnomer since the test does not actually involve a planewave at oblique incidence. This PR modifies this test to validate the results using the Fresnel equations for two angles of incidence (0° and 20.6°). This makes for a more rigorous and complete test.This test will eventually be expanded to include a validation of the phase of a total internal reflected mode obtained using mode decomposition via the
kz_2d
feature as described by @stevengj in #1968 (comment). (The Fresnel equations for the phase are provided in slide 20 of these notes.)Also included in this PR are small fixes/tweaks to the related Tutorial/Angular Reflectance Spectrum of a Planar Interface.