This project shows how the colours exhibited by illuminated soap films can be found by applying an interference relation derived for monochromatic waves at a discrete number of wavelengths in the light source. Coherence effects on the interference colours of soap films discusses this method and its expected range of validity. All variables and equations implemented in src/interference.py
are detailed in Coherence effects on the interference colours of soap films.
The examples in src
may be run using python
with a conda environment created from conda-env.yml
:
conda env create -f conda-env.yml
All tests
can be checked by running pytest
from the command line.
src/example_blackbody.py
shows how soap film interference colours may be calculated when the light source is a blackbody radiator of specified temperature. This calculation considers an infinite number of interfering waves. A fully vectorised implementation is provided in addition to a non-vectorised implementation. The non-vectorised method is more explicit, whilst the vectorised approach is significantly faster. The scaled spectral distribution of the light source and the resulting interference colours are shown for blackbodies of temperatures 3500 K, 6500 K and 9500 K:
Source | Colour-thickness |
---|---|
3500 K | 3500 K |
6500 K | 6500 K |
9500 K | 9500 K |
src/example_daylight.py
presents how the interference colours of a soap film may be calculated when the soap film is illuminated by daylight. This was done by using the D65 illuminant to represent daylight. Here, the coloured fringes are more widely spaced apart due to the larger value used for theta_air
:
Source | Colour-thickness |
---|---|
src/example_gaussian.py
shows how the interference colours of a soap film may be calculated when the spectral distribution of the light source (source_sd
) is specified by defining the numpy array through a calculation. The following shows the interference colours calculated when the light source has a Gaussian or double Gaussian spectral distribution:
Source | Colour-thickness |
---|---|
|
|
|
|
|
|
|
|
|
|
An adapted version of this code was used in The stability of magnetic soap films and Coherence effects on the interference colours of soap films.
This code is distributed under the MIT License.