Skip to main content

Zemax OpticStudio ZOS-API 2026 R1

Example 25: Source Spectrum Diffraction Grating

Last update: 09.03.2026

Ex 25: A non-sequential system with two black body sources of different temperatures and a diffraction grating is built. The system is setup with multi-configuration to control the number of analysis rays traced for each source. Only a single source has analysis rays during a ray trace. The true color results are plotted for each configuration.

Input: 		None

Output: 	Graph (Matlab, Python)
            API\e25_source_spectrum_diffraction_grating.zos
            API\e25_source_spectrum_diffraction_grating_1.txt (C++, C#)
            API\e25_source_spectrum_diffraction_grating_2.txt (C++, C#)

C#

C++

Matlab

Python

Connect with Ansys