-
I've been working with a few aspheric surfaces and noticed the aspheric profile didn't look right in the pictures. So I checked the sag depth and it doesn't match. I used the sag depth calculator here to verify. I've been entering the coefficients like an even asphere A2, A4, A6, A8, etc. I tried adding extra 0s in the coefficients like if it took even and odd terms with A1, A2, A3, A4 etc. terms, but the sag depth is unchanged. If I zero out all the coefficients and just leave the cc, the sag value reported stays the same too. Only if I change the cc, the sag depth updates so I think it's somehow not getting the asphere terms.
Output Should be 15.19550 Another Example
Output Should be 19.35262 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @jakecarr3, from rayoptics.environment import * opm = OpticalModel()
sm = opm['seq_model']
osp = opm['optical_spec']
pm = opm['parax_model']
em = opm['ele_model']
pt = opm['part_tree']
ar = opm['analysis_results'] opm.radius_mode = True
sm.do_apertures = False
sm.gaps[0].thi = 1e11 Radial vs Even PolynomialsRadialPolynomial profileThe RadialPolynomial profile includes both even and odd terms in r. The entries for rad_poly correspond to the 2nd, 3rd, 4th, and 5th powers of r. Note that creating standalone profile instances requires you to explicitly call the update() method on the profile instance. rad_poly = RadialPolynomial(r=95.867658, cc=0, coefs=[0., 8.180497E-7, -7.007436E-12, -5.576895E-15, 4.688910E-18])
rad_poly.update()
print(f"radial poly sag = {rad_poly.sag(45.72, 0.):12.5f}")
EvenPolynomial profileThe EvenPolynomial profile include only even powers of r. The entries for even_poly correspond to the 4th, 6th, 8th, and 10th powers of r. The update() method for the profile must be called for the sag() evaluation to be correct. even_poly = EvenPolynomial(r=95.867658, cc=0, coefs=[0., 8.180497E-7, -7.007436E-12, -5.576895E-15, 4.688910E-18])
even_poly.update()
print(f"even poly sag = {even_poly.sag(45.72, 0.):12.5f}")
The RadialPolynomial may be used as long as the odd polynomial terms are explicitly entered as zero. rad_poly1 = RadialPolynomial(r=95.867658, cc=0, coefs=[0., 0., 0., 8.180497E-7, 0., -7.007436E-12, 0., -5.576895E-15, 0., 4.688910E-18])
rad_poly1.update()
print(f"radial poly 1 sag = {rad_poly1.sag(45.72, 0.):12.5f}")
Use of update_model()Normally, when entering profiles as part of the model definition, the call to update_model() on the optical model will update all of the profiles in the model, as seen below. sm.add_surface([95.867658, 5.08, 2.6563], sd=45.72)
rad_poly2 = RadialPolynomial(r=95.867658, cc=0, coefs=[0., 0., 0., 8.180497E-7, 0., -7.007436E-12, 0., -5.576895E-15, 0., 4.688910E-18])
sm.ifcs[sm.cur_surface].profile = rad_poly2 sm.add_surface([95.867658, 5.08, 2.6563], sd=45.72)
even_poly1 = EvenPolynomial(r=95.867658, cc=0, coefs=[0., 8.180497E-7, -7.007436E-12, -5.576895E-15, 4.688910E-18])
sm.ifcs[sm.cur_surface].profile = even_poly1 opm.update_model() listobj(even_poly1)
print(f"even poly 1 sag = {even_poly1.sag(45.72, 0.):12.5f}")
listobj(rad_poly2)
print(f"radial poly 2 sag = {rad_poly2.sag(45.72, 0.):12.5f}")
Example 2, using the EvenPolynomialexample2 = EvenPolynomial(r=48.358836, cc=-2.474466, coefs=[0., 3.460039E-6, 1.053395E-10, 2.273815E-13, 1.045178E-16])
example2.update()
print(f"example2 sag = {example2.sag(36.575, 0.):12.5f}")
|
Beta Was this translation helpful? Give feedback.
-
Even Polynominal and update for the win! That worked perfectly. Thanks for your help and all the work you've done putting this together. |
Beta Was this translation helpful? Give feedback.
Even Polynominal and update for the win! That worked perfectly. Thanks for your help and all the work you've done putting this together.