Best practices for importing interferometer measured lens data into OpticStudio

Occasionally customers have the need to bring interferometer-measured lens data, for example lens shape measured by Zygo Interferometer, into OpticStudio to check performance impact due to manufacturing tolerances. This FAQ provides a quick introduction to how to best approach this task in 4 steps.   Data Conversion: First, when exporting data from the interferometer, one needs to pay attention to the type of data contained in the INT data file, is it an INT Grid data file or is it an INT Zernike data file? If it’s an INT Grid data file, does the grid data describe the physical sag of the lens surface in unit of length, or does it describe the surface using phase information in unit of radian? This is important because different INT Grid data will need to be imported into OpticStudio via different types of surfaces. For INT Grid file describing surface sag in length unit, one should use Grid Sag surface. For INT Grid file describing surface phase information, one should use Grid Phase surface. For INT Zernike file with phase information, one should use Zernike Fringe Phase surface, and for INT Zernike with physical sag in length unit, one should use Zernike Fringe Sag surface. Next, OpticStudio cannot directly import these INT data files so they need to be converted into a format that’s compatible with OpticStudio first. To ease the effort of data import, OpticStudio GUI offers a tool to convert interferometer INT file into OpticStudio compatible DAT file for import. These converted DAT files are in text format. One can open them using any text editor to check and make sure the converted file format appears proper. The Zernike coefficients in the converted DAT file will have the same units as the INT file. In addition, the clear semi-diameter or semi-diameter of the surface should correspond to the size of the surface or wavefront under test. If you are interested in knowing more about the INT to DAT file conversion tool, you can find it described in the manual at The File Tab > Convert Group > Convert File Formats. Data Import into OpticStudio: Start with a new surface in the Lens Data Editor and choose a proper surface type as described above. Data file converted in step 1 can now be imported using the Lens Data Editor > Surface Properties > Import function. Grid Sag or Grid Phase surface is used for importing the converted grid DAT file, and Zernike Fringe Sag or Zernike Fringe Phase surface for the converted Zernike data file.     Inspect data using Surface Sag or Surface Phase plot: For best practice, after importing the converted DAT file, we recommend checking the surface sag or phase information using the Surface Sag or Surface Phase plot listed under the Analyze tab\Surface dropdown. Phase surfaces are a special category in OpticStudio in the sense that they bend rays not through physical shape, but by adding phase or optical path length to a ray. For example, Grid Phase, Binary 2, Zernike Phase, etc., are all phase surfaces. Because these phase surfaces may be flat and only contain phase information, when viewing them in Surface Sag plot, the plot may appear empty. Instead, one needs to observe their phase pattern using Surface Phase plot. On the other hand, if you try to use Surface Phase plot to observe a “non-phase” surface, the phase plot may come up empty as well. When inspecting surface sag or phase plot, one needs to pay attention to two things. First is the visual checking. Does the pattern in False color plot roughly match what’s shown in the Interferometer measurement? Second, do the maximum and minimum sag or phase values reported in the color scale bar match the PV values reported in the interferometer? This step is very important. It helps make sure the data export and import process worked as expected and the surface information measured by the Interferometer has been properly implemented in OpticStudio. Check out results in OpticStudio: After satisfying all above checks, we are now ready to view results in OpticStudio Wavefront map. Sometimes customers ask why the shape and PV error reported in the Wavefront map do not match their expectations. If the implemented surface sag or phase information matches the interferometer results as described in step 3, then this discrepancy may have something to do with how OpticStudio calculates the Wavefront map. The Wavefront you see is the optical path length difference referenced to certain OPD reference. How OpticStudio constructs the OPD reference, spherical vs planar, at Exit Pupil vs at Image surface, will have an impact on the calculated wavefront error. If you want an “un-referenced” optical path length difference, you can adjust the Reference OPD settings in System Explorer\Advanced section. Please refer to this Support FAQ How do OPD Reference settings in System Explorer\Advanced section affect wavefront calculation? to have a better understanding of how OPD Reference settings work. If you still cannot understand the difference between OpticStudio Wavefront Map and the Interferometer measurement results, please contact Ansys Zemax Support team for further discussion. 

Relating to:Wavefront MapData Import

Why does my POP fiber coupling efficiency differ from the Single Mode Fiber coupling efficiency?

