OPIC for OSLO EDU

//hlp:Contributed by Brian Blandford

//hlp:Generates an error function based on those developed in the 1970s //hlp: at Imperial College, London by Charles Wynne,Pru Wormell,Mike Kidger //hlp: and others. This version is intended primarily for users of OSLO LT, //hlp: OSLO EDU or OSLO Light, but will work with all versions of OSLO.

//hlp:The command calculates vignetting, and then defines an opti- //hlp: misation error function with 50 operands.

//hlp:The optimisation error function consists of the weighted sum of //hlp: the following operands:

//hlp:* Four paraxial ray quantities: //hlp: 1 PY Height of the paraxial axial marginal ray at the image //hlp: 2 PU Angle of this ray in the image space //hlp: 3 PYC Height of the paraxial pupil (chief) ray at the image //hlp: 4 PUC Angle of this ray in the image space //hlp: * Two first order chromatic coefficients for wavelengths 2 and 3: //hlp: 5 PAC Primary axial (longitudinal) chromatic focal shift //hlp: 6 PLC Primary lateral chromatic aberration //hlp: * Two first order chromatic coefficients for wavelengths 1 and 2: //hlp: 7 SAC Secondary axial (longitudinal) chromatic focal shift //hlp: 8 SLC Secondary lateral chromatic aberration //hlp: * Two geometrical optics parameters: //hlp: 9 OALL The overall lens length (from srf 1 to srf IMS-1) //hlp: 10 For focal systems, the equivalent focal length EFL; //hlp: for afocal systems, the paraxial angular magnification AMAG. //hlp: * A user-defined operand: //hlp: 11 User: A spare parameter for user-defined operands programmed //hlp: by the user within optim_ic_EDU.ccl. The routine is supplied with //hlp: the mean RMS spot radius for the field points FBY = 0.0, 0.7, 1.0 //hlp: as an example.

//hlp:The remaining aberrations are those of finite rays: //hlp: For focal systems, all monochromatic ray aberrations are linear - //hlp: (DX, DY etc). For afocal systems they are angular (DXA, DYA etc) //hlp: expressed as direction tangents - e.g YA=L/M or tan(YANG). //hlp: Colour aberrations (COL) are optical path differences between wave- //hlp: lengths 2 and 3, known as the "Conrady D minus d" - or DMD - see //hlp: Welford WT: Aberrations of Optical Systems (Adam Hilger 1986) p 202. //hlp: * For the axial object point (FBY = 0): //hlp: 12 A_DY the aberration of the marginal ray FY = 1.0). //hlp: 13 A_COL The chromatic optical path difference of this ray //hlp: 14 A_Z_DY For the axial object point, the zonal ray (FY = 0.7) //hlp: 15 A_Z_COL The chromatic optical path difference of this ray //hlp: * For the first off-axis image point (FBY = 0.7): //hlp: 16 M_XFS The paraxial sagittal focal shift of the pupil ray. //hlp: 17 M_YFS The paraxial tangential focal shift of the pupil ray. //hlp: 18 M_DIST% The percentage distortion at the 0.7 field //hlp: 19 M_T_DY The aberration of the top marginal ray (FY = +1.0) //hlp: 20 M_T_COL The chromatic optical path difference of this ray //hlp: 21 M_TZ_DY The aberration of the top zonal ray (FY = +0.7) //hlp: 22 M_TZ_COL The chromatic optical path difference of this ray //hlp: 23 M_BZ_DY The aberration of the bottom zonal ray (FY = -0.7) //hlp: 24 M_BZ_COL The chromatic optical path difference of this ray //hlp: 25 M_B_DY The aberration of the bottom marginal ray (FY = -1.0) //hlp: 26 M_B_COL The chromatic optical path difference of this ray //hlp: 27 M_S_DX The aberration of the sagittal marginal ray (FX = +1.0) //hlp: 28 M_S_DY The aberration of this ray in the Y direction //hlp: 29 M_S_COL The chromatic optical path difference of this ray //hlp: 30 M_SZ_DX The aberration of the sagittal zonal ray (FX = +0.7) //hlp: 31 M_SZ_DY The aberration of this ray in the Y direction //hlp: 32 M_SZ_COL The chromatic optical path difference of this ray //hlp: * For the second off-axis image point (FBY = 1.0) //hlp: 33 E_XFS The paraxial sagittal focal shift of the pupil ray. //hlp: 34 E_YFS The paraxial tangential focal shift of the pupil ray. //hlp: 35 E_DIST% The percentage distortion at the edge of the field //hlp: 36 E_PLC The lateral primary chromatic aberration of the pupil ray //hlp: 37 E_T_DY The aberration of the top marginal ray (FY = +1.0) //hlp: 38 E_T_COL The chromatic optical path difference of this ray //hlp: 39 E_TZ_DY The aberration of the top zonal ray (FY = +0.7) //hlp: 40 E_TZ_COL The chromatic optical path difference of this ray //hlp: 41 E_BZ_DY The aberration of the bottom zonal ray (FY = -0.7) //hlp: 42 E_BZ_COL The chromatic optical path difference of this ray //hlp: 43 E_B_DY The aberration of the bottom marginal ray (FY = -1.0) //hlp: 44 E_B_COL The chromatic optical path difference of this ray //hlp: 45 E_S_DX The aberration of the sagittal marginal ray (FX = +1.0) //hlp: 46 E_S_DY The aberration of this ray in the Y direction //hlp: 47 E_S_COL The chromatic optical path difference of this ray //hlp: 48 E_SZ_DX The aberration of the sagittal zonal ray (FX = +0.7) //hlp: 49 E_SZ_DY The aberration of this ray in the Y direction //hlp: 50 E_SZ_COL The chromatic optical path difference of this ray

