Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrin committed Mar 6, 2024
1 parent 0dd9d49 commit 45b739e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
1 change: 0 additions & 1 deletion poppy/dms.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ class CircularSegmentedDeformableMirror(SegmentedDeformableMirror, optics.MultiC
units, and the WFE is therefore a factor of two larger. The returned WFE will be twice the
amplitude of the requested values (convolved with the actuator response function etc.)
"""

def __init__(self, rings=1, segment_radius=1.0 * u.m, gap=0.01 * u.m,
name='CircSegDM', center=True, include_factor_of_two=False, **kwargs):
#FIXME ? using grey pixel does not work. something in the geometry module generate a true divide error
Expand Down
19 changes: 1 addition & 18 deletions poppy/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ def __init__(self, name=None, radius=1.0 * u.meter,
self.rings) + 1) / self.rings) * self.radius

# determine angles per each section gap
# Note, this starts with angle 0 = +Y in the array, and
# Note, this starts with angle 0 = +X in the array, and
# increases counterclockwise around the aperture.
self.gap_angles = []
for iring in range(self.rings):
Expand Down Expand Up @@ -1737,28 +1737,12 @@ def _one_aperture(self, wave, index, value=1):
(theta < theta_max)] = value
return

# Draw the azimuthal gap after the ring
if iring > 0:
# print(f"drawing ring gap {iring} at {r_ring_inner}")
self.transmission[np.abs(r - r_ring_inner) < halfgapwidth] = 0

for igap in range(self.nsections[iring]):
angle = self.gap_angles[iring][igap]
# print(f" linear gap {igap} at {angle} radians")
# calculate rotated x' and y' coordinates after rotation by that angle.
x_p = np.cos(angle) * x + np.sin(angle) * y
y_p = -np.sin(angle) * x + np.cos(angle) * y

self.transmission[(0 < x_p) & (r_ring_inner < r) & (r < r_ring_outer) &
(np.abs(y_p) < halfgapwidth)] = 0


def _aper_center(self, aper_index):
""" Center coordinates of a given wedge aperture
counting counter clockwise around each ring
Returns y, x coords
"""
# which ring is this?
iring = self._aper_in_ring(aper_index)
Expand All @@ -1782,7 +1766,6 @@ def _aper_center(self, aper_index):
return ypos, xpos



class RectangleAperture(AnalyticOpticalElement):
""" Defines an ideal rectangular pupil aperture
Expand Down

0 comments on commit 45b739e

Please sign in to comment.