OpticStudio provides two analysis tools for calculating single-mode fiber coupling efficiency. One is the Single-Mode Fiber (SMF) coupling analysis and the other is Physical Optics Propagation (POP) fiber coupling analysis. These two computation methods are based on different theories and assumptions so their results may not always agree. Which method to use will depend on your system.  POP is a wave-based light propagation tool that can be used to model laser beam diffraction propagation. The beam is represented by an array of discretely sampled points that store the complex amplitude electric field on the wavefront. The entire array is then propagated through the optical system. The physical optics model allows very detailed study of coherent optical beams, that geometric ray representation is incapable of. Single Mode Fiber coupling analysis uses rays to represent the beam propagation from object surface to the exit pupil and only considers diffraction effect from exit pupil to image plane, which is what we call the “single step” approximation. This is the main difference between POP and SMF coupling analysis.  Though powerful POP algorithm has one limitation. It’s the difficulty in handling fast beams. POP is based on scalar diffraction theory which may break down when the beam is very fast. When this happens POP issues a warning in the Propagation Report, “Pilot beam waist smaller than wavelength!”. This is one indication that the beam is too fast to be accurately modeled by POP. For fast beams ray representation is generally a better approach. You can either switch to ray-based analysis or tick the Use Rays To Propagate To Next Surface box under Surface Properties\Physical Optics to address this issue.  Depending on the system, designer needs to decide which tool is more suitable for your application. There are three scenarios we normally recommend using POP. You can find them listed in the help file, The Analyze Tab (sequential ui mode) > Laser and Fibers Group > About Physical Optics Propagation If your system is one of these three cases where POP is needed, very likely you will observe different coupling efficiency reported between SMF coupling analysis and POP coupling analysis. For these cases, POP should be the intended tool for coupling analysis.  Next, I’ll show you a couple examples that compare these two fiber coupling analyses.  Case 1: A singlet conic lens to couple light between two fibers.In this case both SMF coupling and POP fiber coupling analyses work, and when entering the same beam divergence angle for the input fiber and receiving fiber mode, the two analyses give very similar results for coupling efficiency. Case 2: Two lenses system to couple from fiber to fiber with a long, nearly collimated propagation between the two lenses.  Due to this long, collimated beam propagation, POP and SMF yield very different coupling efficiency, with POP efficiency only about half of what SMF reports. In this case POP analysis should be used, because geometric ray representation cannot accurately model this long, nearly collimated propagation. Collimated ray bundle remains collimated, and the beam size barely changes between surface 2 (back of L1) and surface 4 (front of L2) if you look at the Spot Diagram on these two surfaces. However, laser beam diffracts as it propagates, and beam size always changes. In the merit function editor, if we use POPD operand to report beam size at surface 2 and 4, you’ll see it’s almost doubled after this long propagation. This diffraction propagation of the laser beam cannot be accurately modeled by ray representation, therefore in this case SMF coupling efficiency result may be overly optimistic and POP is more accurate.    These are just two simple examples for demonstration. Which analysis tool is better suited for your application may need careful evaluation. If you would like to know more about single mode fiber coupling analysis in OpticStudio, I recommend this KBA written by Mark Nicholson and Kristen Norton, Single-mode fiber coupling in OpticStudio – Knowledgebase (zemax.com). If you need help setting up the analysis or understanding the results, please feel free to contact Ansys Zemax support team. Our ACE engineers are always ready to assist you.  

Relating to:Physical Optics PropagationSingle Mode Fiber coupling analysis

How to set up Image Simulation tool?

Image Simulation tool is one of the most popular analysis tools in OpticStudio. It provides user a direct visual of the image quality, such as sharpness of the image, distortion, color aberrations, etc. It simulates system imaging performance by convolving a source bitmap file with an array of Point Spread Functions. In this tool, a source file, which can be a BMP, JPG, IMA, or BIM, is placed in the object space. Field Height in the Image Simulation setting is used to define the full height in the y-axis of the source bitmap in field coordinates, which may be either lens units or degrees. For example, if you use Angle as your Field type in the Field Data Editor, the input value in the Field Height in Image Simulation will also be in angle (degrees). If you want the bitmap source to fill the field of view, you can calculate the Field Height for the Image Simulation as shown in the graph below:  In Image Simulation algorithm, a "grid" of Point Spread Functions (PSFs) is computed. The grid spans the field size and describes the aberrations at selected points in the field of view defined by the bitmap and field size settings. In the Aberrations setting, user can choose whether or not to include diffraction effect. When choosing Diffraction, the algorithm uses the Huygens PSF for convolution with source bitmap. The PSF-X and PSF-Y points control how many Point Spread Functions are used to sample the entire field. The more PSF points you are using, the better the entire field gets sampled, at a cost of longer computation time. The rule of thumb is if your system performance varies significantly as a function of the field, a higher number of PSF points may be required to sufficiently sample the field.  Ideally, you don't want the PSF to change drastically between PSF grid locations. If the shape of the PSF is dramatically different between neighboring grid locations, the 2D interpolation scheme could introduce unphysical artifacts. We recommend checking the PSF Grid, an option in the Show As dropdown, to get a visual on the PSFs used to sample the field. If a PSF grid point appears to only span a single pixel, the Point Spread Function is small compared to the source bitmap pixel size. In this case, the source bitmap could be oversampled by increasing the Oversampling setting. Oversampling increases the pixel resolution of the source bitmap by copying one pixel into 2, 4, or more identical adjacent pixels. This increases the number of pixels per field unit. Or you could try reducing the source bitmap Field Height in order to make the PSF grid large compared to the pixel size of the source bitmap (i.e. it spans multiple pixels). This helps reduce the artifact caused by low pixel resolution of the input source bitmap. That said, it’s recommended the source scene bitmap should have sufficient pixel resolution for your intended application. Pupil and Image Sampling define the grid sampling to use in the pupil space and the source bitmap space for computing the PSF grid respectively. As for choosing the Pupil sampling, we recommend running the Huygens PSF analysis first to look at the size and shape of the PSF. Because the Image Simulation uses the Huygens PSF, a reasonable sampling used in the Huygens PSF analysis will be a good starting point to use for the Image Simulation Pupil sampling option.  If you would like to know more about the Image Simulation tool, we recommend this KBA written by Mark Nicholson, How to simulate high resolution images – Knowledgebase (zemax.com) This article provides an interesting, in-depth discussion of how to best use this tool.  

