NSC Operands

Optimizing with Sources and Detectors in Non-sequential UI Mode

Optimizing illumination systems or other optical systems that use non-sequential sources and detectors is supported using the NSDC, NSDD, NSDE, NSDP and NSTR operands.

A typical merit function would consist of three groups of operands:

First, NSDD operands would be used to clear the data in the current detectors. Use NSDD with the detector number set to zero to clear all energy in all detectors. Usually a single NSDD at the top of the merit function is all that is needed. NSDD returns a value of zero and has no effect on the merit function value when used to clear detectors.

Second, NSTR operands are used to trace rays from NSC sources. NSTR i traces analysis rays from source i; NSTR 0 traces all analysis rays from all sources. Note the number of analysis rays on the NSC editor determines how many rays are traced and how long the evaluation of the NSTR operand will take. NSTR always returns a value of zero and has no effect on the merit function value. The NSTR operand supports options to split, scatter, and use polarization.

Third, a new group of NSDC, NSDD, NSDE, or NSDP operands are used to read out the detector data.  NSDD has four arguments: surface, detector, pixel, and data. Surface is the surface number of the NSC group (use 1 if the program mode is non-sequential). Detector is the object number of the detector. Both detector objects and faceted detectors may be used as detectors. If pixel is an integer greater than zero, the flux, flux/area, or flux/solid angle is returned for that pixel. Which of the three is determined by the data argument, which should be 0, 1, or 2 for flux, irradiance, or intensity, respectively. If pixel is 0, the sum of all the flux or flux/area in the detector is returned. The units of the returned data is determined by the system units, see "Analysis Units".  To compute other data with NSDD, see the Pix# and Data# assignments for the NSDD operand in the table below.

Pix# Data# Output
N 0 Flux on pixel N
N 1 Flux/area (irradiance) on pixel N
N 2 Flux/solid angle (intensity) on pixel N
N 3 Normalized flux
0 0 Total flux in position space for all pixels
0 1 Average flux/area in position space
0 2 Total flux in angle space for all pixels
-1 0 Maximum flux
-1 1 Maximum flux/area
-1 2 Maximum flux/solid angle
-2 0 Minimum flux
-2 1 Minimum flux/area
-2 2 Minimum flux/solid angle
-3 Unused Number of total rays striking the detector for all pixels
-4 0 Standard deviation (RMS from the mean) of flux data of all the non-zero pixels
-4 1 Standard deviation (RMS from the mean) of flux/area data of all the non-zero pixels
-4 2 Standard deviation (RMS from the mean) of flux/solid angle data of all the non-zero pixels
-5 0 The mean value of flux data of all the non-zero pixels
-5 1 The mean value of flux/area data of all the non-zero pixels
-5 2 The mean value of flux/solid angle data of all the non-zero pixels
-6 0 The x coordinate of the centroid of the flux data
-7 0 The y coordinate of the centroid of the flux data
-8 0 The z coordinate of the centroid of the flux data
-6 1 The x coordinate of the centroid of the flux/area (irradiance) data
-7 1 The y coordinate of the centroid of the flux/area (irradiance) data
-8 1 The z coordinate of the centroid of the flux/area (irradiance) data
-6 2 The x coordinate of the centroid of the flux/solid angle (intensity) data
-7 2 The y coordinate of the centroid of the flux/solid angle (intensity) data
-8 2 The z coordinate of the centroid of the flux/solid angle (intensity) data
-9 0 The weighted RMS radial distance of all the pixels with respect to the centroid. The weight is based on flux data. This is the square of the variance or second moment of r^2 based on flux data of all pixels.
-10 0 The weighted RMS x distance of all the pixels with respect to the centroid. The weight is based on flux data. This is the square of the variance or second moment of x^2 based on flux data of all pixels.
-11 0 The weighted RMS y distance of all the pixels with respect to the centroid. The weight is based on flux data. This is the square of the variance or second moment of y^2 based on flux data of all pixels.
-12 0 The weighted RMS z distance of all the pixels with respect to the centroid. The weight is based on flux data. This is the square of the variance or second moment of z^2 based on flux data of all pixels.
-13 0 The weighted RMS xy distance of all the pixels with respect to the centroid. The weight is based on flux data. This is the square of the variance or second moment of xy based on flux data of all pixels.
-9 1 The weighted RMS radial distance of all the pixels with respect to the centroid. The weight is based on flux/area data. This is the square of the variance or second moment of r^2 based on flux/area data of all pixels.
-10 1 The weighted RMS x distance of all the pixels with respect to the centroid. The weight is based on flux/area data. This is the square of the variance or second moment of x^2 based on flux/area data of all pixels.
-11 1 The weighted RMS y distance of all the pixels with respect to the centroid. The weight is based on flux/area data. This is the square of the variance or second moment of y^2 based on flux/area data of all pixels.
-12 1 The weighted RMS z distance of all the pixels with respect to the centroid. The weight is based on flux/area data. This is the square of the variance or second moment of z^2 based on flux/area data of all pixels.
-13 1 The weighted RMS xy distance of all the pixels with respect to the centroid. The weight is based on flux/area data. This is the square of the variance or second moment of xy based on flux/area data of all pixels.
-9 2 The weighted RMS radial distance of all the pixels with respect to the centroid. The weight is based on flux/solid angle data. This is the square of the variance or second moment of r^2 based on flux/solid angle data of all pixels.
-10 2 The weighted RMS x distance of all the pixels with respect to the centroid. The weight is based on flux/solid angle data. This is the square of the variance or second moment of x^2 based on flux/solid angle data of all pixels.
-11 2 The weighted RMS y distance of all the pixels with respect to the centroid. The weight is based on flux/solid angle data. This is the square of the variance or second moment of y^2 based on flux/solid angle data of all pixels.
-12 2 The weighted RMS z distance of all the pixels with respect to the centroid. The weight is based on flux/solid angle data. This is the square of the variance or second moment of z^2 based on flux/solid angle data of all pixels.
-13 2 The weighted RMS xy distance of all the pixels with respect to the centroid. The weight is based on flux/solid angle data. This is the square of the variance or second moment of xy based on flux/solid angle data of all pixels.
-14 0,1 Geometric MTF in X direction at the specified Spatial Frequency
-15 0,1 Geometric MTF in Y direction at the specified Spatial Frequency

N is a positive integer

Data# = 2 is only available for Detector Rectangle, which records data in angle space.

For Pix# = 0 and -6 to -13, Data# = 0 and 1 will be same because all pixels have same size.

For faceted detectors, only Data# = 0 or 1 can be used

If the object is a faceted detector, or if the pixel number is -1 or 0, only data options 0 and 1 are supported. Similar capability to that described for NSDD exists for coherent data using NSDC, for detector color data using NSDE, and for detector polar data using NSDP.

The practical difficulty in optimizing these systems is the difficulty of computing derivatives of detected energy with respect to variable parameters because of the relatively large uncertainty in computing detected energy. Many rays must be traced to determine illumination patterns approximately.

Formula for the weighted RMS distance:

The weighted RMS x distance of all the pixels with respect to the centroid is the square root of the variance x^2. It is equal to:



where

  • wi is a weight equal to the value of the pixel based on Data
  • xi is the x-coordinate of the pixel
  • x* is the weighted mean.


The weighted RMS radial distance of all the pixels with respect to the centroid is equal to:



Note for Detector Rectangle, the value for Data = 0 and 1 will be same because all pixels have same size.

Comments about Random Numbers and NSTR

Note that when launching rays with the NSTR operand, OpticStudio seeds the random number generator with the identical value every time the merit function is evaluated. This means the identical set of random numbers are used on every evaluation of the merit function. If no changes are made to the optical system, the merit function will always evaluate to a consistent value; a desirable property for the optimization algorithm to function. However, if a change is made to the system, rays may take different paths and the identical set of random numbers may be used in different ways; for example, in the computation of scattering paths.

Pixel Numbering for Detectors

For detailed discussions of the pixel numbering used by the various types of detectors, see Non-sequential Detectors.

Next: