edmundsj / rcwa

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

Add ability to specify units #51

Open edmundsj opened 1 year ago

edmundsj commented 1 year ago

Currently, the default units for internal databases are microns. If these materials are not used, the units of length can be chosen to be anything (meters, nanometers, flargons), as Maxwell's Equations are length-invariant. However, some users may prefer to explicitly specify units for their simulation. This would allow materials dispersion to be specified in terms of the user's preferred units, and would make plots easier to interpret

Proposed Implementation

solver = Solver(stack, source, units='nm')

This would require some slight refactoring of materials lookup, but would allow future-proofing to work with materials databases outside the optical range.