Designing second surface mirrors #92
-
Hi! What is the "idiomatic" or "expected" way to specify a second surface mirror in a design? I want to simulate a telescope in which both the primary and secondary mirrors are second surface mirrors and the first surface of each has a different radius than the mirrored surface. This first design has four optical surfaces in total. I hope that explanation makes sense. One solution is to add two glass-air surfaces along the optical path - one before the mirror and one after - and then add a somewhat complex cost function to force the two to be at the same position and have the same radii. Is there a simpler way? Thanks for the great library! Best, Edit: Just a clarification - if I just add a surface before the mirror, it gets ignored by the reflected rays. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Daniel, Thanks for the question. That's an interesting one. I think the best way to solve this is to use pickups, which allow you enforce constraints between surfaces. See a usage example in the docs here. You will still need to define three surfaces, as you mention:
You can use pickups to enforce:
During optimization, if you wish to modify the thickness or radii of curvature, then you should only add a variable for the first surface. The second surface will be picked up and therefore shouldn't be optimized. Example: import numpy as np
from optiland.optic import Optic
from optiland.physical_apertures import RadialAperture
class Telescope(Optic):
"""A poorly designed telescope with second surface mirrors"""
def __init__(self):
super().__init__()
self.add_surface(index=0, thickness=np.inf)
self.add_surface(index=1, thickness=35)
obscuration = RadialAperture(r_max=np.inf, r_min=5)
self.add_surface(
index=2,
radius=-100,
thickness=5,
conic=-1,
material="BK7",
aperture=obscuration
)
self.add_surface(
index=3,
radius=-100,
thickness=-5,
conic=-1,
material="mirror",
is_stop=True,
aperture=obscuration
)
self.add_surface(
index=4,
radius=-100,
thickness=-30,
conic=-1,
material="air", # default, but we specify it for clarity
aperture=obscuration
)
self.add_surface(
index=5,
radius=-25,
thickness=-5,
conic=0,
material='BK7'
)
self.add_surface(
index=6,
radius=-25,
thickness=5,
conic=0,
material="mirror"
)
self.add_surface(
index=7,
radius=-25,
thickness=50,
conic=0,
material="air" # default, but we specify it for clarity
)
self.add_surface(index=8) # image plane
self.set_aperture(aperture_type="EPD", value=30)
self.set_field_type(field_type="angle")
self.add_field(y=0)
self.add_wavelength(value=0.55, is_primary=True)
telescope = Telescope()
# add pickup for thickness constraint
telescope.pickups.add(
source_surface_idx=2, # only optimize this surface index
target_surface_idx=3,
attr_type="thickness",
scale=-1,
offset=0
)
# add pickup for radius constraint
telescope.pickups.add(
source_surface_idx=2, # only optimize this surface index
target_surface_idx=4,
attr_type="radius",
scale=1,
offset=0
)
# update the thickness
telescope.set_thickness(value=6, surface_number=2)
# update the radius
telescope.set_radius(value=-99, surface_number=2)
# updates the surfaces based on the pickups - note that this is done automatically in optimization
telescope.update() Hope this helps. Let me know if anything isn't clear. Regards, P.S. I found a small bug in the visualization module, which results in the glass surface not drawing correctly for the telescope above (another reason I'm glad you opened this issue). Only the visualization is impacted, i.e., raytracing is still correct. I will make a note to fix this. |
Beta Was this translation helpful? Give feedback.
Hi Daniel,
Thanks for the question. That's an interesting one.
I think the best way to solve this is to use pickups, which allow you enforce constraints between surfaces. See a usage example in the docs here. You will still need to define three surfaces, as you mention:
You can use pickups to enforce:
During optimization, if you wish to modify the thickness or radii of curvature, then you should only add a variable for the first surface. The second surface will be …