//hlp: //hlp:To use:

//hlp:1. Type in command: opc gen [operating_conditions general] //hlp: Check that the evaluation mode (focal/afocal) of the starting //hlp: design is correct. //hlp: 2. Type in command: pxs [paraxial_setup] //hlp: Check that the starting design has the desired values of the key //hlp: parameters for the four types of optical system: //hlp: * Objective (infinite-finite, focal) //hlp: the effective focal length and entrance beam radius //hlp: * Reverse objective (finite-infinite, afocal) //hlp: the effective focal length and object numerical aperture //hlp: * Relay (finite-finite, focal) //hlp: the paraxial magnification and object numerical aperture //hlp: * Telescope (infinite-infinite, afocal) //hlp: the paraxial angular magnification and entrance beam radius //hlp: 3. Type in command rpt_ric ray 0 0 0[ray intercept report graphic] //hlp: Check that at least part of the pupil is traced for each of //hlp: the three default field points (axis, 0.7 and full field). //hlp: 4. Then call by typing the command opic (or e.g. opic 0.5 - the //hlp: number scales the relative weights of all chromatic ray aberrations; //hlp: the default value for colour_weight is 1.0) //hlp: 5. * For focal systems: //hlp: Check that the target on operand 2 is the target numerical aperture //hlp: (PU) required, and that the target on operand 9 is the target overall //hlp: lens length (OALL). //hlp: If equivalent focal length (EFL) is to be controlled, check that the //hlp: target for operand 10 is the value required and assign a weight. //hlp: * For afocal systems: //hlp: Check that the target on operand 1 is the paraxial marginal ray height //hlp: (PY) for the desired magnification. Also check that the //hlp: target on operand 9 is the desired overall lens length (OALL). //hlp: If angular magnification is to be controlled, check that the target //hlp: for operand 10 is the value (AMAG) required, and assign a weight. //hlp: 6. Define some variable parameters (command vse) such as curvatures. //hlp: 7. Type in command ite (or click on Ite in the text window header.

//hlp:Exceptions: //hlp: 1. The mid-field distortion value is incorrect for ray aiming mode = //hlp: "wide angle". //hlp: 2. If the aperture is expressed as image space NA or controlled by an //hlp: angle solve on the last curve, the PU control will not be effective - //hlp: weight the EFL instead.

//kwd: Imperial College, merit function //cat: optimization { static int ssb_row_sav; static char non_zero_value[12],non_zero_tgt_string1[20]; static char non_zero_tgt_string2[20],non_zero_tgt_string3[20]; static char nbrstr[81]; static double raycoord,m_ymin,m_ymax,m_xmax,e_ymin,e_ymax,e_xmax; set_preference(output_text,off);//turns off printed output /******** ********* Vignetting calculation ****** ********* ********* *******/ wav(1); trace_ref_ray(0.7,0.0,0.0);//mid-field vignetting calculation for (raycoord=-0.05;raycoord>-1.001;raycoord=raycoord-0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(raycoord,0.0); if (ssb(1,1)==1e20) break; m_ymin=raycoord; sbr(-ssb_row_sav,0); } for (raycoord=0.05;raycoord<1.001;raycoord=raycoord+0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(raycoord,0.0); if (ssb(1,1)==1e20) break; m_ymax=raycoord; sbr(-ssb_row_sav,0); } for (raycoord=0.05;raycoord<1.001;raycoord=raycoord+0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(0.0,raycoord); if (ssb(1,1)==1e20) break; m_xmax=raycoord; sbr(-ssb_row_sav,0); } trace_ref_ray(1.0,0.0,0.0);//edge of field vignetting calculation for (raycoord=-0.05;raycoord>-1.001;raycoord=raycoord-0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(raycoord,0.0); if (ssb(1,1)==1e20) break; e_ymin=raycoord; sbr(-ssb_row_sav,0); } for (raycoord=0.05;raycoord<1.001;raycoord=raycoord+0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(raycoord,0.0); if (ssb(1,1)==1e20) break; e_ymax=raycoord; sbr(-ssb_row_sav,0); } for (raycoord=0.05;raycoord<1.001;raycoord=raycoord+0.05) { sbr(ssb_row_sav,2,1e20); trace_ray(0.0,raycoord); if (ssb(1,1)==1e20) break; e_xmax=raycoord; sbr(-ssb_row_sav,0); } sprintf(nbrstr,"opic %.2f %.2f %.2f %.2f %.2f %.2f ", m_ymin,m_ymax,m_xmax,e_ymin,e_ymax,e_xmax); sno6(nbrstr);//vignetting factors stored in system note 6. /******** ********* Optimisation condition settings ******* ********* *******/ if (numw==1) colour_weight=0.0; operands(new);//clears operands end; opt_dampstart(1e-4);//starting value of damping factor opt_sum_of_sqrs(on);//weighted sum of squares as merit function opt_solutiontol(1e-6);//% improvement for continuing iterations opt_oprdccl("opcb_ic");//callback to opcb_ic (below) opcb_ic;//call-back to generate initial values for non-zero targets set_preference(output_text,off);//turns off printed output /******** ********* Operands for focal systems **** ******* ********* *******/ if (!afo) { printf("opic: Operands defined for focal system with colour weight %.2f\n",colour_weight); printf("EDU Vignetting factors ymin ymax xmax ymin ymax xmax \n"); printf(" for FBY = 0.7, 1.0: %.2f %.2f %.2f, %.2f %.2f %.2f \n",m_ymin,m_ymax,m_xmax,e_ymin,e_ymax,e_xmax); sprintf(non_zero_value,"%+2.8f",-Ocm[2]);//non-zero target for PU sprintf(non_zero_tgt_string1,"%s","OCM2"); strcat (non_zero_tgt_string1,non_zero_value); sprintf(non_zero_value,"%+9.4f",-Ocm[9]);//non-zero target for OALLGTH sprintf(non_zero_tgt_string2,"%s","OCM9"); strcat (non_zero_tgt_string2,non_zero_value); sprintf(non_zero_value,"%+9.4f",-Ocm[10]);//non-zero target for EFL sprintf(non_zero_tgt_string3,"%s","OCM10"); strcat (non_zero_tgt_string3,non_zero_value); operands(new);//define operands o(1,ins,"OCM1",0.000,"PY");//Axial ray height o(2,ins,non_zero_tgt_string1,1000.0,"PU");//Axial ray slope o(3,ins,"OCM3",0.000,"PYC");//pupil ray height o(4,ins,"OCM4",0.000,"PUC");//pupil ray slope o(5,ins,"OCM5",0.000,"PAC");//primary axial colour o(6,ins,"OCM6",0.000,"PLC");//primary lateral colour o(7,ins,"OCM7",0.000,"SAC");//secondary axial colour o(8,ins,"OCM8",0.000,"SLC");//secondary lateral colour o(9,ins,non_zero_tgt_string2,1.0,"OALL");//overall lens length o(10,ins,non_zero_tgt_string3,0.000,"EFL");//equivalent focal length o(11,ins,"OCM11",0.0,"[USER]");//*user-defined* o(12,ins,"OCM12",150.000,"A_DY");//On axis fby=0.0: fy +1 ray dy o(13,ins,"OCM13",.005*colour_weight,"A_COL");// fy +1 ray colour o(14,ins,"OCM14",210.0,"A_Z_DY");// fy +.7 ray dy o(15,ins,"OCM15",.007*colour_weight,"A_Z_COL");// fy +.7 colour o(16,ins,"OCM16",0.15,"M_XFS");//fby=0.7 field: paraxial S focal shift o(17,ins,"OCM17",0.15,"M_YFS");// paraxial T focal shift o(18,ins,"OCM18",0.0015,"M_DIST%");// % distortion o(19,ins,"OCM19",50.0,"M_T_DY");// fy +1 ray dy o(20,ins,"OCM20",.003*colour_weight,"M_T_COL");// fy +1 ray colour o(21,ins,"OCM21",70.0,"M_TZ_DY");// fy .7 ray dy o(22,ins,"OCM22",.005*colour_weight,"M_TZ_COL");// fy .7 ray colour o(23,ins,"OCM23",70.0,"M_BZ_DY");// fy -.7 ray dy o(24,ins,"OCM24",.005*colour_weight,"M_BZ_COL");// fy -.7 ray colour o(25,ins,"OCM25",50.0,"M_B_DY");// fy -1 ray dy o(26,ins,"OCM26",.003*colour_weight,"M_B_COL");// fy -1 ray colour o(27,ins,"OCM27",70.0,"M_S_DX");// fx +1 ray dx o(28,ins,"OCM28",140.0,"M_S_DY");// fx +1 ray dy o(29,ins,"OCM29",.008*colour_weight,"M_S_COL");// fx +1 ray colour o(30,ins,"OCM30",98.0,"M_SZ_DX");// fx +.7 ray dx o(31,ins,"OCM31",196.0,"M_SZ_DY");// fx +.7 ray dy o(32,ins,"OCM32",.012*colour_weight,"M_SZ_COL");// fx +.7 ray colour o(33,ins,"OCM33",0.1,"E_XFS");//fby=1.0 field: paraxial S focal shift o(34,ins,"OCM34",0.1,"E_YFS");// paraxial T focal shift o(35,ins,"OCM35",0.0005,"E_DIST%");// % distortion o(36,ins,"OCM36",40.0*colour_weight,"E_PLC");//lateral colour (yc3-yc2) o(37,ins,"OCM37",40.0,"E_T_DY");//fy +1 ray dy o(38,ins,"OCM38",.002*colour_weight,"E_T_COL");//fy +1 ray colour o(39,ins,"OCM39",56.0,"E_TZ_DY");//fy +.7 ray dy o(40,ins,"OCM40",.003*colour_weight,"E_TZ_COL");//fy +.7 ray colour o(41,ins,"OCM41",56.0,"E_BZ_DY");//fy -.7 ray dy o(42,ins,"OCM42",.003*colour_weight,"E_BZ_COL");//fy -.7 ray colour o(43,ins,"OCM43",40.0,"E_B_DY");//fy -1 ray dy o(44,ins,"OCM44",.002*colour_weight,"E_B_COL");//fy -1 ray colour o(45,ins,"OCM45",56.0,"E_S_DX");//fx +1 ray dx o(46,ins,"OCM46",112.0,"E_S_DY");//fx +1 ray dy o(47,ins,"OCM47",.006*colour_weight,"E_S_COL");//fx +1 ray colour o(48,ins,"OCM48",78.4,"E_SZ_DX");//fx +.7 ray dx o(49,ins,"OCM49",156.8,"E_SZ_DY");//fx +.7 ray dy o(50,ins,"OCM50",.009*colour_weight,"E_SZ_COL");//fx +.7 ray colour end();//end of operands - focal // } /******** ********* Operands for afocal systems *** ******* ********* *******/ else { printf("opic: Operands defined for afocal system with colour weight %.2f\n",colour_weight); printf("EDU Vignetting factors ymin ymax xmax ymin ymax xmax \n"); printf(" for FBY = 0.7, 1.0: %.2f %.2f %.2f, %.2f %.2f %.2f \n",m_ymin,m_ymax,m_xmax,e_ymin,e_ymax,e_xmax); sprintf(non_zero_value,"%+5.6f",-Ocm[1]);//non-zero target for PY sprintf(non_zero_tgt_string1,"%s","OCM1"); strcat (non_zero_tgt_string1,non_zero_value); sprintf(non_zero_value,"%+9.4f",-Ocm[9]);//non-zero target for OALL sprintf(non_zero_tgt_string2,"%s","OCM9"); strcat (non_zero_tgt_string2,non_zero_value); sprintf(non_zero_value,"%+5.6f",-Ocm[10]);//non-zero target for AMAG sprintf(non_zero_tgt_string3,"%s","OCM10"); strcat (non_zero_tgt_string3,non_zero_value); operands(new);//define operands // //Paraxial quantities// o(1,ins,non_zero_tgt_string1,100.0,"PY");//axial ray height o(2,ins,"OCM2",0.000,"PU");//axial ray slope o(3,ins,"OCM3",0.000,"PYC");//pupil (chief) ray height o(4,ins,"OCM4",0.000,"PUC");//pupil (chief) ray slope //Seidel aberrations o(5,ins,"OCM5",0.000,"PAC");//primary axial colour o(6,ins,"OCM6",0.000,"PLC");//primary lateral colour o(7,ins,"OCM7",0.000,"SAC");//secondary axial colour o(8,ins,"OCM8",0.000,"SLC");//secondary lateral colour o(9,ins,non_zero_tgt_string2,1.0,"OALL");//overall lens length o(10,ins,non_zero_tgt_string3,0.000,"AMAG");//angular magnification //User-defined quantities o(11,ins,"OCM11",0.000,"[ USER ]");//*user-defined* //Finite ray angular aberrations o(12,ins,"OCM12",150000.0,"A_DYA");//On axis fby=0.0: fy +1 ray dy o(13,ins,"OCM13",0.005*colour_weight,"A_COL");// fy +1 ray colour o(14,ins,"OCM14",210000.0,"A_Z_DYA");// fy +.7 ray dy o(15,ins,"OCM15",0.007*colour_weight,"A_Z_COL");// fy +.7 colour o(16,ins,"OCM16",0.0,"M_XFSA");//fby=0.7 field: paraxial S focal shift o(17,ins,"OCM17",0.0,"M_YFSA");// paraxial T focal shift o(18,ins,"OCM18",0.0015,"M_DIST%");// % distortion o(19,ins,"OCM19",50000.0,"M_T_DYA");// fy +1 ray dy o(20,ins,"OCM20",.003*colour_weight,"M_T_COL");// fy +1 ray colour o(21,ins,"OCM21",70000.0,"M_TZ_DYA");// fy .7 ray dy o(22,ins,"OCM22",.005*colour_weight,"M_TZ_COL");// fy .7 ray colour o(23,ins,"OCM23",70000.0,"M_BZ_DYA");// fy -.7 ray dy o(24,ins,"OCM24",.005*colour_weight,"M_BZ_COL");// fy -.7 ray colour o(25,ins,"OCM25",50000.0,"M_B_DYA");// fy -1 ray dy o(26,ins,"OCM26",.003*colour_weight,"M_B_COL");// fy -1 ray colour o(27,ins,"OCM27",70000.0,"M_S_DXA");// fx +1 ray dx o(28,ins,"OCM28",140000.0,"M_S_DYA");// fx +1 ray dy o(29,ins,"OCM29",.008*colour_weight,"M_S_COL");// fx +1 ray colour o(30,ins,"OCM30",98000.0,"M_SZ_DXA");// fx +.7 ray dx o(31,ins,"OCM31",196000.0,"M_SZ_DYA");// fx +.7 ray dy o(32,ins,"OCM32",.012*colour_weight,"M_SZ_COL");// fx +.7 ray colour o(33,ins,"OCM33",100.0,"E_XFSA");//fby=1.0 field: paraxial S focal shift o(34,ins,"OCM34",100.0,"E_YFSA");// paraxial T focal shift o(35,ins,"OCM35",0.0005,"E_DIST%");// % distortion o(36,ins,"OCM36",40.0*colour_weight,"E_PLCA");// lateral colour (yca3-yca2) o(37,ins,"OCM37",40000.0,"E_T_DYA");// fy +1 ray dy o(38,ins,"OCM38",.002*colour_weight,"E_T_COL");// fy +1 ray colour o(39,ins,"OCM39",56000.0,"E_TZ_DYA");// fy +.7 ray dy o(40,ins,"OCM40",.003*colour_weight,"E_TZ_COL");// fy +.7 ray colour o(41,ins,"OCM41",56000.0,"E_BZ_DYA");// fy -.7 ray dy o(42,ins,"OCM42",.003*colour_weight,"E_BZ_COL");// fy -.7 ray colour o(43,ins,"OCM43",40000.0,"E_B_DYA");// fy -1 ray dy o(44,ins,"OCM44",.002*colour_weight,"E_B_COL");//fy -1 ray colour o(45,ins,"OCM45",56000.0,"E_S_DXA");// fx +1 ray dx o(46,ins,"OCM46",112000.0,"E_S_DYA");// fx +1 ray dy o(47,ins,"OCM47",.006*colour_weight,"E_S_COL");// fx +1 ray colour o(48,ins,"OCM48",78400.0,"E_SZ_DXA");// fx +.7 ray dx o(49,ins,"OCM49",156800.0,"E_SZ_DYA");// fx +.7 ray dy o(50,ins,"OCM50",.009*colour_weight,"E_SZ_COL");// fx +.7 ray colour end();//end of operands - afocal // } set_preference(output_text,on);//turns printed output back on /******** ********* ********* ********* ********* ********* ********* *******/ } cmd opcb_ic() /******** ********* ********* ********* ********* ********* ********* *******/ //hlp:This is the error function callback for opic OSLO EDU version

