[Raytrace] User Defined Optimization Set Up

John D. Upton jd-upton@texas.net
Fri, 28 Mar 2003 10:02:08 -0600


John,

At 04:20 PM 3/27/2003 -0800, you wrote:
>it. In my limited fog, I wonder. Can't you optimize for OCM20, and then set
>the thickness of 5 by clicking the box there and selecting "Minus
>Thickness"? Then choosing 0 to do the minus pickup from?

     Doing the pickup is handy for seeing how much you are off.  If you do 
it for the example I am working on and then do an auto-focus for minimum 
OPD, TH[6] (the image plane distance) will show where the beam falls.  I 
would like that distance to be zero.  Setting a Minus Pickup is a good way 
to keep from having to manually add the TH[0]+TH[5]+TH[6] values to see how 
close the image surface is to the source.  Thanks for the suggestion.

     I did find a way to do it but it was not pretty.  I'm sure there is a 
better (proper) way to set this up.  What I did was modify the CCL routines 
for optimization and recompile.  The stock CCL routines explicitly tell you 
not to modify them!  I copied the standard routines off to a safe place and 
edited the "op_erfs.ccl" and "op_callbaks.ccl" files.  I added the 
following line to the "opcb_abs(void)" function of the "op_callbaks.ccl" file:

Ocm[23] = th[0] + th[5]; // th[0]+th[5]

     I then edited the "op_erfs.ccl" file to add the following line to 
function  "opabs_template(void)":

opnbr++;o(opnbr, ins, "OCM23", 1.0, "TH0+TH5");  /* Thickness */

     I next recompiled the CCL.  Now, when I use the menu command 
"Optimize|Generate_Error_Function|Abberration_Operands", I get an 
additional OCM23 command that forces TH[0]+TH[5] to be zero.  It worked 
well.  The prescription below shows the results (also using John's minus 
pickup idea to show how far off the final minimum OPD focal plan is from 
the source).


*LENS DATA
Ross Null 14" F/4.4
  SRF      RADIUS      THICKNESS   APERTURE RADIUS       GLASS  SPE  NOTE
  OBJ       --         89.475380 V  8.9475e-05             AIR
  AST   100.000000      5.000000      9.494067 AS          BK7 C
   2        --        2.9418e+03 V    9.682106 S           AIR
   3   -3.1115e+03   -2.9418e+03 P  177.496321 S    REFL_HATCH   *
   4        --     P   -5.000000 P    9.673515 S           BK7 P
   5    100.000000 P  -89.475380 P    9.485465 S           AIR
  IMS       --       -6.6881e-05      0.005161 S

*CONIC AND POLYNOMIAL ASPHERIC DATA
  SRF        CC          AD          AE          AF          AG
   3      -1.000000      --          --          --          --

*WAVEFRONT RS
  WAVELENGTH 1
    PKVAL OPD     RMS OPD  STREHL RATIO    RSY         RSX         RSZ
     0.065334    0.015967    0.989658      --          --          --

     After getting the data I needed, I saved the design file and then 
copied the old CCL routines back to their proper place.  One last recompile 
with the stock CCL restored OSLO to it normal operation.

     So, I have solved the immediate problem but there must be an easier 
and safer way to add your own user defined error functions.  I guess I 
still have a lot of reading of the help files to do.  I would hope there is 
some way to do this from the command line rather than modifying the 
underlying CCL code for OSLO.  Has no one else tried something like this 
before?

Best Regards,

John D. Upton
Georgetown, TX
<http://www.atm-workshop.com/>      "The ATM's Workshop Page"
<http://hometown.aol.com/RonWin20/>  "Ronchi For Windows Software Page"