Relating to:Image Simulation

How to observe coating effects in OpticStudio?

Coatings are an important part of an optical system. Coatings can impact light transmission, polarization, phase, etc. Therefore, OpticStudio fully supports coatings in both Sequential and Non-Sequential Modes. For Sequential Mode, you can apply a coating to any surface by opening its properties and viewing the Coating setting.   For Non-Sequential Mode, you can view the Coat/Scatter settings on the object properties tab.   Coatings are defined in the OpticStudio Coating Catalog. In the catalog, there are many pre-provided coatings from Zemax as well as coating manufacturers. You can also define your own coatings. The syntax for custom coating definitions is described in the Help File:  The Libraries Tab > Coatings Group > Defining Coatings. When using custom coatings, we recommend not adding them to the default coating file COATING.DAT provided by OpticStudio. Rather, user should make a copy of the coating file and rename it using a different file name. This is because the default COATING.DAT file gets overwritten every time OpticStudio updates. Renaming your own coating file helps prevent loss of custom coatings.   Once the coating is applied to the surface, OpticStudio offers a tool to analyze coating transmission and reflection on a given surface. You can find this tool under the Analyze tab\Coatings dropdown menu. Coating transmission and reflection are plotted against angle of incidence as well as wavelengths. This tool helps you understand coating effect surface by surface. Especially for customized coatings, we recommend using this tool to check transmission/reflection to make sure coating is properly implemented in the coating file.    You can find more detailed information on using coatings here in the Help File: The Libraries Tab > Coatings Group > About Coatings > Specifying Coatings on Surfaces. 

Relating to:Coating

Why does the array size displayed in POP Irradiance window differ from the X/Y Width specified?

Physical Optics Propagation is a powerful tool for studying diffraction propagation of a laser beam. Often, we see users ask questions on how to increase the size of the display area of the POP beam, or why the width of the display area differs from the X and Y width entered in the Beam Definition tab. The X-width and Y-width entered in the Beam Definition tab in POP analysis window is only the initial array size, or the starting grid size. As the beam propagates, its size may change, and the grid size must be able to adjust itself to accommodate the beam.  There are two algorithms used for propagating the beam. The grid size adjustment depends on which propagation algorithm is used. POP uses Pilot beam to determine the beam position, inside or outside the Rayleigh range. Depending on the beam position, POP chooses the proper algorithm. By default, Angular Spectrum is used for propagation inside Rayleigh range, where beam size does not change significantly so grid size also remains constant. Fresnel diffraction propagation is used for propagating from inside to outside or outside to inside Rayleigh range. In this case beam size may change significantly so grid size also needs to be adjusted to avoid beam “outgrowing” the grid. One thing to pay attention to is the inverse relationship between the grid width at previous surface and current surface.  When a beam propagates a long distance from focus to far from focus, it’s essentially a Fourier transform of the beam. In Fourier transforms, the resolution at a surface is inversely proportional to the grid width at the previous surface. In other words, the grid width in one space determines the pixel size in the following space, so a wider grid size at the first surface results in a higher resolution at the second surface.    If you go to Surface Properties dropdown and click Physical Optics tab, you can choose to resample the beam at a given surface by adjusting the grid size and resolution. However, keep in mind that changing grid size and point spacing on current surface may have an impact on sampling at subsequent surfaces. It’s recommended to check the Propagation Report for any warnings of low sampling, as well as check beam phase profile surface by surface to eliminate phase aliasing due to insufficient sampling.  If you are interested in learning more about POP sampling, which is the key to proper POP usage, we recommend reading this series of Knowledgebase articles written by Erin Elliott. They work great as an introduction to new POP users. Using Physical Optics Propagation (POP), Part 1: Inspecting the beams – Knowledgebase (zemax.com) Using Physical Optics Propagation (POP), Part 2: Inspecting the beam intensities – Knowledgebase (zemax.com) Using Physical Optics Propagation (POP), Part 3: Inspecting the beam phases – Knowledgebase (zemax.com) 

Relating to:Physical Optics Propagation

How do OPD Reference settings in System Explorer\Advanced section affect wavefront calculation?

