physical_apertures.spider#
Spider Aperture Module
This module contains the SpiderAperture class, which represents the vanes of a spider: straight arms of equal width that run outward from a common centre and block the rays that fall on them.
Classes
|
Represents a spider that blocks the rays falling on its arms. |
- class SpiderAperture(width, num_arms, offset_x=0, offset_y=0)[source]#
Represents a spider that blocks the rays falling on its arms.
The arms are half-lines of equal width from the centre, equally spaced in angle, the first along +x. A ray is blocked when it lies on an arm’s side of the centre and within half the width of the arm’s centreline; every other ray passes, with no outer limit.
- Variables:
- contains(x, y)[source]#
Checks if the given point is inside the aperture.
- Parameters:
x (np.ndarray) – The x-coordinate of the point.
y (np.ndarray) – The y-coordinate of the point.
- Returns:
- Boolean array indicating if the point is inside the
aperture, that is, not on an arm.
- Return type:
np.ndarray
- property extent#
Returns the extent of the aperture.
- Returns:
- The extent of the aperture in the x and y directions. The
arms have no outer limit.
- Return type:
- classmethod from_dict(data)[source]#
Create an aperture from a dictionary representation.
- Parameters:
data (dict) – The dictionary representation of the aperture.
- Returns:
The aperture object.
- Return type:
- scale(scale_factor)[source]#
Scales the aperture by the given factor.
- Parameters:
scale_factor (float) – The factor by which to scale the aperture.
- to_dict()[source]#
Convert the aperture to a dictionary.
- Returns:
The dictionary representation of the aperture.
- Return type: