Hello,
Is there a way to choose which source I want to raytrace in ZOS-API?
In ZPL I’m familiar with the NSTR property but didn’t see similar property in the INSCRayTrace Tool.
Thanks,
Oran
Hello,
Is there a way to choose which source I want to raytrace in ZOS-API?
In ZPL I’m familiar with the NSTR property but didn’t see similar property in the INSCRayTrace Tool.
Thanks,
Oran
Hi Oran,
The INSCRayTrace Tool is the equivalent of pressing Analyze..Ray Trace in the user interface, which prompt you with the following window:
And if you look into the Help File for this tool (using the blue question mark icon), you’ll read that:
OpticStudio will trace exactly the number of specified analysis rays for each source listed in the NSC Editor
So, if you want to use that tool, you could disable a Source by setting its # Analysis Rays cell to zero. Since this is Parameter 2 of a source, this is the line of code you’ll need (Python in this example):
# Get your Source Object
My_Source_1 = TheSystem.NCE.GetObjectAt(1)
# Set its # Analysis Rays to zero
My_Source_1.GetObjectCell(12).IntegerValue = 0
Alternatively, if you want to enable a Source, just set its # Analysis Rays to any non-zero positive integer.
NSTR in ZPL works more like the NSTR Merit Function operand and you could use the Merit Function to perform the ray tracing and retrive the value of some other operands (but it wouldn’t work for an analysis). I hope this makes sense.
Lastly, you could also use the IBatchRayTrace tool, and in this case, instead of defining a source, you would define the rays you want to be traced individually.
I hope this helps and take care,
David
NSTR in ZPL works more like the NSTR Merit Function operand and you could use the Merit Function to perform the ray tracing and retrive the value of some other operands (but it wouldn’t work for an analysis). I hope this makes sense.
Can you please explain what did you mean buy saying it wouldn’t work for an analysis?
I figured I would use NSTR through the MFE but I want to understand the implications.
Thanks,
Oran
Hi Oran,
Let’s imagine you are using the Analyze..Ray Database Viewer in the user interface. This analysis requires a ray database in the form of a *.ZRD file. Using the NSTR Merit-Function operand will not generate such a file by default (but the ZPL keyword could). In the ZOS-API you would have to add a NSRD operand before to specify the ray database file name, and then, you could run this analysis with the file that has been generated with the Merit Function. For other analyses you might run into similar issues. I shouldn’t have said that it wouldn’t work, instead what I mean is that it might be more tricky than simply having a NSTR operand in the Merit Function.
I hope that makes sense.
Take care,
David
Hi Oran,
The INSCRayTrace Tool is the equivalent of pressing Analyze..Ray Trace in the user interface, which prompt you with the following window:
And if you look into the Help File for this tool (using the blue question mark icon), you’ll read that:
OpticStudio will trace exactly the number of specified analysis rays for each source listed in the NSC Editor
So, if you want to use that tool, you could disable a Source by setting its # Analysis Rays cell to zero. Since this is Parameter 2 of a source, this is the line of code you’ll need (Python in this example):
# Get your Source Object
My_Source_1 = TheSystem.NCE.GetObjectAt(1)
# Set its # Analysis Rays to zero
My_Source_1.GetObjectCell(12).IntegerValue = 0
Alternatively, if you want to enable a Source, just set its # Analysis Rays to any non-zero positive integer.
NSTR in ZPL works more like the NSTR Merit Function operand and you could use the Merit Function to perform the ray tracing and retrive the value of some other operands (but it wouldn’t work for an analysis). I hope this makes sense.
Lastly, you could also use the IBatchRayTrace tool, and in this case, instead of defining a source, you would define the rays you want to be traced individually.
I hope this helps and take care,
David
Dear Dvid,
Thank you for the information! I have the following questions:
Regards,
Jiang
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.