We often see customers ask for our help on understanding wavefront calculation in OpticStudio, for example, why wavefront error displayed in Wavefront Map differs from what I get when adding optical path lengths manually. To understand wavefront calculation in OpticStudio, there are two important things user needs to be aware of. First, by default the Reference OPD is set to “Exit Pupil” in System Explorer/Advanced section. This means the wavefront is calculated at the Exit Pupil, not the Image plane as some may assume. You can find this Reference OPD setting explained in the help file at The Setup Tab > System Group (the Setup Tab) > System Explorer > Advanced Options (System Explorer) > Reference OPD.  When OPD Reference is set to Exit Pupil, OpticStudio first propagates rays all the way to the image surface, then back propagates to the Exit Pupil, and the OPD or Wavefront Error is captured at the Exit Pupil instead of the Image Plane. Users can change the OPD reference from Exit Pupil to Absolute or Absolute 2 which uses Image Plane as the OPD reference location. That said, changing this setting will have an impact on the calculated wavefront error. We recommend reading through the above help documentation carefully before making any changes. For most focal systems, Exit Pupil should still be used as the OPD reference. Second, the Wavefront map displayed is not the raw accumulated optical path length, but rather it’s the wavefront error, or the optical path length difference between a pupil ray and the chief ray. OpticStudio uses the chief ray path length as the OPD reference. For focal system, a reference sphere at the Exit Pupil is created as the reference. Imagine your system outputs a perfect spherical wavefront, meaning converging rays come to a perfect point focus, you will observe a flat wavefront map of 0 wavefront error, due to the spherical reference used. For Afocal system, OpticStudio uses a planar reference. User can switch between spherical and planar OPD reference by turning on and off the Afocal Image Space box in System Explorer.  

Relating to:Wavefront Map

Can we model scattering in sequential mode?

Yes, you can model scattering in Sequential Mode. However, there are some differences from the scattering features available in Non-Sequential Mode. Namely, the scattering in Sequential is assumed to have only a very small angular deviation. This will create a “blurring” effect on the spot diagram or other analysis tools. Therefore, you cannot model phenomena such as backscatter, wide-angle scatter, or other scattering modalities that would otherwise violate forward ray tracing in Sequential Mode.To use scattering in Sequential, simply select the target surface and open its properties. Then open the Scattering properties. You will find a drop down offering a list of available scattering models. For more information on these models, please see: What scattering models are available in OpticStudio? – Knowledgebase (zemax.com).This capability can be important for lens designers to understand how lens surface roughness affects overall performance and image quality. More information can be found here in the Help File: The Setup Tab > Editors Group (Setup Tab) > Lens Data Editor > Surface Properties > Scattering (surface properties).If you need to model rays scattering in many directions and from many surfaces, you may need to consider moving to Non-Sequential Mode. This type of analysis will be necessary to understand stray-light and how housing, mounts, and baffles influence light collection.

Relating to:Scattering

How to prevent the Merit Function from violating an operand?

Operand weighting is the primary mechanism a user can leverage to control the resulting optimization. Weights are relative. This means that the operand with the largest weight will be given more priority in the optimization algorithm, or if all operands have the same weight, then they all will be treated equally.If an operand is continually violated, the first thing to try is to increase the relative weight of the operand. This has the effect of increasing optimization importance.Sometimes you may find that even when an operand has a very large weight, OpticStudio will still continually violate the operand. You can then try to set the operand to have a negative weight. This will effectively give the operand a weight of “infinity,” and OpticStudio will not be able to violate the condition under normal circumstances. This can be useful to exactly meet an optimization criterion, such as focal spot or magnification.However, it is important that you use these negative weights sparingly, if at all, for the best results. Negative weights should not be used for boundary conditions, and large positive weights are indicated before proceeding to negative weighting. For more specific details on negative weights, please see the Help File: The Optimize Tab (sequential ui mode) > Optimization Overview > Modifying the merit function.

Relating to:Optimization and Operands

What are filter strings and how to use them?

Filter strings are a tool to control which Non-Sequential Mode rays are saved, displayed, or calculated. In NSC mode, rays can arrive at any given point from many faces, sources, objects, etc. For example, it can be difficult to understand how rays from a particular surface (such as in ghost analysis) are affecting the measurement result on a detector. With filter strings, you can analyze different ray contributions and make sense of a messy model.The filter string itself can be a combination of filters that specify whether a ray hit, miss, reflected, refracted, scattered, diffracted, or ghost reflected from an object within the NSC group (or multiple objects). The filter string can be as simple or as complex as needed and can include logical operators and numerical arguments.There are several locations you can use a filter string in NSC mode:To filter the rays saved to the ZRD file during a ray trace:   To filter rays on a detector (when using a ZRD file):   To filter rays in the 3D Layout:   To filter rays shown by the Ray Database Viewer:   To better understand the string structure and meaning, it’s best to look at an example. In this filter string, the rays must have HIT Object 7 AND HIT Object 9 AND NOT REFLECTED from Object 6 OR the rays must have MISSED Object 15.(H7 & H9 & !R6) | M15For detailed information on the syntax and operators, please see the Help File: The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Overview > The Filter String.

