IRayTraceNormUnpolData

IRayTraceNormUnpolData performs a batch unpolarized ray trace, using normalized pupil coordinates.

When opening the tool, the user selects the number of maximum rays to be traced, the type of rays (the ray tracing can use real or paraxial rays), and the surface up to which the rays will be traced.

CreateNormUnpol (int MaxRays, RaysType rayType, int toSurface)

The rays are then defined one by one in the AddRay function. The rays are defined by the wavelength, the relative field and pupil coordinates. The AddRay also contains a calcOPD variable, if the optical path difference (OPD) needs to be returned.

AddRay (int waveNumber, double Hx, double Hy, double Px, double Py, OPDMode calcOPD)
  • If calcOPD is 0, no OPD calculation will be performed. It will return the optical path as defined in the Single Ray Trace analysis. That value can differ from other analyses at infinite conjugates.
  • If calcOPD is OPDMode.Current, it will calculate the OPD based on this ray and the previously computed chief ray.
  • OPDMode.CurrentAndChief will first compute the chief ray, and then calculate the OPD for this ray. Note that the OPD can only be calculated when tracing rays all the way to the image surface.

For more information, see the discussion below.

Before reading the results the StartReadingResults() method needs to used.

Results

This method can return:

ReadNextResult (out int rayNumber, out int ErrorCode, out int vignetteCode, out double X, out double Y, out double Z, out double L, out double M, out double N, out double l2, out double m2, out double n2, out double opd, out double intensity)
  • rayNumber
  • ErrorCode
  • vignetteCode: indicates if the ray was vignetted
  • X, Y, Z: the coordinates of the ray at the requested surface
  • L, M, N: direction cosines of the ray at the requested surface
  • l2, m2, n2: vector normal of the ray at the requested surface.
  • opd: optical path difference (see the discussion below)
  • Intensity: the power of the ray (see discussion below on the polarization)

Discussion

OPD

Computing the OPD takes additional time beyond that for regular ray tracing, and OpticStudio only performs this additional computation if requested to do so. Computing the OPD is also more complicated for the client program, because OPD means optical path difference, which means two rays must be traced rather than just one. To compute OPD for an arbitrary ray, OpticStudio must trace the chief ray, then the arbitrary ray, then subtract the phase of the two to get the OPD. Rather than trace the same chief ray over and over, which is slow, usually the chief ray is traced once, and then the phase of the chief ray is subtracted from each subsequent ray.

  • If calcOPD is OPDMode.CurrentAndChief then both the chief ray and specified ray are requested, and the OPD is the phase difference between the two in waves of the current wavelength.
  • If calcOPD is OPDMode.Current, then the most recently traced chief ray data is used.

Therefore, the calcOPD should be OPDMode.CurrentAndChief whenever the chief ray changes; OPDMode.Current for all subsequent rays which do not require the chief ray be traced again. Generally the chief ray changes only when the field coordinates or wavelength changes. This method is much faster if there are many rays being traced from the same field point, as is the case for many optical analysis calculations. The opd can only be computed if the last surface is the image surface, otherwise, the opd value will be zero.

Polarization in the NormUnpol and DirectUnpol interfaces

Note that with both the unpolarized ray tracing modes (NormUnpol and DirectUnPol) polarization is not considered. In these two modes, the intensity of the ray is not affected by the bulk internal transmittance due to absorption, coating losses or surface Fresnel reflections. Even though the bulk absorption can be handled through just the OPL of the ray, it is not considered with either of the unpolarized ray trace modes (NormUnpol and DirectUnPol); however, coating losses and Fresnel surface reflection contributions require modifying the E-field of the ray which requires a polarization ray trace. It should be noted that the intensity of a ray with the NormUnpol and DirectUnPol ray trace modes may still be modified by a few surfaces in sequential mode that can modify the ray intensity without relying on modifying the electric field such as User Defined (e.g. US_FILT1), Slide, or Non-Sequential surfaces.

Next: