Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def square_aperture(pos, l, w, t):
return RectangularAperture(pos, l, w, t)
def aperture(r, pos):
""" Creates circular & rectangular apertures of given size """
circ = CircularAperture(pos, r)
rect = RectangularAperture(pos, r, r, 0.0)
return circ, rect
def aperture(r, pos):
""" Creates circular & rectangular apertures of given size """
circ = CircularAperture(pos, r)
rect = RectangularAperture(pos, r, r, 0.0)
return circ, rect
def rectangle(pos, l, w, t):
return RectangularAperture(pos, l, w, t)
def create_ap(pos):
""" Defines the custom aperture, as inputted by the user """
nonlocal shape, r, l, w, t
if shape=='circle':
return CircularAperture(pos, r)
elif shape=='rectangle':
return RectangularAperture(pos, l, w, t)
else:
print("Shape of aperture not recognized. Please input: circle or rectangle")
return
def aperture(r, pos):
circ = CircularAperture(pos, r)
rect = RectangularAperture(pos, r, r, 0.0)
return circ, rect