Visualization Functions#
These functions are for visualization the optical system, and nominally saving it as a image file.
- skZemax.skZemax_subfunctions._visualization_functions.Visualization_NSC_3DViewer(self, save_image: bool = True, saved_image_location: str = '3DView.png', output_pixel_width: int = 3840, output_pixel_height: int = 2160, ray_trace_options: str = 'UseRays', color_rays_by_NSC_options: str = 'SourceNumber', camera_viewpoint_angle_X: float = -30.0, camera_viewpoint_angle_Y: float = 35.0, camera_viewpoint_angle_Z: float = 45.0, configuration_offset_X: float = 0.0, configuration_offset_Y: float = 0.0, configuration_offset_Z: float = 0.0, surface_line_thickness: str = 'Thickest', rays_line_thickness: str = 'Thickest')[source]#
Make and save a 3D View of the system (https://community.zemax.com/zos-api-12/api-layout-plot-python-4731). This function is meant for non-sequential systems.
- Parameters:
save_image (bool, optional) – Sets saving the image as a file, defaults to True
saved_image_location (str, optional) – location to where the image will be saved, defaults to ‘3DView.png’
output_pixel_width (int, optional) – Width of the image in pixels, defaults to 3840
output_pixel_height (int, optional) – Height of the image in pixels, defaults to 2160
ray_trace_options (str, optional) – Ray trace rendering setting. Options are: ‘UseRays’ , ‘LightningTraceAvgWavelength’, and ‘LightningTraceTrueColor’, defaults to ‘UseRays’
color_rays_by_NSC_options (str, optional) – Ray coloring scheme (for non-sequential mode). Options are: ‘SourceNumber’ , ‘WaveNumber’,’ConfigNumber’,’Wavelength’,’SegmentNumber’, defaults to ‘SourceNumber’
camera_viewpoint_angle_X (float, optional) – X angle of the imaged viewpoint perspective, defaults to -30.0
camera_viewpoint_angle_Y (float, optional) – Y angle of the imaged viewpoint perspective, defaults to 35.0
camera_viewpoint_angle_Z (float, optional) – Z angle of the imaged viewpoint perspective, defaults to 45.0
configuration_offset_X (float, optional) – X offset of the image, defaults to 0.0
configuration_offset_Y (float, optional) – Y offset of the image, defaults to 0.0
configuration_offset_Z (float, optional) – Z offset of the image, defaults to 0.0
surface_line_thickness (str, optional) – Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’
are (rays_line_thickness:Thickness to apply to ray lines. Options) – “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’
- skZemax.skZemax_subfunctions._visualization_functions.Visualization_NSC_ShadedModel(self, save_image: bool = True, saved_image_location: str = 'ShadedModel.png', output_pixel_width: int = 3840, output_pixel_height: int = 2160, ray_trace_options: str = 'UseRays', color_rays_by_NSC_options: str = 'SourceNumber', detector_pixel_color_mode: str = 'DoNotColorIndividualPoints', camera_viewpoint_angle_X: float = -30.0, camera_viewpoint_angle_Y: float = 35.0, camera_viewpoint_angle_Z: float = 45.0, configuration_offset_X: float = 0.0, configuration_offset_Y: float = 0.0, configuration_offset_Z: float = 0.0, surface_line_thickness: str = 'Thickest', rays_line_thickness: str = 'Thickest', background: str = 'White', brightness: str = '50', opacity: str = '50', detector_display_mode: str = 'Consider')[source]#
Make and save a 3D shaded model of the system (https://community.zemax.com/zos-api-12/api-layout-plot-python-4731). This function is meant for non-sequential systems.
- Parameters:
save_image (bool, optional) – Sets saving the image as a file, defaults to True
saved_image_location (str, optional) – location to where the image will be saved, defaults to’ShadedModel.png’
output_pixel_width (int, optional) – Width of the image in pixels, defaults to 3840
output_pixel_height (int, optional) – Height of the image in pixels, defaults to 2160
ray_trace_options (str, optional) – Ray trace rendering setting. Options are: ‘UseRays’ , ‘LightningTraceAvgWavelength’, and ‘LightningTraceTrueColor’, defaults to ‘UseRays’
color_rays_by_NSC_options (str, optional) – Ray coloring scheme (for non-sequential mode). Options are: ‘SourceNumber’ , ‘WaveNumber’,’ConfigNumber’,’Wavelength’,’SegmentNumber’, defaults to ‘SourceNumber’
detector_pixel_color_mode (str, optional) – Pixel color setting. Options are: ‘DoNotColorIndividualPoints’ , ‘ByRaysOnLayout’,’ByLastAnalysis’, defaults to ‘DoNotColorIndividualPoints’
camera_viewpoint_angle_X (float, optional) – X angle of the imaged viewpoint perspective, defaults to -30.0
camera_viewpoint_angle_Y (float, optional) – Y angle of the imaged viewpoint perspective, defaults to 35.0
camera_viewpoint_angle_Z (float, optional) – Z angle of the imaged viewpoint perspective, defaults to 45.0
configuration_offset_X (float, optional) – X offset of the image, defaults to 0.0
configuration_offset_Y (float, optional) – Y offset of the image, defaults to 0.0
configuration_offset_Z (float, optional) – Z offset of the image, defaults to 0.0
surface_line_thickness (str, optional) – Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’
rays_line_thickness (str, optional) – Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’
background (str, optional) – Background color of the render. Options are “White”, “Black”, “Red”, “Green”, “Blue”, “DarkGreen”, “DarkBlue”, “Color##” (where ## = 01 - 24), and “Gradient##” (where ## = 01-10), defaults to ‘White’
brightness (str, optional) – Brightness of the render. A percentage given as a string in steps of 10, defaults to ‘50’
opacity (str, optional) – Opacity of the render. Options are: ‘Ignore’, ‘Consider’, ‘All50Percent’, defaults to ‘All50Percent’
detector_display_mode (str, optional) – Detector display mode. Options are: ‘Consider ‘, ‘GreyScaleFlux’, ‘InverseGreyScaleFlux’, ‘FalseColorFlux’, ‘InverseFalseColorFlux’, ‘GreyScaleIrradiance’, ‘InverseGreyScaleIrradiance’, ‘FalseColorIrradiance’, ‘InverseFalseColorIrradiance’, defaults to ‘Consider’
- skZemax.skZemax_subfunctions._visualization_functions.Visualization_SEQ_2DCrossSection(self, start_surface_index: int = 1, end_surface_index: int = -1, wavelength_index: int = -1, field_index: int = -1, number_of_rays: int = 7, save_image: bool = True, saved_image_location: str = '2DCrossSection.png', output_pixel_width: int = 3840, output_pixel_height: int = 2160, surface_line_thickness: str = 'Thickest', ray_line_thickness: str = 'Thickest', fletch_rays: bool = False, color_rays_by: str = 'Field', marginal_and_chief_ray_only: bool = False, delete_vignetted: bool = False, y_stretch: float = 1.0, configuration: int = 1)[source]#
Make and save an image of the 2D cross section of the system (see https://community.zemax.com/zos-api-12/api-layout-plot-python-4731). This function is meant for sequential systems.
- Parameters:
start_surface_index (int, optional) – Starting surface of the export, defaults to 1
end_surface_index (int, optional) – Ending surface of the export, defaults to -1
wavelength_index (int, optional) – The wavelength index to use. If set to -1, all wavelengths will be displayed, defaults to -1
field_index (int, optional) – The field index to use. If set to -1, all fields will be displayed, defaults to -1
number_of_rays (int, optional) – Number of rays to render, defaults to 7
save_image (bool, optional) – Sets saving the image as a file, defaults to True
saved_image_location (str, optional) – location to where the image will be saved, defaults to ‘2DCrossSection.png’
output_pixel_width (int, optional) – Width of the image in pixels, defaults to 3840
output_pixel_height (int, optional) – Height of the image in pixels, defaults to 2160
surface_line_thickness (str, optional) – Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’
ray_line_thickness (str, optional) – Thickness to apply to ray lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’, defaults to ‘Thickest’
fletch_rays (bool, optional) – If rays are fletched, defaults to False
color_rays_by (str, optional) – Scheme by which rays are colored. Options are: “Fields”, “Waves”, and “Wavelengths”, defaults to ‘Field’
marginal_and_chief_ray_only (bool, optional) – Only include marginal and chief rays, defaults to False
delete_vignetted (bool, optional) – Rays which are vignetted are not rendered, defaults to False
y_stretch (float, optional) – Stretching to apply along Y, defaults to 1.0
configuration (int, optional) – Configurations to render, defaults to 1
- skZemax.skZemax_subfunctions._visualization_functions.Visualization_SEQ_3DViewer(self, start_surface_index: int = 1, end_surface_index: int = -1, wavelength_index: int = -1, field_index: int = -1, number_of_rays: int = 7, save_image: bool = True, saved_image_location: str = '3DView.png', output_pixel_width: int = 3840, output_pixel_height: int = 2160, surface_line_thickness: str = 'Thickest', ray_line_thickness: str = 'Thickest', fletch_rays: bool = False, delete_vignetted: bool = False, color_rays_by: str = 'Field', ray_pattern_type: str = 'XYFan', hide_lens_faces: bool = False, hide_lens_edges: bool = False, draw_paraxial_pupils: bool = False, camera_viewpoint_angle_X: float = -30.0, camera_viewpoint_angle_Y: float = 35.0, camera_viewpoint_angle_Z: float = 45.0, configuration_offset_X: float = 0.0, configuration_offset_Y: float = 0.0, configuration_offset_Z: float = 0.0, draw_real_entrance_pupils: str = 'Off', draw_real_exit_pupils: str = 'Off')[source]#
Make and save an image of the system in 3d (see https://community.zemax.com/zos-api-12/api-layout-plot-python-4731). This function is meant for sequential systems.
- Parameters:
start_surface_index (int, optional) – Starting surface of the export, defaults to 1
:param end_surface_index:Ending surface of the export, defaults to -1 :type end_surface_index: int, optional :param wavelength_index: he wavelength index to use. If set to -1, all wavelengths will be displayed, defaults to -1 :type wavelength_index: int, optional :param field_index: The field index to use. If set to -1, all fields will be displayed, defaults to -1 :type field_index: int, optional :param number_of_rays: Number of rays to render, defaults to 7 :type number_of_rays: int, optional :param save_image: Sets saving the image as a file, defaults to True :type save_image: bool, optional :param saved_image_location: location to where the image will be saved, defaults to ‘3DView.png’ :type saved_image_location: str, optional :param output_pixel_width: Width of the image in pixels, defaults to 3840 :type output_pixel_width: int, optional :param output_pixel_height: Height of the image in pixels, defaults to 2160 :type output_pixel_height: int, optional :param surface_line_thickness: Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’ :type surface_line_thickness: str, optional :param ray_line_thickness: Thickness to apply to ray lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’, defaults to ‘Thickest’ :type ray_line_thickness: str, optional :param fletch_rays: If rays are fletched, defaults to False :type fletch_rays: bool, optional :param delete_vignetted: Rays which are vignetted are not rendered, defaults to False :type delete_vignetted: bool, optional :param color_rays_by: Scheme by which rays are colored. Options are: “Fields”, “Waves”, and “Wavelengths”, defaults to ‘Field’ :type color_rays_by: str, optional :param ray_pattern_type: Ray pattern type. Options are: ‘XYFan’, ‘XFan’, ‘YFan’, ‘Ring’, ‘List’, ‘Random’, ‘Grid’, defaults to ‘XYFan’ :type ray_pattern_type: str, optional :param hide_lens_faces: If true will hide the faces of lens, defaults to False :type hide_lens_faces: bool, optional :param hide_lens_edges: If true will hide the edges of lens, defaults to False :type hide_lens_edges: bool, optional :param draw_paraxial_pupils: If true will draw paraxial pupils , defaults to False :type draw_paraxial_pupils: bool, optional :param camera_viewpoint_angle_X: X angle of the imaged viewpoint perspective, defaults to -30.0 :type camera_viewpoint_angle_X: float, optional :param camera_viewpoint_angle_Y: Y angle of the imaged viewpoint perspective, defaults to 35.0 :type camera_viewpoint_angle_Y: float, optional :param camera_viewpoint_angle_Z: Z angle of the imaged viewpoint perspective, defaults to 45.0 :type camera_viewpoint_angle_Z: float, optional :param configuration_offset_X: X offset of the image, defaults to 0.0 :type configuration_offset_X: float, optional :param configuration_offset_Y: Y offset of the image, defaults to 0.0 :type configuration_offset_Y: float, optional :param configuration_offset_Z: Z offset of the image, defaults to 0.0 :type configuration_offset_Z: float, optional :param draw_real_entrance_pupils: How to draw real entrance pupil. Options are: ‘Off’, ‘4’,’8’,’16’,’32’, defaults to ‘Off’ :type draw_real_entrance_pupils: str, optional :param draw_real_exit_pupils: How to draw real exit pupil. Options are: ‘Off’, ‘4’,’8’,’16’,’32’, defaults to ‘Off’ :type draw_real_exit_pupils: str, optional
- skZemax.skZemax_subfunctions._visualization_functions.Visualization_SEQ_ShadedModel(self, start_surface_index: int = 1, end_surface_index: int = -1, wavelength_index: int = -1, field_index: int = -1, number_of_rays: int = 7, save_image: bool = True, saved_image_location: str = 'ShadedModel.png', output_pixel_width: int = 3840, output_pixel_height: int = 2160, ray_line_thickness: str = 'Thickest', fletch_rays: bool = False, delete_vignetted: bool = False, color_rays_by: str = 'Field', ray_pattern_type: str = 'XYFan', camera_viewpoint_angle_X: float = -30.0, camera_viewpoint_angle_Y: float = 35.0, camera_viewpoint_angle_Z: float = 45.0, configuration_offset_X: float = 0.0, configuration_offset_Y: float = 0.0, configuration_offset_Z: float = 0.0, opacity: str = 'All50Percent', background: str = 'White', draw_section: str = 'P100', angular_segments: str = '128', radial_segments: str = '128', brightness: str = '50')[source]#
Make and save a Shaded model of the system see https://community.zemax.com/zos-api-12/api-layout-plot-python-4731
:param start_surface_index:Starting surface of the export, defaults to 1 :type start_surface_index: int, optional :param end_surface_index: Ending surface of the export, defaults to -1 :type end_surface_index: int, optional :param wavelength_index: The wavelength index to use. If set to -1, all wavelengths will be displayed, defaults to -1 :type wavelength_index: int, optional :param field_index: The field index to use. If set to -1, all fields will be displayed, defaults to -1 :type field_index: int, optional :param number_of_rays: Number of rays to render, defaults to 7 :type number_of_rays: int, optional :param save_image: Sets saving the image as a file, defaults to True :type save_image: bool, optional :param saved_image_location: location to where the image will be saved, defaults to ‘ShadedModel.png’ :type saved_image_location: str, optional :param output_pixel_width: Width of the image in pixels, defaults to 3840 :type output_pixel_width: int, optional :param output_pixel_height: Height of the image in pixels, defaults to 2160 :type output_pixel_height: int, optional :param ray_line_thickness: Thickness to apply to surface lines. Options are: “Thinnest”, “Thin”, “Standard”, “Thick”, and “Thickest”, defaults to ‘Thickest’ :type ray_line_thickness: str, optional :param fletch_rays: If rays are fletched, defaults to False :type fletch_rays: bool, optional :param delete_vignetted: Rays which are vignetted are not rendered, defaults to False :type delete_vignetted: bool, optional :param color_rays_by: Scheme by which rays are colored. Options are: “Fields”, “Waves”, and “Wavelengths”, defaults to ‘Field’ :type color_rays_by: str, optional :param ray_pattern_type: Ray pattern to render. Options are: ‘XYFan’, ‘XFan’, ‘YFan’, ‘Ring’, ‘List’, ‘Random’, ‘Grid’, defaults to ‘XYFan’ :type ray_pattern_type: str, optional :param camera_viewpoint_angle_X: X angle of the imaged viewpoint perspective, defaults to 30.0 :type camera_viewpoint_angle_X: float, optional :param camera_viewpoint_angle_Y: Y angle of the imaged viewpoint perspective, defaults to 35.0 :type camera_viewpoint_angle_Y: float, optional :param camera_viewpoint_angle_Z: Z angle of the imaged viewpoint perspective, defaults to 45.0 :type camera_viewpoint_angle_Z: float, optional :param configuration_offset_X: X offset of the image, defaults to 0.0 :type configuration_offset_X: float, optional :param configuration_offset_Y: Y offset of the image, defaults to 0.0 :type configuration_offset_Y: float, optional :param configuration_offset_Z: Z offset of the image, defaults to 0.0 :type configuration_offset_Z: float, optional :param opacity: Opacity of the render. Options are: ‘Ignore’, ‘Consider’, ‘All50Percent’, defaults to ‘All50Percent’ :type opacity: str, optional :param background: Background color of the render. Options are “White”, “Black”, “Red”, “Green”, “Blue”, “DarkGreen”, “DarkBlue”, “Color##” (where ## = 01 - 24), and “Gradient##” (where ## = 01-10), defaults to ‘White’ :type background: str, optional :param draw_section: Draw section option. options are: ‘P100’, ‘P75’, ‘P50’, and ‘P25’, , defaults to ‘P100’ :type draw_section: str, optional :param angular_segments: Number of angular segments. Options are: ‘8’, ‘16’, ‘32’, ‘64’, ‘128’, defaults to ‘128’ :type angular_segments: str, optional :param radial_segments: Number of radial segments. Options are: ‘8’, ‘16’, ‘32’, ‘64’, ‘128’, defaults to ‘128’ :type radial_segments: str, optional :param brightness: Brightness of the render. A percentage given as a string in steps of 10, defaults to ‘50’ :type brightness: str, optional