From 45b739eeac07db0680b3f0dd7fb0ef0f9ffa04bf Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Wed, 6 Mar 2024 14:24:54 -0500 Subject: [PATCH] minor code cleanup --- poppy/dms.py | 1 - poppy/optics.py | 19 +------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/poppy/dms.py b/poppy/dms.py index f5eea52d..a2d8e9bc 100644 --- a/poppy/dms.py +++ b/poppy/dms.py @@ -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 diff --git a/poppy/optics.py b/poppy/optics.py index 0c3c4383..ced19749 100644 --- a/poppy/optics.py +++ b/poppy/optics.py @@ -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): @@ -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) @@ -1782,7 +1766,6 @@ def _aper_center(self, aper_index): return ypos, xpos - class RectangleAperture(AnalyticOpticalElement): """ Defines an ideal rectangular pupil aperture