Relating to:Non-Sequential Ray TracingScattering

How should I orient my CAD object in the NSC group to be able to get the ray traced in a mixed mode?

The main issue with mixed modes is to properly define the entry and exit port. In mixed mode, the Non-sequential Component surface is the entry port whose location is determined by the previous surfaces in the Lens Data Editor. The exit port position is the same as the surface following the Non-sequential Component surface, and its location in 3D space is determined by the parameters of the Non-sequential Component surface. No objects may touch or surround the entry and exit ports.CAD objects are defined with respect to a reference point which is the coordinate system used in CAD platform to export the object file. You may visualize the local coordinate system (reference point) of the CAD objects in the 3D layout through Object Properties...Draw as shown below:Depending on the coordinate system used in the CAD platform for file export, the CAD object might lie at a distance from the origin. When the NSC group is a CAD object, the coordinate system origin (reference point) of the CAD object cannot be in touch with entry and exit ports or lies out of the NSC group (Entry-Exit):So, to place and orient CAD objects inside the NSC group, you may have two options; first you can have your mechanical engineer define a local coordinate system inside the CAD platform to properly position and orient the CAD component in the local system and then customize the STP/IGS export by selecting the defined local system; and second, you can define a Null object with your desired position and orientation in NSC mode and then refer the CAD object to the Null object.Position and Tilt parameters of the CAD objects within the NSC group set position and orientation of the CAD object local coordinate system with respect to the NSC global coordinate system, assuming the Ref. Object is 0.

Relating to:Mixed mode ray tracingNon-Sequential Ray Tracing

Should I use the ZOS-API or ZPL?

Both ZPL and the ZOS-API are powerful tools for automating optical design with OpticStudio. Sometimes it can be difficult to decide which is better for a given application. ZPL is a language developed by Zemax to allow scripting within OpticStudio. The ZOS-API allows a user to automate OpticStudio using several mainstream coding languages, such as C#, C++, Python, MATLAB, and Mathematica.ZPL in general is much more limited than the ZOS-API, but it is simpler to use. ZPL does not allow for complete control of everything you can do with the OS GUI, whereas the ZOS-API exposes many more controls in a manner closely matching GUI interaction. It is important to note that the drawback with the ZOS-API is that getting started is a bit more involved than ZPL. If you need to do something quick and simple, ZPL is a good choice. ZPL is also required for things like custom Solves or Merit Function operands.In general, the ZOS-API has two operating modes: a standalone application or a user extension. A stand-alone application will run OpticStudio in the background and retrieve analysis data as needed. The extension will control an open OpticStudio window so that the user can run the ZOS-API in tandem to changes they make in the GUI. The user extension is the closer option to a ZPL script in the sense that it requires an open OS GUI.Finally, the ZOS-API will give the user access to more resources. Since it is based on the .NET framework and standard coding languages, it allows the user to call other external libraries to help in building an application. This can open up additional numeric or plotting libraries, for instance. ZPL does have built-in functions to work with numbers and do limited plotting— just not to the extent of the larger code bases offered by other languages.  For more information on ZPL, please see the Help File: The Programming Tab > About the ZPL.To get started with the ZOS-API, please see this link: Getting Started with ZOS-API – Zemax.

Relating to:Programming ZOS

Why doesn’t OS use all available memory and cores when optimizing or tolerancing?

The number of cores and memory utilized by OpticStudio is dependent on many factors. Their usage is based on which operands are used in the Merit Function, the number of variables in the system, and the overall design complexity. OpticStudio will make a number of efficiency decisions as it utilizes memory and spins up cores for optimization or tolerancing. For this reason, it is very common that OpticStudio may not use all memory or cores available.When you specify the # of Cores (for a number of OpticStudio tools), you are telling OpticStudio to request that number of cores. This does not mean that OpticStudio will be given the number of cores requested. The cores allocated to any program is controlled by Windows. Depending on the needs of the operating system and other applications, this number of cores may or may not be made available for the optimization and tolerance.It is also important to note that specifically with optimization. OpticStudio will only use as many cores as there are variables defined in your system. For each of these cores, it will create a copy of your system into memory, and depending on its size and complexity, especially if there is CAD included, the amount of memory can limit the number of cores utilized.Sometimes the calculations can be bottlenecked by a single-threaded computation. Many of OpticStudio’s tools and analyses are multi-threaded; however, some are not. When the Merit Function includes a single-threaded operand or computation, the overall core usage will be limited. In general, we recommend using the Optimization Wizard when appropriate, because the resultant Merit Functions are highly optimized to run well on many cores in a multi-threaded calculation.

Relating to:ToleranceOptimization and Operands

How to debug CAD Import/Export Errors?

