fouriax.RSPropagator#
- class RSPropagator(distance_um=None, use_sampling_planner=True, nyquist_factor=2.0, min_padding_factor=2.0, precomputed_grid=None, warn_on_regime_mismatch=True, equality_tolerance=1e-06, refractive_index=1.0, precomputed_transfer_stack=None)#
Bases:
OpticalLayerRayleigh–Sommerfeld propagator via convolution with the RS impulse response.
Requires spatial-domain input. Supports both scalar and Jones fields. When
use_sampling_plannerisTrue(default) the field is automatically resampled / padded to a Nyquist-safe grid before propagation and restored to the original grid afterwards.All length quantities are in micrometers.
- Parameters:
distance_um (float | None) – Propagation distance in micrometers.
use_sampling_planner (bool) – Whether to apply automatic Nyquist resampling.
nyquist_factor (float) – Oversampling relative to the Nyquist limit.
min_padding_factor (float) – Minimum padding multiplier for the propagation grid.
precomputed_grid (Grid | None) – Optional pre-built propagation grid, bypassing the automatic planner.
warn_on_regime_mismatch (bool) – Emit a warning when the propagation distance falls outside the recommended RS regime.
equality_tolerance (float) – Tolerance for the regime boundary.
refractive_index (float) – Refractive index of the propagation medium.
precomputed_transfer_stack (Array | None) – Optional precomputed RS convolution OTF stack on the planned work grid.
- __init__(distance_um=None, use_sampling_planner=True, nyquist_factor=2.0, min_padding_factor=2.0, precomputed_grid=None, warn_on_regime_mismatch=True, equality_tolerance=1e-06, refractive_index=1.0, precomputed_transfer_stack=None)#
- Parameters:
distance_um (float | None)
use_sampling_planner (bool)
nyquist_factor (float)
min_padding_factor (float)
precomputed_grid (Grid | None)
warn_on_regime_mismatch (bool)
equality_tolerance (float)
refractive_index (float)
precomputed_transfer_stack (Array | None)
- Return type:
None
Methods
__init__([distance_um, ...])delta_response(field, wavelength_um, distance_um)Return the Rayleigh-Sommerfeld impulse response on
field.grid.forward(field)Propagate a spatial-domain field with the RS convolution model.
Return trainable parameters exposed by this layer.
validate_for(field)Check that field is compatible with this layer.
Attributes
- distance_um: float | None = None#
- use_sampling_planner: bool = True#
- nyquist_factor: float = 2.0#
- min_padding_factor: float = 2.0#
- warn_on_regime_mismatch: bool = True#
- equality_tolerance: float = 1e-06#
- refractive_index: float = 1.0#
- precomputed_transfer_stack: Array | None = None#
- delta_response(field, wavelength_um, distance_um)#
Return the Rayleigh-Sommerfeld impulse response on
field.grid.- Parameters:
field (Field) – Spatial-domain field whose grid defines the sampling lattice.
wavelength_um (float) – Wavelength to propagate in micrometers.
distance_um (float) – Propagation distance in micrometers.
- Returns:
Complex array with shape
(ny, nx)sampled onfield.grid.- Raises:
ValueError – If
distance_umis not strictly positive.- Return type:
Array
- parameters()#
Return trainable parameters exposed by this layer.
- Return type:
dict[str, Array]
- forward(field)#
Propagate a spatial-domain field with the RS convolution model.
- Parameters:
field (Field) – Spatial-domain input field with scalar or Jones data layout.
- Returns:
Spatial-domain field sampled on the original input grid. If the sampling planner is enabled, resampling and padding are applied internally and then undone before returning.
- Raises:
ValueError – If the input domain is wrong or propagation parameters are invalid.
- Return type: