The file PIAA_mshapes.pdf explains how the optics shapes are defined. Figure 1 and Section 3 are probably the most important parts of this document. In equation (1), profile(r) has been fitted by a series of cosines (straight polynomial fit didn't work well - cosines are much better suited for this), but, if possible, the numerical sag table should be used (it is more accurate).If you can accept the sag file for profile(r), I can send it to you with whatever sampling you require (here I use about 20000 points regularly sampled from the center to the edge of the optical element, corresponding to a ~2 micron sampling). The numerical sag table for profile(r) is attached to my email as profile1.dat for M1 and profile2.dat for M2. For both files, the unit is m for r (first column) and z (second column). I include in my email the coefficients alpha_k of equation (3) and beta_k of equations (6) and (17) : coefficients alpha_k (first column is k, second is alpha_k in m) : 0 0.00007084700111122894 1 -0.00008455100722011421 2 0.00001886102261948885 3 -0.00000771398551384871 4 0.00000402644284163697 5 -0.00000239368661955812 6 0.00000154045510107712 7 -0.00000104409310030831 8 0.00000073303049911252 9 -0.00000052712792736489 10 0.00000038514827182445 11 -0.00000028406840028796 12 0.00000021033600066832 13 -0.00000015548888868176 14 0.00000011409890996174 15 -0.00000008249921486586 16 0.00000005819614428889 17 -0.00000003940060569733 18 0.00000002484528004368 19 -0.00000001357489508906 20 0.00000000489339151885 21 0.00000000174687858473 22 -0.00000000675240027040 23 0.00000001045568701110 24 -0.00000001310606516184 25 0.00000001491509831206 26 -0.00000001604181394661 27 0.00000001662601946550 28 -0.00000001677225283784 29 0.00000001657570260008 30 -0.00000001610657630210 31 0.00000001543113534599 32 -0.00000001459710888475 33 0.00000001365129019165 34 -0.00000001262617568373 35 0.00000001155501492467 36 -0.00000001045966525711 37 0.00000000936368071572 38 -0.00000000828129656501 39 0.00000000722895998069 40 -0.00000000621533585998 41 0.00000000525156823024 42 -0.00000000434219600467 43 0.00000000349436077955 44 -0.00000000270952806937 45 0.00000000199180598758 46 -0.00000000134037840682 47 0.00000000075706398255 48 -0.00000000023937841233 49 -0.00000000021256308690 50 0.00000000060242658869 51 -0.00000000093132942595 52 0.00000000120372710832 53 -0.00000000142158607355 54 0.00000000158983145288 55 -0.00000000171096487205 56 0.00000000179012014824 57 -0.00000000183007722978 58 0.00000000183596709842 59 -0.00000000181064006322 60 0.00000000175905551633 61 -0.00000000168396872308 62 0.00000000159003676329 63 -0.00000000147979248336 64 0.00000000135749374737 65 -0.00000000122535738380 66 0.00000000108717569276 67 -0.00000000094478627901 68 0.00000000080147657776 69 -0.00000000065866848172 70 0.00000000051912918454 71 -0.00000000038385173146 72 0.00000000025508836426 73 -0.00000000013341008853 74 0.00000000002057670931 75 0.00000000008323957818 76 -0.00000000017673478296 77 0.00000000026009923748 78 -0.00000000033243749564 79 0.00000000039425638153 80 -0.00000000044501421983 81 0.00000000048548170801 82 -0.00000000051541157600 83 0.00000000053578230482 84 -0.00000000054657990754 85 0.00000000054893356368 86 -0.00000000054300222212 87 0.00000000053001027294 88 -0.00000000051023212993 89 0.00000000048493533183 90 -0.00000000045445697180 91 0.00000000042006085923 92 -0.00000000038210004343 93 0.00000000034179407400 94 -0.00000000029947235993 95 0.00000000025627681761 96 -0.00000000021248127861 97 0.00000000016912435866 98 -0.00000000012640024917 99 0.00000000008522629581 coefficients beta_k (first column is k, second is beta_k in m) : 0 1.1251102691 1 -0.00009532156380897044 2 -0.00001270543117864716 3 -0.00000140033310800966 4 0.00000007096940892862 5 0.00000003483746754808 6 -0.00000001796930371407 7 0.00000000055000069016 8 0.00000000440900188411 9 -0.00000000112411443811 10 -0.00000000142241949306 11 0.00000000095013851207 12 0.00000000038785525347 13 -0.00000000040598549387 14 -0.00000000011669420175 15 0.00000000028412885072 16 0.00000000002379246487 17 -0.00000000011372145200 18 0.00000000001195889789 19 0.00000000009345198880 20 -0.00000000000720268110 21 -0.00000000003306956845 22 0.00000000001908836621 23 0.00000000003588505272 24 -0.00000000000539489829 25 -0.00000000000927164745 26 0.00000000001428240053 27 0.00000000001586565182 28 -0.00000000000212920794 29 -0.00000000000167919123 30 0.00000000000995704497 31 0.00000000000794033287 32 -0.00000000000014711712 33 0.00000000000078509555 34 0.00000000000704235984 35 0.00000000000445135706 36 0.00000000000085712905 37 0.00000000000149053510 38 0.00000000000514528679 39 0.00000000000277304412 For information, here is the C code used to generate the optics shapes. Please note that the Zernike indexing is somewhat arbitrary and that mirrornb is 0 for M1 and 1 for M2. int PIAA_raytrace_compute_M(int mirrornb, double x, double y, double *z) { double r; double PA; int inside = 1; /* 0 if the ray misses the mirror */ double f; double rad2; r=sqrt(x*x+y*y)/piaaconf.beam_radius; PA=atan2(y,x); if(mirrornb==0) { z[0] = 0.00007084700111122894; z[0] += -0.00008455100722011421*cos(1.0*r*PI); z[0] += 0.00001886102261948885*cos(2.0*r*PI); z[0] += -0.00000771398551384871*cos(3.0*r*PI); z[0] += 0.00000402644284163697*cos(4.0*r*PI); z[0] += -0.00000239368661955812*cos(5.0*r*PI); z[0] += 0.00000154045510107712*cos(6.0*r*PI); z[0] += -0.00000104409310030831*cos(7.0*r*PI); z[0] += 0.00000073303049911252*cos(8.0*r*PI); z[0] += -0.00000052712792736489*cos(9.0*r*PI); z[0] += 0.00000038514827182445*cos(10.0*r*PI); z[0] += -0.00000028406840028796*cos(11.0*r*PI); z[0] += 0.00000021033600066832*cos(12.0*r*PI); z[0] += -0.00000015548888868176*cos(13.0*r*PI); z[0] += 0.00000011409890996174*cos(14.0*r*PI); z[0] += -0.00000008249921486586*cos(15.0*r*PI); z[0] += 0.00000005819614428889*cos(16.0*r*PI); z[0] += -0.00000003940060569733*cos(17.0*r*PI); z[0] += 0.00000002484528004368*cos(18.0*r*PI); z[0] += -0.00000001357489508906*cos(19.0*r*PI); z[0] += 0.00000000489339151885*cos(20.0*r*PI); z[0] += 0.00000000174687858473*cos(21.0*r*PI); z[0] += -0.00000000675240027040*cos(22.0*r*PI); z[0] += 0.00000001045568701110*cos(23.0*r*PI); z[0] += -0.00000001310606516184*cos(24.0*r*PI); z[0] += 0.00000001491509831206*cos(25.0*r*PI); z[0] += -0.00000001604181394661*cos(26.0*r*PI); z[0] += 0.00000001662601946550*cos(27.0*r*PI); z[0] += -0.00000001677225283784*cos(28.0*r*PI); z[0] += 0.00000001657570260008*cos(29.0*r*PI); z[0] += -0.00000001610657630210*cos(30.0*r*PI); z[0] += 0.00000001543113534599*cos(31.0*r*PI); z[0] += -0.00000001459710888475*cos(32.0*r*PI); z[0] += 0.00000001365129019165*cos(33.0*r*PI); z[0] += -0.00000001262617568373*cos(34.0*r*PI); z[0] += 0.00000001155501492467*cos(35.0*r*PI); z[0] += -0.00000001045966525711*cos(36.0*r*PI); z[0] += 0.00000000936368071572*cos(37.0*r*PI); z[0] += -0.00000000828129656501*cos(38.0*r*PI); z[0] += 0.00000000722895998069*cos(39.0*r*PI); z[0] += -0.00000000621533585998*cos(40.0*r*PI); z[0] += 0.00000000525156823024*cos(41.0*r*PI); z[0] += -0.00000000434219600467*cos(42.0*r*PI); z[0] += 0.00000000349436077955*cos(43.0*r*PI); z[0] += -0.00000000270952806937*cos(44.0*r*PI); z[0] += 0.00000000199180598758*cos(45.0*r*PI); z[0] += -0.00000000134037840682*cos(46.0*r*PI); z[0] += 0.00000000075706398255*cos(47.0*r*PI); z[0] += -0.00000000023937841233*cos(48.0*r*PI); z[0] += -0.00000000021256308690*cos(49.0*r*PI); z[0] += 0.00000000060242658869*cos(50.0*r*PI); z[0] += -0.00000000093132942595*cos(51.0*r*PI); z[0] += 0.00000000120372710832*cos(52.0*r*PI); z[0] += -0.00000000142158607355*cos(53.0*r*PI); z[0] += 0.00000000158983145288*cos(54.0*r*PI); z[0] += -0.00000000171096487205*cos(55.0*r*PI); z[0] += 0.00000000179012014824*cos(56.0*r*PI); z[0] += -0.00000000183007722978*cos(57.0*r*PI); z[0] += 0.00000000183596709842*cos(58.0*r*PI); z[0] += -0.00000000181064006322*cos(59.0*r*PI); z[0] += 0.00000000175905551633*cos(60.0*r*PI); z[0] += -0.00000000168396872308*cos(61.0*r*PI); z[0] += 0.00000000159003676329*cos(62.0*r*PI); z[0] += -0.00000000147979248336*cos(63.0*r*PI); z[0] += 0.00000000135749374737*cos(64.0*r*PI); z[0] += -0.00000000122535738380*cos(65.0*r*PI); z[0] += 0.00000000108717569276*cos(66.0*r*PI); z[0] += -0.00000000094478627901*cos(67.0*r*PI); z[0] += 0.00000000080147657776*cos(68.0*r*PI); z[0] += -0.00000000065866848172*cos(69.0*r*PI); z[0] += 0.00000000051912918454*cos(70.0*r*PI); z[0] += -0.00000000038385173146*cos(71.0*r*PI); z[0] += 0.00000000025508836426*cos(72.0*r*PI); z[0] += -0.00000000013341008853*cos(73.0*r*PI); z[0] += 0.00000000002057670931*cos(74.0*r*PI); z[0] += 0.00000000008323957818*cos(75.0*r*PI); z[0] += -0.00000000017673478296*cos(76.0*r*PI); z[0] += 0.00000000026009923748*cos(77.0*r*PI); z[0] += -0.00000000033243749564*cos(78.0*r*PI); z[0] += 0.00000000039425638153*cos(79.0*r*PI); z[0] += -0.00000000044501421983*cos(80.0*r*PI); z[0] += 0.00000000048548170801*cos(81.0*r*PI); z[0] += -0.00000000051541157600*cos(82.0*r*PI); z[0] += 0.00000000053578230482*cos(83.0*r*PI); z[0] += -0.00000000054657990754*cos(84.0*r*PI); z[0] += 0.00000000054893356368*cos(85.0*r*PI); z[0] += -0.00000000054300222212*cos(86.0*r*PI); z[0] += 0.00000000053001027294*cos(87.0*r*PI); z[0] += -0.00000000051023212993*cos(88.0*r*PI); z[0] += 0.00000000048493533183*cos(89.0*r*PI); z[0] += -0.00000000045445697180*cos(90.0*r*PI); z[0] += 0.00000000042006085923*cos(91.0*r*PI); z[0] += -0.00000000038210004343*cos(92.0*r*PI); z[0] += 0.00000000034179407400*cos(93.0*r*PI); z[0] += -0.00000000029947235993*cos(94.0*r*PI); z[0] += 0.00000000025627681761*cos(95.0*r*PI); z[0] += -0.00000000021248127861*cos(96.0*r*PI); z[0] += 0.00000000016912435866*cos(97.0*r*PI); z[0] += -0.00000000012640024917*cos(98.0*r*PI); z[0] += 0.00000000008522629581*cos(99.0*r*PI); rad2 = (piaaconf.offaxisdist-x)*(piaaconf.offaxisdist-x)+y*y; f = (piaaconf.focal+sqrt(piaaconf.focal*piaaconf.focal+piaaconf.offaxisdist*piaaconf.offaxisdist))/2.0; z[0] += 0.25/f*(rad2-piaaconf.offaxisdist*piaaconf.offaxisdist); z[0] -= 0.0000162*x; z[0] += 0.00099*(x*x+y*y); z[0] -= 0.0000001*Zernike_value(8,r,PA); } else { z[0] = 1.1251102691; z[0] += -0.00009532156380897044*cos(1.0*r*PI); z[0] += -0.00001270543117864716*cos(2.0*r*PI); z[0] += -0.00000140033310800966*cos(3.0*r*PI); z[0] += 0.00000007096940892862*cos(4.0*r*PI); z[0] += 0.00000003483746754808*cos(5.0*r*PI); z[0] += -0.00000001796930371407*cos(6.0*r*PI); z[0] += 0.00000000055000069016*cos(7.0*r*PI); z[0] += 0.00000000440900188411*cos(8.0*r*PI); z[0] += -0.00000000112411443811*cos(9.0*r*PI); z[0] += -0.00000000142241949306*cos(10.0*r*PI); z[0] += 0.00000000095013851207*cos(11.0*r*PI); z[0] += 0.00000000038785525347*cos(12.0*r*PI); z[0] += -0.00000000040598549387*cos(13.0*r*PI); z[0] += -0.00000000011669420175*cos(14.0*r*PI); z[0] += 0.00000000028412885072*cos(15.0*r*PI); z[0] += 0.00000000002379246487*cos(16.0*r*PI); z[0] += -0.00000000011372145200*cos(17.0*r*PI); z[0] += 0.00000000001195889789*cos(18.0*r*PI); z[0] += 0.00000000009345198880*cos(19.0*r*PI); z[0] += -0.00000000000720268110*cos(20.0*r*PI); z[0] += -0.00000000003306956845*cos(21.0*r*PI); z[0] += 0.00000000001908836621*cos(22.0*r*PI); z[0] += 0.00000000003588505272*cos(23.0*r*PI); z[0] += -0.00000000000539489829*cos(24.0*r*PI); z[0] += -0.00000000000927164745*cos(25.0*r*PI); z[0] += 0.00000000001428240053*cos(26.0*r*PI); z[0] += 0.00000000001586565182*cos(27.0*r*PI); z[0] += -0.00000000000212920794*cos(28.0*r*PI); z[0] += -0.00000000000167919123*cos(29.0*r*PI); z[0] += 0.00000000000995704497*cos(30.0*r*PI); z[0] += 0.00000000000794033287*cos(31.0*r*PI); z[0] += -0.00000000000014711712*cos(32.0*r*PI); z[0] += 0.00000000000078509555*cos(33.0*r*PI); z[0] += 0.00000000000704235984*cos(34.0*r*PI); z[0] += 0.00000000000445135706*cos(35.0*r*PI); z[0] += 0.00000000000085712905*cos(36.0*r*PI); z[0] += 0.00000000000149053510*cos(37.0*r*PI); z[0] += 0.00000000000514528679*cos(38.0*r*PI); z[0] += 0.00000000000277304412*cos(39.0*r*PI); rad2 = (piaaconf.offaxisdist+x)*(piaaconf.offaxisdist+x)+y*y; f = (piaaconf.focal+sqrt(piaaconf.focal*piaaconf.focal+piaaconf.offaxisdist*piaaconf.offaxisdist))/2.0; z[0] -= 0.25/f*(rad2-piaaconf.offaxisdist*piaaconf.offaxisdist); /* z[0] += 0.0000000511575*x*2.0;*/ /*Zernike_value(2,r,PA);*/ /* 51 nm */ z[0] += 0.0000027284*x; /* z[0] += 0.0000012613417*(x*x+y*y); */ z[0] += 0.000896954*(x*x+y*y); z[0] -= 0.0000000004714*Zernike_value(5,r,PA); /* 0.47 nm*/ z[0] += 0.0000000361255*Zernike_value(8,r,PA); /* 36 nm */ z[0] -= 0.00000013074775*Zernike_value(12,r,PA); /* 130 nm */ z[0] -= 0.0000000049253*Zernike_value(18,r,PA); /* 5 nm */ z[0] += 0.00000003064*Zernike_value(24,r,PA); /* 30 nm */ z[0] -= 0.00000000681846*Zernike_value(32,r,PA); z[0] -= 0.00000000320335*Zernike_value(40,r,PA); z[0] += 0.000000003663385*Zernike_value(50,r,PA); z[0] -= 0.000000003399*Zernike_value(60,r,PA); z[0] -= 0.00000000082*Zernike_value(72,r,PA); z[0] += 0.000000003431488*Zernike_value(84,r,PA); z[0] -= 0.0000000010967*Zernike_value(98,r,PA); z[0] -= 0.000000001706*Zernike_value(112,r,PA); z[0] += 0.0000000014381*Zernike_value(128,r,PA); z[0] -= 0.000000001078*Zernike_value(162,r,PA); } return(inside); }