Skip to content

API reference

makewfs.WavefrontSensor

Configured wavefront-sensor facade.

Construct once and call :meth:expose for each closed-loop residual OPD. photon_rate exposes the deterministic optical result for workflows that use another detector or need an ideal reference image.

charge_diffusion_fwhm_px property

charge_diffusion_fwhm_px

Return the resolved sensor's lateral charge-diffusion FWHM in pixels.

Charge diffusion is detector physics owned by getframes; this only reports the resolved value, so a consumer recording provenance does not have to restate a detector measurement of its own.

from_toml classmethod

from_toml(path)

Build a sensor from a validated TOML file.

photon_rate

photon_rate(wavefront)

Return the ideal native-pixel photon rate before detector noise.

reference

reference()

Return the ideal image for a zero dynamic OPD.

valid_subapertures

valid_subapertures()

Return the configured static Shack--Hartmann lenslet-valid mask.

The mask is derived from pupil illumination and the configured minimum illuminated fraction, not from a detector frame. It is therefore safe to freeze into a calibration artifact and use for active-slope vector ordering. Pyramid sensors do not have lenslet subapertures.

subaperture_plate_scale_arcsec

subaperture_plate_scale_arcsec()

Return the on-sky angle one detector pixel subtends per subaperture.

Shack--Hartmann only. Derived from the configured spot sampling and the subaperture's own size on sky, so it stays consistent with the geometry that actually forms the spots rather than restating it.

subaperture_field_of_view_arcsec

subaperture_field_of_view_arcsec()

Return the on-sky field of view one subaperture's window spans.

A Shack--Hartmann's detector window is itself a field stop. Each subaperture's spot is formed and integrated only over its own pixels_per_subaperture block, and the blocks are tiled without overlap, so light beyond this field is neither recorded nor allowed to contaminate a neighbour. An instrument whose physical field stop matches its pixel field is therefore already represented; one whose stop is larger would spill light between subapertures, which this does not model. Reporting the value makes that assumption checkable instead of leaving it implied by the pixel count.

pupil_illumination

pupil_illumination(shape=None)

Return the configured pupil illumination on a requested grid.

Consumers that own actuator or wavefront models need the illumination on the same grid their own arrays use, and pupil formation belongs here, so this evaluates the configured telescope pupil on shape (default config.input.shape) rather than the sensor's internal propagation grid. A configured custom_mask_path is not resampled: it must already match the requested shape, so supply the mask at that sampling instead of letting a mask be silently interpolated.

expose

expose(wavefront, *, seed=None, out=None)

Render one wavefront into optional caller-owned detector storage.

expose_many

expose_many(phases, seeds=None)

Yield one detector frame per phase sample without stacking the stream.

expose_integrated

expose_integrated(phase_samples, *, seed=None, out=None)

Expose temporally averaged OPD into optional caller-owned detector storage.

makewfs.load_config

load_config(path)

Load a validated TOML configuration.

makewfs.simulate

simulate(wavefront, config, *, seed=None)

One-shot convenience wrapper around :class:WavefrontSensor.

makewfs.config.WFSConfig dataclass

Complete immutable makewfs configuration.

digest property

digest

Short SHA-256 digest of the normalized configuration.

from_toml classmethod

from_toml(path)

Load and validate a TOML configuration, resolving relative paths.

to_dict

to_dict()

Return a JSON/TOML-friendly representation.

makewfs.config.ConfigError

Bases: ValueError

Raised when a configuration is invalid or uses an unknown field.