Misc convenience functions for use in photonics.