OpticStudio uses two CAD libraries to render objects: SMS and Parasolid CAD libraries. There might be occasions when specific CAD parts cannot be properly rendered using either of CAD libraries. So, the first step of troubleshooting would be to switch the CAD libraries by unchecking (checking) “Use Parasolid Libraries” through Setup…OpticStudio preferences…General:  If the CAD object export runs into errors using both CAD libraries, you may need to make sure that the object is not oversized. For example, solids with dimensions larger than approximately 1×10^4 are not supported by the Parasolid libraries. This can be avoided by changing the lens units, say change the lens units from millimeters to meters.In the next step, the following items about the CAD object need to be inspected inside your CAD platform:OpticStudio only imports solids. No lines or surfaces are allowed. Distinctive lines and Surfaces need to be removed from the model before exporting STP files.Shells must be converted to thin solids before being imported into OpticStudio.Solids must be simply closed with a continuous exterior surface without holes or gaps.No internal surfaces or faces are allowed.Solids composed of multiple solid volumes either in contact or overlapping cannot be ray traced. Any contact or overlapping need to be removed before exporting STP files from your CAD platform. Multiple volumes not in contact are allowed.

Relating to:CAD Export

Why does my wavefront map show large spherical error while the output beam is nearly perfectly collimated?

Occasionally users reach out to us for help on understanding large wavefront error observed in their systems. For example, in this optical system below, there is one Paraxial lens used to collimate the beam. In this case we would expect the output beam to be perfectly collimated with a wavefront error of 0, but here the wavefront map shows a very large RMS wavefront error and the wavefront has a distinctive spherical shape. Why is this the case?   This has something to do with how wavefront calculation works in OpticStudio. The Wavefront Map you see is not the raw accumulated optical path length of each pupil ray, but rather it’s the referenced wavefront map, or wavefront error between a pupil ray and a reference optical path length. The construction of the wavefront reference will have a direct impact on the wavefront map. By default, the Afocal Image Space box is left unchecked under System Explorer\Aperture. This assumes your system is in Focal mode and OpticStudio constructs a reference sphere as the optical path length reference, or in other words the wavefront error is referenced to a spherical wavefront. You can imagine when referencing a perfectly flat wavefront to a spherical reference, the wavefront map will appear spherical, which is why you see such spherical wavefront map in the case above when the output is perfectly collimated.  This means when dealing with afocal system with collimated output, you need to check the Afocal Image Space box in System Explorer. This tells OpticStudio you intend to work in afocal image space and the wavefront reference should be planar instead of spherical. Once you check the box, the wavefront reference is a plane and you will now observe a perfectly flat wavefront map with 0 RMS wavefront error.  You can find a description on this Afocal Image Space setting in the help file at The Setup Tab > System Group (the Setup Tab) > System Explorer > Aperture (System Explorer) > Afocal Image Space.The wavefront calculation can become quite involved depending on how the reference is constructed. This is one of the areas we see a lot of customer questions. Therefore, we have published a Q&A describing how wavefront computation works under the Wavefront section. Please feel free to check it out.

Relating to:Wavefront Map

How do I measure polarization in NSC mode?

In Sequential mode there are tools like Polarization Ray Trace or Polarization Pupil Map for you to understand the polarization status as a ray propagates through the system. How do we obtain this polarization status when tracing rays in Non-Sequential mode? In Non-Sequential mode, the source polarization can be set under the Object Properties dropdown. When running ray trace, in the Ray Trace Control window, you have the option to save trace results for later analysis, by ticking the Save Rays box and enter a ZRD file name. After ray trace is completed, you can use Ray Database Viewer to load up the saved ZRD file. There you will see ray information segment by segment for each ray launched. Under Settings if you check the Exyz box, in the text output you will be able to view the electric field information. This allows you to analyze the polarization status of each ray as it propagates through the NSC system.   Additionally, there are some other methods you could try, for example turning on the Polarization flag on Detector so it’s only sensitive to certain polarization or creating a Table coating that passes certain polarization to help filter polarized rays. You can find a description on how to do this in the help file below:The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Detectors > Detector Rectangle ObjectThe Libraries Tab > Coatings Group > Defining Coatings > The TABLE Data Section

Relating to:Polarization Ray Tracing

How can I pivot a lens group around any points in space?

Coordinate Break surface is an important tool in Sequential mode for placing surfaces/elements at any position and orientation in 3D space. When tilting a surface in Sequential mode, by default the pivot point is at surface vertex, and when tilting an element consisting of multiple surfaces, the default pivot point is at the first surface vertex.    However, depending on the mounting arrangement sometimes it’s necessary to set up surface or element tilt pivoting around other points, for example the top or bottom edge of the element, or around a random point in space. We have a Knowledgebase article introducing the step by step process at How to pivot any element about any point in space – Knowledgebase (zemax.com). As you can see this process can get quite complicated.To help ease this effort, now the Tilt/Decenter Element tool has been extended to support pivoting around any point in space. Users first highlight the range of surfaces they would like to tilt as a group, then click the Tilt/Decenter Element tool in the tool section of the Lens Data Editor, highlighted in red circle below. There they specify the pivot point using its coordinates x, y, z, in either local or global coordinate system. In this example below, I have used local coordinate system and (0,-10,3) sets the pivot point to the bottom edge of the back face of the glass window.  After setting this up, you can run a quick test to confirm if the pivot point has been set up properly by adding a second configuration to make this a multiple configuration system. In MC editor, use operand PRAM to introduce a 30 deg Tilt X angle to the second configuration while no tilt is done in the first configuration. Last, in the 3D Layout window choose “Color Rays by Config #” and Show “All” configurations. Now in the Layout window the two configurations will be displayed simultaneously. This overlay provides a clear visual as to where the pivot point is and in this case it’s at the back face bottom edge as we have intended.  

