Wavelength Functions#

These functions configure the wavelength settings of the optical system.

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_AddWavelength(self, wavelength_micrometers: float, wavelength_weight: float = 1.0) ZOSAPI_SystemData_IWavelength[source]#

Adds a new wavelength to the system.

Parameters:
  • wavelength_micrometers (float) – The wavelength - in microns - to add to the system.

  • wavelength_weight (float, optional) – Weight to give the wavelength, defaults to 1.0

Returns:

The newly added wavelength object.

Return type:

ZOSAPI_SystemData_IWavelength

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_GetNamesOfAllPresets(self, print_to_console: bool = False) list[source]#

This function builds a list of all the the preset wavelengths configurations in Zemax. This can be useful to look up what one may want to code as input to functions like Wavelength_SelectWavelengthPreset().

Parameters:

print_to_console (bool, optional) – If True will print to console, defaults to False

Returns:

A list of the names of all preset wavelengthss in Zemax.

Return type:

list

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_GetNumberOfWavelengths(self) int[source]#

Returns number of wavelengths in the system.

Returns:

The number of wavelengths configured in the system.

Return type:

int

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_GetPrimaryWavelength(self) ZOSAPI_SystemData_IWavelength[source]#

Returns the wavelength which is the primary one in the system

Returns:

The primary wavelength object.

Return type:

ZOSAPI_SystemData_IWavelength

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_GetWavelength(self, wavelengthNum: int = 1) ZOSAPI_SystemData_IWavelength[source]#

Gets the wavelength entry at index.

Parameters:

wavelengthNum (int, optional) – Index of wavelength entry to lookup, defaults to 1

Returns:

The object associated with that wavelength.

Return type:

ZOSAPI_SystemData_IWavelength

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_RemoveWavelength(self, in_wavelength: int | ZOSAPI_SystemData_IWavelength) bool[source]#

Deletes/removes a wavelengths from the system

Parameters:

in_wavelength (Union[int, ZOSAPI_SystemData_IWavelength]) – The wavelength to remove - either an index or the wavelength object.

Returns:

True if the wavelength is valid and there were at least two wavelengths in the system, else False.

Return type:

bool

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_SelectWavelengthPreset(self, preset: str = 'd_0p587') None[source]#

Configures the system’s wavelengths to one of the named preset configurations within Zemax.

See Wavelength_GetNamesOfAllPresets() to extract the names in python.

If more than one preset could match the specified string, the first one sorted by ascending length, then alphabet, is taken.

Parameters:

preset (str, optional) – Name of the preset to use, defaults to “d_0p587”

skZemax.skZemax_subfunctions._wavelength_functions.Wavelength_SetPrimaryWavelength(self, in_wavelength: int | ZOSAPI_SystemData_IWavelength) ZOSAPI_SystemData_IWavelength[source]#

Sets the wavelength as the primary one in the system

Parameters:

in_wavelength (Union[int, ZOSAPI_SystemData_IWavelength]) – The wavelength to make primary - either an index or the wavelength object.

Returns:

The primary wavelength object.

Return type:

ZOSAPI_SystemData_IWavelength