Ray Aiming Functions#
The functions within this category are related Zemax ray aiming methods and properties.
- skZemax.skZemax_subfunctions._rayaiming_functions.RayAiming_GetNamesOfAllAimingMethods(self, print_to_console: bool = False) list[source]#
This function builds a list of all the ray aiming methods that Zemax is aware of. This can be useful to look up what one may want to code as input to functions like
RayAiming_SetAimingMethod().- Parameters:
print_to_console (bool, optional) – If True will print to console, defaults to False
- Returns:
A list of the names of all ray aiming methods the ZOS-API knows.
- Return type:
list
- skZemax.skZemax_subfunctions._rayaiming_functions.RayAiming_GetNamesOfAllAimingProperties(self, print_to_console: bool = False) list[source]#
This function builds a list of all the ray aiming properties that Zemax is aware of. This can be useful to look up what one may want to code as input to functions like
RayAiming_SetAimingProperty().- Parameters:
print_to_console (bool, optional) – If True will print to console, defaults to False
- Returns:
A list of the names of all ray aiming properties the ZOS-API knows.
- Return type:
list
- skZemax.skZemax_subfunctions._rayaiming_functions.RayAiming_SetAimingMethod(self, method: str = 'Off')[source]#
Special property of the Ray Aiming properties. This one sets the Ray Aiming mode itself. Options are: - “Off”: If ray aiming is off, Zemax will use the paraxial entrance pupil size and location determined by the aperture settings and calculated at the primary wavelength on axis for launching rays from the object surface. - “Paraxial”: Paraxial rays are well behaved and paraxial definitions are commonly used for most first-order system properties. - “Real”: For real rays to have the object space properties defined by the system aperture, use real rays instead of paraxial rays to determine the stop radius.
See 2.1.1.7. Ray Aiming in the Zemax pdf help document for more detail
- Parameters:
method (str, optional) – Ray aiming method to use (see options above and/or
RayAiming_GetNamesOfAllAimingMethods()), defaults to ‘Off’
- skZemax.skZemax_subfunctions._rayaiming_functions.RayAiming_SetAimingProperty(self, aiming_property: str = 'UseRayAimingCache', aiming_value: float | int | bool = True)[source]#
Sets a property of the Ray Aiming system. There is a soft assumption that the correct method is already set for what you want to do. See
RayAiming_SetAimingMethod()for setting the method.- Properties are:
“UseRayAimingCache”: If True, Zemax caches ray aiming coordinates so that new ray traces take advantage of previous iterations of the ray tracing algorithm
“UseRobustRayAiming”: If True, Zemax uses a more reliable, but slower algorithm for aiming rays.
“ScalePupilShiftFactorsByField”: If True, the x and y pupil shift values are also scaled with field, otherwise, the x and y shift values are used for all fields without any scaling. All shifts are in lens units.
“AutomaticallyCalculatePupilShiftsIsChecked”: When True, OpticStudio will automatically calculate the difference in location between the real and paraxial entrance pupils in order to determine the value for the pupil shift factors
“PupilShiftX”: Rough guess in X as to how much the pupil has been shifted and compressed with respect to the paraxial pupil
“PupilShiftY”: Rough guess in Y as to how much the pupil has been shifted and compressed with respect to the paraxial pupil
“PupilShiftZ”: Rough guess in Z as to how much the pupil has been shifted and compressed with respect to the paraxial pupil
“PupilCompressX”: The X compress value is used to change the relative coordinates on the paraxial entrance pupil to start the iteration. A value of zero means no compress, while a value of 0.1 indicates the pupil is compressed 10 percent
“PupilCompressY”: The Y compress value is used to change the relative coordinates on the paraxial entrance pupil to start the iteration. A value of zero means no compress, while a value of 0.1 indicates the pupil is compressed 10 percent
“UseEnhancedRayAiming”: If selected, the Enhanced Ray Aiming algorithm is used. See 2.1.1.7. Ray Aiming in the Zemax pdf help document for more detail.
“UseFallBackSearchDuringCacheSetup”: This option can be used to improve the Enhanced Ray Aiming for certain off axis or aspherical systems where the Enhanced Ray Algorithm performs less well. Recommended to leave this option False unless there are problems in ray aiming.
“UseAdvancedConvergence”: This option can be used to improve the Enhanced Ray Aiming algorithm for systems substantial rotations around the z-axis although it may improve ray tracing in other types of systems
“NumStepsCacheSetup”: Choose the number of steps used during the Cache Setup for Enhanced Ray Aiming. Recommended value of 10. Higher number of steps can improve stability but will reduce speed of the ray aiming calculations
See 2.1.1.7. Ray Aiming in the Zemax pdf help document for more detail
- Parameters:
aimingProperty (str, optional) – Property of the ray aiming method to set, defaults to “UseRayAimingCache”
aimingValue (Union[float,int,bool], optional) – The value to set the aiming property to. To understand property functions and values please refer to Zemax documenting (pdf pages 150-154), defaults to True