Why is the RMS spot size listed in Spot Diagram different than the values reported by RSCE and RSRE operands?

One of the most frequently used tools in OpticStudio is the Spot Diagram. It reports RMS spot radius for different fields at different wavelengths. Very often after checking RMS spot radius using Spot Diagram, user needs to report spot radius in Merit Function Editor (MFE) to run optimization and minimize spot size for better image quality. OpticStudio provides four optimization operands for RMS spot radius, RSCE, RSCH, RERE, RSRH. When it comes to these four operands, we often see user ask two questions. First, what is the difference among the four operands? There are two main differences. One is the reference point. Using Centroid or using Chief ray intercept as the reference will make a difference in the computed RMS spot radius. The other is the pupil sampling method, Gaussian Quadrature (GQ) vs Rectangular Array (RA). The GQ algorithm is in general superior, but the one drawback is that the algorithm assumes the pupil is a circle, or more generally, an ellipse. For non-elliptical pupils, GQ does not work accurately.  For example, if there are surface apertures in the optical system that vignette enough rays to alter the effective shape of the pupil significantly, GQ should not be used. The RA algorithm traces a grid of rays through the pupil. The advantage to the RA algorithm is the ability to accurately account for the effects of vignetting in the merit function. This is useful in systems such as obscured telescopes and camera lenses which intentionally clip troublesome rays. The RSCE and RSCH operands use GQ algorithm, whereas RSRE and RSRH operands use RA algorithm. And the last letter E or H indicates whether the spot is referenced to Centroid or Chief ray. You can find this explained in the help file at The Optimize Tab (sequential ui mode) > Automatic Optimization Group > Merit Function Editor (automatic optimization group) > Optimization Operands (Alphabetically).  The second common question is why these 4 operands report different RMS spot radius than the radius I see in Spot Diagram for the same field and wavelength? This difference usually comes from three settings in the Spot Diagram: the Ray Density, Ray Pattern, and Refer To. For a system that has vignetting or non-circular pupil, Rectangular Array algorithm is the preferred pupil sampling method. In this case we should use RSRE or RSRH operand. Since these operands use rectangular grid of rays, in Spot Diagram we may also choose Square as the Ray Pattern. If you still see a difference between the MFE operand spot radius and the Spot Diagram, you could also ramp up the Ray Density to its maximum value of 200. The more rays traced, the greater the accuracy of the RMS Spot Radius, although the computation time also increases. Last is the Refer To option. If you want to match operand value with Spot Diagram, they should have the same reference, both refer to Centroid or both to Chief Ray. As shown in this example below, the RSRE operand and the left Spot Diagram, (Square ray pattern, 200 ray density, and centroid as reference), match very well.  

Relating to:Spot Size

How to use the Black Box Lens feature in OpticStudio?

Zemax Black Box is an encrypted file that contains design prescription data, including surface radius of curvature, thickness, glass materials, etc. The encrypted data appears as a “black box” in the Lens Data Editor. Rays go in, and the rays come out, exactly as if the original surfaces and design data were present in the Lens Data Editor. However, the detailed data is hidden so user cannot review or modify. This feature allows vendor to share design with customer without divulging details of the design to help protect their intellectual property.The procedures to create Black Box lens ZBB file or to load up ZBB file from vendor are straightforward. You can find it described in the help file at The File Tab > Export Group > Zemax Black Box. Occasionally user may encounter error while using black box lens and the error message reads “The black box file xxx.ZBB cannot be loaded”.This error usually occurs when OpticStudio cannot locate the quoted black box file xxx.ZBB in the designated folder. The default folder location where OpticStudio looks for the ZBB file is the master Zemax data folder “\Documents\Zemax\BlackBoxes”, when Project Directory is not used. When using Project Directory, the folder to store ZBB file becomes “\Project path\BlackBoxes”. One place to check the master data folder location is under the Setup tab\Project Preferences\Folders. This helps you confirm the correct folder path for loading ZBB files on your machine.    Below is an example to show you how to use a Black Box lens ZBB file after receiving it from vendor. To load up the Black box lens, you need to first place the ZBB file in the correct folder. In this example Project Directory is not used, so the ZBB file needs to be placed in the master data folder “\Documents\Zemax\BlackBoxes”, as indicated in the Project Preferences under the Setup tab. After that you can insert a surface type Black Box Lens in the Lens Data Editor, then enter the black box file name into the Comment column of the Black Box surface, (the name should include the .ZBB extension). After that you’ll see the black box being displayed in the Layout window, as shown below.  That said, the best way to exchange lens files containing a Black Box ZBB file is to use the archived ZAR format. When vendor creates the archived ZAR file, the ZBB file will be included. After user receives the ZAR file, they just need to load up the ZAR file and OpticStudio will automatically unpack and restore the ZBB file to the proper folder for use. In general it’s pretty easy to use Black Box lens, but there are some restrictions one needs to be aware of. You can find this info in the help file at The File Tab > Export Group > Zemax Black Box.

