Skip to content

Conversation

KelSolaar
Copy link
Member

Summary

This PR relates to #525 and implements the full Transfer Matrix Method (TMM), I started the work 6 years ago and finally managed to finish, thanks Claude!

Computations

The main function is colour.phenomena.matrix_transfer_tmm that computes transfer matrices for multilayer thin film structures with full vectorisation across wavelength, angle and thickness.

Then the two colour.phenomena.thin_film_tmm and colour.phenomena.multilayer_tmm functions compute thin film and multilayer reflectance / transmittance respectively.

  • colour.phenomena.snell_law
  • colour.phenomena.polarised_light_magnitude_elements
  • colour.phenomena.polarised_light_reflection_amplitude
  • colour.phenomena.polarised_light_reflection_coefficient
  • colour.phenomena.polarised_light_transmission_amplitude
  • colour.phenomena.polarised_light_transmission_coefficient
  • colour.phenomena.TransferMatrixResult
  • colour.phenomena.matrix_transfer_tmm
  • colour.phenomena.light_water_molar_refraction_Schiebener1990
  • colour.phenomena.light_water_refractive_index_Schiebener1990
  • colour.phenomena.thin_film_tmm
  • colour.phenomena.multilayer_tmm

Plotting

I also added a bunch of new plotting definitions, most notable ones being colour.plotting.plot_thin_film_iridescence, colour.plotting.plot_thin_film_reflectance_map and colour.plotting.plot_multi_layer_stack.

  • colour.plotting.plot_single_layer_thin_film
  • colour.plotting.plot_multi_layer_thin_film
  • colour.plotting.plot_thin_film_comparison
  • colour.plotting.plot_thin_film_spectrum
  • colour.plotting.plot_thin_film_iridescence
  • colour.plotting.plot_thin_film_reflectance_map
  • colour.plotting.plot_multi_layer_stack
image image

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Pyright static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • [N/A] New transformations have been added to the Automatic Colour Conversion Graph.
  • New transformations have been exported to the relevant namespaces, e.g. colour, colour.models.

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

@KelSolaar KelSolaar added this to the v0.4.7 milestone Oct 14, 2025
@coveralls
Copy link

Coverage Status

coverage: 76.927% (+0.2%) from 76.753%
when pulling bcfc437 on feature/thin_film
into e1c9110 on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants