opticks.imaging_model.aperture

Classes

Aperture(data, grid)

Aperture class.

class Aperture(data, grid)[source]

Aperture class.

Holds the Aperture data as defined by prysm. The aperture data is an ndarray mask of bool or 0 and 1 (or anything in between).

Parameters:
  • data (ndarray) – aperture data

  • grid (Grid) – Grid object associated with the aperture

classmethod circle_aperture(aperture_diam, samples, with_units=True)[source]

Circle aperture model.

This is valid for many if not most refractive optics.

This is a thin wrapper around the aperture building procedure from prysm.

The output is an Aperture object containing ndarray of bools, therefore the unit input is not important for the aperture generation. But the backing Grid object does use units.

Return type:

Aperture

Parameters:
  • aperture_diam (Quantity) – aperture diameter in mm

  • samples (int or tuple of int) – number of samples per dimension. If a scalar value, broadcast to both dimensions. Order is numpy axis convention, (row, col)

  • with_units (bool, optional) – Grid returned with units (in mm and radians)

Returns:

aperture (Aperture) – Aperture mask object

classmethod circle_aperture_with_obscuration(aperture_diam, obscuration_ratio, samples, with_units=True)[source]

Circle aperture model with circular centre obscuration.

This is valid for many reflective telescopes. The obscuration is usually the secondary mirror.

This is a thin wrapper around the aperture building procedure from prysm.

The output is an Aperture object containing ndarray of bools, therefore the unit input is not important for the aperture generation.

Return type:

Aperture

Parameters:
  • aperture_diam (Quantity) – aperture diameter in mm

  • obscuration_ratio (float) – obscuration ratio (between 0 and 1)

  • samples (int or tuple of int) – number of samples per dimension. If a scalar value, broadcast to both dimensions. Order is numpy axis convention, (row, col)

  • with_units (bool, optional) – Grid returned with units (in mm and radians)

Returns:

aperture (Aperture) – Aperture mask object

grid: Grid

Grid object associated with the aperture

scale_for_norm_peak_psf(Q, Q_pad=1)[source]

Generates a new, scaled Aperture that results in a Point Spread Function (PSF) that has a peak of 1.0.

Q_pad is used to pad the aperture if needed. It is passed on to the underlying pad2d.

The aperture data (data) is multiplied by Q x Q_pad x sqrt(data.size) / data.sum().

Return type:

Aperture

Parameters:
  • Q (float) – Q factor used in scaling pupil samples to psf samples

  • Q_pad (float, optional) – padding factor, by default 1

Returns:

Aperture – New Aperture object with scaled data

scale_for_norm_sum_psf()[source]

Generates a new, scaled Aperture that results in a Point Spread Function (PSF) that has a sum of 1.0.

The aperture data (data) is divided by sqrt(data.sum()).

Return type:

Aperture