Recently active topics
Print statements in ZPL are suppressed during the script is running
Dear support team, it seems that a 'Print' statement in ZPL is suppressed during the script is running. Then at the end of the script all print statements are executed at once. I guess, this is a kind of optimisation? However, I am running large scripts and I would like to see the progress in the command window . So I would like the print statement to react directly when it is called. Is this possible? Thank you, Christof.
Help with POP Python
Hello,I am having some difficulty finding answers on this elsewhere online and have not found any helpful forum posts on this either so here I am. I am trying to communicate with the POP with the python ZOSAPI with the program in interactive mode. Currently I have tried this little code snippit to set the surface desired to 2 and pull the irradiance with not much luck. Python more or less yells at me with an error saying “IAS_ object has no attribute ‘EndSurface’ I am not having the best of luck finding a solution to this problem in the help document. Please Help! :)FYI: See code snippit below # initialize analysis toolsTheAnalyses = TheSystem.AnalysesPOP = TheAnalyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.PhysicalOpticsPropagation)POP_set = POP.GetSettings()POP_set.DataType = ZOSAPI.Analysis.PhysicalOptics.POPDataTypes.IrradiancePOP_set.EndSurface.SetSurfaceNumber(2)POP.ApplyAndWaitForCompletion()POP_result = POP.GetResults()Irr = float(POP_result.DataGrids(1).Values) Cheers,Armand
Tolerance script - saving Monte Carlo tolerance values for use in several optimizations
I am trying to use tolerance scripts to realistically model my lab’s compensation procedure. The system consists of several lenses mounted in two lens barrels that fit together. If the performance of the system is not compliant, then one of the barrels is rotated 90º with respect to the other and the performance is checked again; subsequently it can be rotated 180º or 270º as needed. I am thinking to model this by using multi-configuration for each of the barrel rotation options (0º, 90º, 180º, 270º), but as the system is nominally rotationally symmetric, this by itself will not do anything. I want to know how to apply the rotation AFTER the tolerance values (on lens wedge, tilt, shift, etc.) are selected for each Monte Carlo trial, so that I can rotate the directional tolerances for the lenses in the first barrel with respect to the tolerances for the lenses in the second barrel. For example, if a lens in barrel #1 has a tilt of 0.062º +X in a Monte Carlo trial, I want to compare this
How to set max cores by default for ray trace in NSC
Hi dears,I would like to know how to set the maximum number of cores for the ray trace in NSC. My workstation has 32 cores, but to be able to work with other applications during the calculation I considered it sufficient to launch the ray trace using a maximum of 25 cores, unfortunately at the first launch of the calculation the SW sets the maximum number of cores available and if I forget to change this value I have to stop the simulation and change it.Thanks a lot to everyone.
API (Python and MATLAB Interactive Extension) Calculate the Ray Transfer (ABCD) Matrix for thick Lens
To compute the ABCD matrix, OpticStudio traces rays over a very small region centered upon the reference field position. Usually, this is the center of the field of view. OpticStudio allows selection of which field position to use for reference.By default, OpticStudio sets the corner of the field grid in object space to be at the maximum radial field distance. Because object height is linear with the tangent of the field angle, the full width of the field when angles are used to define the field is given byWhere θr is the maximum radial field angle at the corner of the field.The ray coordinates in image space for the very small field of view are used to determine the ABCD matrix components. The use of an ABCD matrix allows for coordinate rotations. If the image surface is rotated, such that a y object coordinate images to both an x and a y image coordinate, the ABCD matrix will automatically account for the rotation. The grid distortion plot shows the linear grid, and then marks the ac
Introducing East Coast Optical Technologies
I’m Rich Migliaccio, president of East Coast Optical Technologies. We’re an engineering firm specializing in the design, development and prototyping of advanced electro-optical systems. Expertise include optoelectronic and optomechanical design with knowledge that goes beyond the visible spectrum.We provide cost effective design solutions for light management and light based sensor platforms using state of the art design tools and decades of experience. We’ve been providing these services since 2002.see https://www.ecotechnologies.biz/ for more information.
How to export/view Zernike Data using the ZOSAPI?
I am trying to view/export the zernike data of my system using Matlab and the API. Currently my code reads: And I don't know what to do from here. The data comes to Matlab in an IAR file type, and I don't know how to extract it. Thanks, Stephen Chapman
Hi,I was reading Shawn Gay’s excellent article on the geometry used by the various curvature calculations. In it, Shawn writes:In the Surface Curvature analysis, the convention that OpticStudio adopts is to align the tangential direction with the x-direction at the surface vertex.This statement is true and of course the choice is arbitrary, but it seems to me this convention is 90 degrees at odds with where we use the term tangential elsewhere. The surface curvature data is independent of ray tracing, but when doing raytracing the convention OS uses is that tangential is along the y-axis.I must admit I assumed that this was the case in the curvature plots. I read the documentation, and it’s not described there. I searched for a KB article instead and found what I needed to correct my understanding. But since the convention is arbitrary, did we have to use a convention that is orthogonal to the convention used elsewhere?This is an old feature and I know that changing the convention will
Batch Raytracing With the ZOS-API MATLAB dll
I started modifying the boilerplate code included on this page: https://support.zemax.com/hc/en-us/articles/1500005576882 Looking through the ZOS-API help from the Programming Tab in OpticStudio I can tell that there are some differences between the way the code is implemented in the .dll versus the way it is described in the help files. How do I access the API for the methods and classes inside the .dll file?
ZOS API in C# to get FftMtf returns null output
I am following the example (CSharpStandalone_04_pull_data_from_FFTMTF.cs) to get FFT MTF data like below; newWin.ApplyAndWaitForCompletion();IAR_ newWin_Results = newWin.GetResults();It works fine in my computer. But the same copy returns ‘null results’ from other’s computer.No idea where I should look into for debugging.Appreciate your kind advice.
OpticStudio can not load DLLs
I tried to use the original Gaussian.cpp in Visual Studio 2019 to create a dll project. I created a default dll project and copied the Gaussian.cpp and tried to build the file. The header file is left empty. The build was successful but when I tried to load into Zemax, it gives error saying cannot load DLL as in the attachment.
How to limit the relation between thickness and radius to make sure the lens is realistic
HiI want to check how should we limit the diameter-to-radius ratio in Zemax? I’m using MNCG and MXCG to limit the thickness of the lens. However, during the optimization process, the lens radius can be negative and the absolute value is larger than the lens thickness which make these lens not real. Could we use some operand to avoid the situation? I’m trying to find the operand to get the radius and limit the thickness according to the radius but failed to find the operand. Do we have other operand to do that?Thanks！
model a lens optical aberration with Zernike coefficients
Dear all, How to model a black-box optical system using Zernike coefficients – Knowledgebase (zemax.com) tells us how to model a lens optical aberration using Zernike coefficients. However , this method can only define the aberration in one field at one wavelength, in most cases it’s not sufficent to define a lens overall aberration. any further suggestions? (I’m working on the measurement of infinity corrected objectives with Shack-Hartmann sensor and i want to reconstruct the aberration in a simplified model.)
Chrome Extension for Replying to Community Posts
Hi Frequent Posters,As I’m sure anyone who regularly answers questions on here, you can at least run across a response not saving for one reason or another. Zemax has a placeholder warning saying “be sure to wait for your attachment to finish uploading before you submit, or you may lose the content of your post”. The only problem is there is no indication from Zemax that attachments are still uploading. So, if you have a few images and one hasn’t uploaded (for whatever reason), you lose your entire post. This is very frustrating, especially if you have a few paragraphs with several images (I’ve personally lost probably over 8+ hours of creating responses because of this).The CKEditor which the community forum uses unfortunately doesn’t have client-side autosave via localStorage (the editor only has a server-side autosave which kinda defeats the purpose of losing content because it’s not sent to the server).I wrote a tiny Chrome (and Edge) extension that will auto-save your content
Unable to save file
Hi, I've recently experienced an issue when using ZPL/Zrdplayback command for optimizing a non sequential system. The local optimizer/orthogonal descent, worked fine, but the two global optimizers (Global search & Hammer) stopped at the start of the optimization process with the following error message 'Unable to save file...'. I've found a design file in this forum showing the same behavior (please check the attached file). I suspect that the problem arises when several variations of the initial model are generated and attempt to create and/or read the rayfile from the ZPL macro. Could you please comment and propose a fix that would ideally, preserve the call to zrdplayback? Thank you
Trick: Alternative Use of TOLR - how to add an optimized parameter as an operand to the Merit Function Editor
TOLR is an MF operand that returns statistical results for tolerancing sensitivity analysis, and adds these results to the optimization process. In the background, the tolerancing analysis with the compensation consideration is another optimization process under different perturbation conditions. Therefore, TOLR can also be used as an optimization operand for the parameters that require optimization beforehand. Concept of using TOLR This section discusses the use of TOLR, which is unrelated to tolerancing. Instead, it utilizes the optimization process behind what we see. To use TOLR, you need to use a tolerancing user script. This is because the merit function used in the previous optimization and the main optimization process are different. By using a tolerancing user script, you can control which merit criteria to use tolerancing user script defines how to compensate and optimize. The following commands are the ones we used: CLEARCOMP (remove variables), COMP (set variables), LOADMER
Image simulation - Mixed mode or Multiconfiguration
Hello, I am currently working on a telescope whose primary and secondary mirrors are divided into three segments. I would like to see how deviations in their position relative to each other affect the final image. Does anyone know what mode (Sequential and multiconfigurations or NSQ) is best to use for this analysis?Thanks in advance for your help.
Intro to Lens Design ZEMAX - Transmission Sphere Design Question
Hello ZEMAX community, I am currently practicing the Lens Splitting based on the <Introduction to Lens Design in ZEMAX> Chapter 9. The problem is to design a transmission sphere as described in below. I got the spot diagram to be close to the Airy disk, but not exactly smaller. My struggle is that I could not understand/use notes (d).My question is in the notes (d) provided. It says the condition for the transmission sphere is BFL = EFFL and use the Operands OPTH and DIFF. Here, I understand that the OPTH calculates the optical path based on a selected surface. But I could not think how to use two OPTHs to make it work.Alternatively, I searched that the critical design condition for the last surface is that its radius of curvature needs to be equal to the BFL. To me, to equate the radius of the last surface (6th) = BFL (TTHI operand), and use DIFF to optimize the difference is zero makes more sense. Can anyone please comment on the question or verify if my thoughts are right?Than
What are the Optic Studio Constraints of Modelling Bulk Scattering through thick diffusive Media?
Hi, I want to measure the time of flight from rays scattered from thick diffusive media, e.g. a 5cm thick block of foam, resin, human tissue, e.g. 30-100 Transport Mean Free Paths, but I am finding hard limitations with the OS settings (see attached files).As a general example, using the volume physics dialogue box, DLL defined H-G_bulk: using mu_s = 11.5 mm-1, mu_a = 0.0016 mm-1 and g=0.87, Mean Path=0.09 mm and T = 0.99.Setting intersections to max: 4000, and segment number to 100k, with Min Rel Intensity (min) 1E-36 (to collect everything as rays can lose many orders of magnitude). This arrangement flags the “Error: Not Enough Intersections Allocated to Finish Ray Trace” for several cm of diffusive media, and indeed if I ignore this, a histogram of #segments shows it is clipped at 4000 (see ZMX and pngs attached). For context I measure the OPL of a ray by using the ray coordinates as vectors (* refractive index) per segment and summing. Splitting is turned OFF because the ZRD lists
how to get peak irrandiance from NSC detector through ZPL Macro
Hi Sir/Madam,I am trying to get the peak irrandiance through ZPL language, but seems do not have command fit my purpose.I am thinkging if I could use NSDD to get flux value in position space for each pixel# and compare each value with a command like “maximun” to get the peak one in a array, then I still could reach my purpose. But is there any command for me could do it to get maximun value? and how should I use it? SincerelyDavis
MWIR coating transmits over 100% . . . what's going on?
I have a MWIR coating on a germanium substrate (with internal transmittance set to 1.0) and I’m getting double-sided transmission greater than 1.0. How is this possible? This result disagrees with Code V, Filmstar and Essential Macleod. Even if I vary the layer thicknesses by 3%, transmission still can exceed 1.0 at angles of incidence less than or equal to 20 degrees.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.