Relating to:Black Boxes

Can I define an initial beam in POP using its M2 value?

The answer is No, POP does not support M2 value as an input parameter to define the initial beam. M2 is a parameter that’s often used by laser engineers to describe the quality of a laser beam. A Gaussian laser beam is described by a beam waist size, a wavelength, and a location in object space. The Gaussian beam is an idealization that can be approached but never attained in practice. For aberrated, mixed-mode beams, an extension to the fundamental Gaussian beam model has been developed by Siegman [1]. The method uses a term called the beam quality factor, usually denoted by M2. The factor M2 can be thought of as "times diffraction limited" number. An ideal Gaussian beam has an M2 value of unity, but real lasers will always have an M2 value greater than unity. The M2 factor determines the size of the real, aberrated Gaussian beam by scaling the size and divergence of the embedded Gaussian mode by M. You can think of M2 as a fudge factor that tells you how much the real beam has deviated from an ideal Gaussian beam, and how much faster the beam diverges compared to an ideal Gaussian beam. However, M2 is only an output characteristic of the beam and not a parameter that can be used to uniquely specify the electric field distribution of a laser beam. For example, we have displayed three beams below, all with the same waist size and same computed M2 = 5, but their beam profiles are drastically different. It’s impossible for POP to know which beam to use just based on the given M2 value. This is why POP can compute M2 value for a given aberrated beam, but it cannot take M2 value as input to define the initial beam. In order for POP to propagate a beam, it needs to know the exact electric field distribution.  We have a similar forum discussion at Can I simulate a specific Gaussian beam in POP if I know the M2 value? | Zemax Community. If you have any questions or interested in discussing this topic more, please feel free to post your question there. [1] A. E. Siegman, Lasers, University Science Books (1986), R. Herloski, S. Marshall, and R. Antos, "Gaussian beam ray-equivalent modeling and optical design" 

Relating to:Physical Optics Propagation

How to create a Gaussian beam profile in OpticStudio?

In Lasers & Fiber applications, often optical engineers need to simulate a beam with Gaussian intensity profile. OpticStudio offers three methods to model Gaussian beam propagation. The first is the ray-based approach. By turning on the Gaussian Apodization settings in System Explorer, the beam will have a higher ray density at center and lower ray density towards edge. This creates a Gaussian intensity distribution and will have an impact on many ray-based analysis results, including RMS spot radius, Wavefront error, etc. The second tool is Paraxial Gaussian Beam analysis. This tool computes the propagation and transformation of a rotationally symmetric Gaussian beam using two paraxial rays in a meridional plane. It computes ideal and mixed mode M-squared Gaussian beam data, such as beam size, beam divergence, and waist locations, surface by surface as a given input beam propagates through the lens system. And the third method is the wave-based Physical Optics Propagation (POP) analysis. Physical Optics Propagation models optical systems by propagating coherent wavefronts. The beam is represented by an array of discretely sampled points, storing both the amplitude and phase of the electric field. The entire array is then propagated through the free space between optical surfaces. At each optical surface, a transfer function is computed which transfers the beam from one side of the optical surface to the other. Because the beam is described by its complex-valued electric field in the array, Physical Optics Propagation allows very detailed study of arbitrary coherent optical beams, including Gaussian or higher order multi-mode laser beams of any form (beams are user definable), or diffraction effects far from focus. The physical optics model is generally more accurate at predicting the detailed amplitude and phase structure of the beam away from focus than conventional ray tracing, but it’s also more computationally intensive and generally slower than running geometric ray-based analyses. If you are interested in diving into this topic more, we have a series of four KBAs describing how to use these tools to model Gaussian beam propagation at:OpticStudio Gaussian Beam FAQ – Knowledgebase (zemax.com)How to model laser beam propagation in OpticStudio: Part 1 - Gaussian beam theory and ray-based approach – Knowledgebase (zemax.com)How to model laser beam propagation in OpticStudio: Part 2 - Using Paraxial Gaussian Beam analysis to model Gaussian beam – Knowledgebase (zemax.com)How to model laser beam propagation in OpticStudio: Part 3 - Using Physical Optics Propagation to model Gaussian beams – Knowledgebase (zemax.com)  

Relating to:Physical Optics Propagation