/******** ********* ********* ********* ********* ********* ********* *******/ { static char nbrstr[81]; static double m_ymin,m_ymax,m_xmax,e_ymin,e_ymax,e_xmax; static int ssb_row_sav; m_ymin=-1.0;//vignetting at field point M (0.7) m_ymax=1.0; m_xmax=1.0; e_ymin=-1.0;//vignetting at field point E (1.0) e_ymax=1.0; e_xmax=1.0; set_preference(output_text,off);//turn printing off get_system_note(6);//vignetting factor recovery from system note 6 strtoken(nbrstr,system_note," "); if (!strcmp(nbrstr,"opic")) { strtoken(nbrstr,""," "); m_ymin = atof(nbrstr); strtoken(nbrstr,""," "); m_ymax = atof(nbrstr); strtoken(nbrstr,""," "); m_xmax = atof(nbrstr); strtoken(nbrstr,""," "); e_ymin = atof(nbrstr); strtoken(nbrstr,""," "); e_ymax = atof(nbrstr); strtoken(nbrstr,""," "); e_xmax = atof(nbrstr); } ssb_row_sav = sbrow;//spreadsheet buffer row count sbr(ssb_row_sav,1);//initialise the spread sheet buffer /******** ********* Define the elements of the OCM matrix * ********* *******/ wav(1); paraxial_trace(); Ocm[1] = ssb(1,1);//PY Ocm[2] = ssb(1,2);//PU Ocm[3] = ssb(1,4);//PYC Ocm[4] = ssb(1,5);//PUC chromatic_abers(); Ocm[5] = ssb(2,1);//PAC Ocm[6] = ssb(2,3);//PLC Ocm[7] = ssb(2,2);//SAC Ocm[8] = ssb(2,4);//SLC paraxial_setup_data(); Ocm[9] = ssb(10,1);//OALL paraxial_constants();//IF FOCAL: IF AFOCAL: Ocm[10] = ssb(18,1);// EFL AMAG sbr(-ssb_row_sav,0); ssb_row_sav=sbrow; sbr(ssb_row_sav,1);//re-initialise the spread sheet buffer //Insert commands to print any user-defined operand in the spreadsheet Ocm[11]=0.0;//Assign OCM11 to the user-defined operand //Example 1: Mean RMS spot radius at field points FBY=0, 0.7 & 1.0 trace_ref_ray(0.0,0.0,0.0,0.0,0.0,1); spot_diagram(); trace_ref_ray(0.7,0.0,0.0,0.0,0.0,1); spot_diagram(); trace_ref_ray(1.0,0.0,0.0,0.0,0.0,1); spot_diagram(); ocm[11]=(ssb(7,3)+ssb(15,3)+ssb(23,3))/3.0; //Example ends sbr(-ssb_row_sav,0); ssb_row_sav=sbrow; sbr(ssb_row_sav,1);//re-initialise the spread sheet buffer trace_ref_ray(0.0,0.0,0.0,0.0,0.0,1);//On axis FBY=0.0 trace_fan(y,all,2,0.7,1.0,0.0); trace_ref_ray(0.7,0.0,0.0,0.0,0.0,1);//Second field point FBY=0.7 trace_fan(y,all,21,m_ymin,m_ymax,0.0); trace_fan(x,all,11,0.0,m_xmax,0.0); if (numw>1) trace_ref_ray(1.0,0.0,0.0,0.0,0.0,2);//Edge of field FBY = 1.0 else trace_ref_ray(1.0,0.0,0.0,0.0,0.0,1); if (numw>2) trace_ref_ray(1.0,0.0,0.0,0.0,0.0,3); else trace_ref_ray(1.0,0.0,0.0,0.0,0.0,1); trace_ref_ray(1.0,0.0,0.0,0.0,0.0,1); wav(1); trace_fan(y,all,21,e_ymin,e_ymax,0.0); trace_fan(x,all,11,0.0,e_xmax,0.0); /******** ********* OCM values for focal systems ** ******* ********* *******/ if (!afo) { Ocm[12] = ssb(4,5);// DY FOR RAY FY=1.0 FIELD POINT FBY = 0.0 Ocm[14] = ssb(5,5);// DY FOR RAY FY=0.7 Ocm[18] = 100*(ssb(8,1)/(Ocm[3]*0.7))-100;//% DIST FIELD POINT FBY = 0.7 Ocm[19] = ssb(9,5);// DY FOR RAY FY=1.0 Ocm[21] = ssb(12,5);//DY FOR RAY FY=0.7 Ocm[23] = ssb(26,5);//DY FOR RAY FY=-0.7 Ocm[25] = ssb(29,5);//DY FOR RAY FY=-1.0 Ocm[27] = ssb(30,6);//DX FOR RAY FY=0.0 FX=1.0 Ocm[28] = ssb(30,5);//DY FOR RAY FY=0.0 FX=1.0 Ocm[30] = ssb(33,6);//DX FOR RAY FY=0.0 FX=0.7 Ocm[31] = ssb(33,5);//DY FOR RAY FY=0.0 FX=0.7 Ocm[35] = 100*(ssb(43,1)/Ocm[3])-100;//% DIST FIELD POINT FBY = 1.0 Ocm[37] = ssb(50,5);//DY FOR RAY FY=1.0 Ocm[39] = ssb(53,5);//DY FOR RAY FY=0.7 Ocm[41] = ssb(67,5);//DY FOR RAY FY=-0.7 Ocm[43] = ssb(70,5);//DY FOR RAY FY=-1.0 Ocm[45] = ssb(71,6);//DX FOR RAY FY=0.0 FX=1.0 Ocm[46] = ssb(71,5);//DY FOR RAY FY=0.0 FX=1.0 Ocm[48] = ssb(74,6);//DX FOR RAY FY=0.0 FX=0.7 Ocm[49] = ssb(74,5);//DY FOR RAY FY=0.0 FX=0.7 } else /******** ********* OCM values for afocal systems * ******* ********* *******/ { Ocm[12] = ssb(4,3);//DYA FOR RAY FY=1.0 FIELD POINT FBY = 0.0 Ocm[14] = ssb(5,3);//DYA FOR RAY FY=0.7 Ocm[18] = 100*ssb(8,1)/Ocm[4]/0.7-100;//% DIST FIELD POINT FBY = 0.7 Ocm[19] = ssb(9,3);// DYA FOR RAY FY=1.0 Ocm[21] = ssb(12,3);//DYA FOR RAY FY=0.7 Ocm[23] = ssb(26,3);//DYA FOR RAY FY=-0.7 Ocm[25] = ssb(29,3);//DYA FOR RAY FY=-1.0 Ocm[27] = ssb(30,4);//DXA FOR RAY FY=0.0 FX=1.0 Ocm[28] = ssb(30,3);//DYA FOR RAY FY=0.0 FX=1.0 Ocm[30] = ssb(33,4);//DXA FOR RAY FY=0.0 FX=0.7 Ocm[31] = ssb(33,3);//DYA FOR RAY FY=0.0 FX=0.7 Ocm[35] = 100*(ssb(49,1))/Ocm[4]-100;//% DIST FIELD POINT FBY = 1.0 Ocm[37] = ssb(50,3);//DYA FOR RAY FY=1.0 Ocm[39] = ssb(53,3);//DYA FOR RAY FY=0.7 Ocm[41] = ssb(67,3);//DYA FOR RAY FY=-0.7 Ocm[43] = ssb(70,3);//DYA FOR RAY FY=-1.0 Ocm[45] = ssb(71,4);//DXA FOR RAY FY=0.0 FX=1.0 Ocm[46] = ssb(71,3);//DYA FOR RAY FY=0.0 FX=1.0 Ocm[48] = ssb(74,4);//DXA FOR RAY FY=0.0 FX=0.7 Ocm[49] = ssb(74,3);//DYA FOR RAY FY=0.0 FX=0.7 } /******** ********* OCM values for both focal and afocal systems **** *******/ Ocm[13] = ssb(4,9);//DMD FOR RAY FY=1.0 FIELD POINT FBY = 0.0 Ocm[15] = ssb(5,9);//DMD FOR RAY FY=0.7 Ocm[16] = ssb(8,4);//XFS or XFSA FIELD POINT FBY = 0.7 Ocm[17] = ssb(8,3);//YFS or YFSA Ocm[20] = ssb(9,9);// DMD FOR RAY FY=1.0 Ocm[22] = ssb(12,9);//DMD FOR RAY FY=0.7 Ocm[24] = ssb(26,9);//DMD FOR RAY FY=-0.7 Ocm[26] = ssb(29,9);//DMD FOR RAY FY=-1.0 Ocm[29] = ssb(30,9);//DMD FOR RAY FY=0.0 FX=1.0 Ocm[32] = ssb(33,9);//DMD FOR RAY FY=0.0 FX=0.7 Ocm[33] = ssb(49,4);//XFS or XFSA FIELD POINT FBY = 1.0 Ocm[34] = ssb(49,3);//YFS or YFSA Ocm[36] = ssb(46,1)-ssb(43,1);//YC3-YC2 or YC3A-YC2A Ocm[38] = ssb(50,9);//DMD FOR RAY FY=1.0 Ocm[40] = ssb(53,9);//DMD FOR RAY FY=0.7 Ocm[42] = ssb(67,9);//DMD FOR RAY FY=-0.7 Ocm[44] = ssb(70,9);//DMD FOR RAY FY=-1.0 Ocm[47] = ssb(71,9);//DMD FOR RAY FY=0.0 FX=1.0 Ocm[50] = ssb(74,9);//DMD FOR RAY FY=0.0 FX=0.7 sbr(-ssb_row_sav,1);//restore spread sheet buffer set_preference(output_text,on);//turn printing on again /******** ********* ********* ********* ********* ********* ** 21 June 2008 */ }