distribution#
Distribution Module
This module provides various classes representing 2D pupil distributions.
Kramer Harrison, 2024
Functions
|
Create a distribution based on the given distribution type. |
Classes
Base class for distributions. |
|
A class representing a cross-shaped distribution. |
|
A class for Gaussian quadrature on circular domains, based on [1]. |
|
A class representing a hexagonal distribution. |
|
|
A class representing a line distribution along the x-axis. |
|
A class representing a line distribution along the y-axis. |
|
A class representing a random distribution. |
RingDistribution class for generating points along a single ring. |
|
|
A class representing a Sobol distribution. |
Represents a uniform distribution of points within a square, which is |
- class BaseDistribution[source]#
Base class for distributions.
- This class provides a base implementation for generating points and
visualizing the distribution.
- Variables:
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- class CrossDistribution[source]#
A class representing a cross-shaped distribution.
This distribution generates points in the shape of a cross, with the x-axis and y-axis as the arms of the cross. If num_points is odd, it generates 2 * num_points - 1 points. If num_points is even and positive, it generates 2 * num_points points. num_points represents the number of points along the full extent of each axis before potential origin merging. If num_points is 0, 0 points are generated.
- Variables:
x – Array of x-coordinates of the generated points.
y – Array of y-coordinates of the generated points.
- class GaussianQuadrature[source]#
A class for Gaussian quadrature on circular domains, based on [1].
Generates points in a circular pattern, with optimal placement for Gaussian quadrature over the unit disk. The total number of points is num_rings * num_spokes.
- Variables:
x – Array of x-coordinates of the generated points.
y – Array of y-coordinates of the generated points.
weights – Array of weights, normalized to 1.0.
- class HexagonalDistribution[source]#
A class representing a hexagonal distribution.
Generates points in a hexagonal pattern. The total number of points is 1 + 3 * num_rings * (num_rings + 1), including the center point.
- Variables:
x – Array of x-coordinates of the generated points.
y – Array of y-coordinates of the generated points.
- class LineXDistribution(positive_only: bool = False)[source]#
A class representing a line distribution along the x-axis.
Generates num_points along the x-axis.
- Variables:
positive_only (bool) – Flag indicating whether the distribution should be limited to positive values only.
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- class LineYDistribution(positive_only: bool = False)[source]#
A class representing a line distribution along the y-axis.
Generates num_points along the y-axis.
- Variables:
positive_only – Flag indicating whether the distribution should be positive-only.
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- class RandomDistribution(seed=None)[source]#
A class representing a random distribution.
Generates num_points random points within the unit disk.
- Variables:
rng (be.Generator) – The random number generator from the backend.
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- class RingDistribution[source]#
RingDistribution class for generating points along a single ring.
Generates num_points along a single ring at the maximum aperture value (radius 1).
- class SobolDistribution(seed: int | None = None)[source]#
A class representing a Sobol distribution.
Generates num_points points using a Sobol low-discrepancy sequence within the unit disk.
- Variables:
seed (int | None) – Seed for the Sobol sequence generator.
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- class UniformDistribution[source]#
- Represents a uniform distribution of points within a square, which is
masked to the unit disk.
Generates points on a square grid of num_points x num_points and then masks them to the unit disk. The resulting number of points is approximately num_points^2 * pi / 4.
- Variables:
x – The x-coordinates of the generated points.
y – The y-coordinates of the generated points.
- create_distribution(distribution_type: DistributionType) BaseDistribution[source]#
Create a distribution based on the given distribution type.
- Parameters:
distribution_type – The type of distribution to create.
- Returns:
An instance of the specified distribution type.
- Raises:
ValueError – If an invalid distribution type is provided.